Add chinese language selector

This commit is contained in:
Made Baruna 2021-06-02 19:23:15 +07:00
parent 75ee03a309
commit 83eaaf07e0
No known key found for this signature in database
GPG key ID: 5AA5DA16AA5DCEAD
4 changed files with 139 additions and 0 deletions

View file

@ -26,6 +26,7 @@
{ id: 'ru', label: 'Русский' },
{ id: 'ko', label: '한국어' },
{ id: 'fr', label: 'Français' },
{ id: 'zh', label: '中文(简体)' },
];
$: currentLocale = languages.find((e) => e.id === $locale.substring(0, 2)) || { id: 'en', label: 'English' };
$: locales = languages.filter((e) => e.id !== currentLocale.id);
@ -48,6 +49,7 @@
function changeLocale(lang) {
locale.set(lang);
}
</script>
<div
@ -199,4 +201,5 @@
@apply rounded-xl;
}
}
</style>

View file

@ -5,6 +5,7 @@ import id from './locales/id.json';
import ru from './locales/ru.json';
import ko from './locales/ko.json';
import fr from './locales/fr.json';
import zh from './locales/zh.json';
const INIT_OPTIONS = {
fallbackLocale: 'en',
@ -28,6 +29,7 @@ addMessages('id', id);
addMessages('ru', ru);
addMessages('ko', ko);
addMessages('fr', fr);
addMessages('zh', zh);
export function startClient() {
const savedLocale = localStorage.getItem('locale');

View file

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="512"
height="512"
viewBox="-5 -5 10.24 10.24"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="cn.svg">
<metadata
id="metadata23">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1215"
inkscape:window-height="776"
id="namedview21"
showgrid="false"
inkscape:zoom="1.1660156"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<title
id="title4">Flag of the People's Republic of China</title>
<defs
id="defs8">
<polygon
id="s"
points="488533,-158734 -301930,415571 0,-513674 301930,415571 -488533,-158734 "
transform="scale(1.94676e-6,1.94676e-6)"
style="fill:#ffde00" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath3010">
<rect
style="fill:#000000;stroke:none"
id="rect3012"
width="26.666668"
height="20"
x="-5"
y="-15.400001" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath3000">
<rect
style="fill:#000000;stroke:none"
id="rect3002"
width="19.999998"
height="19.999998"
x="-5"
y="-15.4" />
</clipPath>
</defs>
<g
id="flag"
transform="matrix(0.51200002,0,0,0.51200002,-2.44,2.8848002)"
clip-path="url(#clipPath3000)"
inkscape:label="#g3000">
<rect
style="fill:#de2910"
id="rect6"
height="20"
width="30"
y="-15.4"
x="-5" />
<use
height="20"
width="30"
y="0"
x="0"
id="use11"
transform="matrix(3,0,0,3,0,-10.4)"
xlink:href="#s" />
<use
height="20"
width="30"
y="0"
x="0"
id="use13"
transform="matrix(-0.51449575,-0.85749293,0.85749293,-0.51449575,5,-13.4)"
xlink:href="#s" />
<use
height="20"
width="30"
y="0"
x="0"
id="use15"
transform="matrix(-0.14142135,-0.98994949,0.98994949,-0.14142135,7,-11.4)"
xlink:href="#s" />
<use
height="20"
width="30"
y="0"
x="0"
id="use17"
transform="matrix(0.27472113,-0.96152395,0.96152395,0.27472113,7,-8.4)"
xlink:href="#s" />
<use
height="20"
width="30"
y="0"
x="0"
id="use19"
transform="matrix(0.62469505,-0.78086881,0.78086881,0.62469505,5,-6.4)"
xlink:href="#s" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB