-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gui): add i18next and start localization
- Loading branch information
Showing
9 changed files
with
157 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { I18N_STRINGS_EN, RequiredStrings } from './en.js'; | ||
import { I18N_STRINGS_FR } from './fr.js'; | ||
|
||
export const I18N_STRINGS: Record<string, RequiredStrings> = { | ||
...I18N_STRINGS_EN, | ||
...I18N_STRINGS_FR, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export const I18N_STRINGS_EN = { | ||
en: { | ||
translation: { | ||
history: { | ||
empty: 'No results. Press Generate to create an image.', | ||
}, | ||
loading: { | ||
cancel: 'Cancel', | ||
progress: '{{current}} of {{total}} steps', | ||
unknown: 'many', | ||
}, | ||
tab: { | ||
blend: 'Blend', | ||
img2img: 'Img2img', | ||
inpaint: 'Inpaint', | ||
txt2txt: 'Txt2txt', | ||
txt2img: 'Txt2img', | ||
upscale: 'Upscale', | ||
}, | ||
tooltip: { | ||
delete: 'Delete', | ||
next: 'EN Next', | ||
previous: 'EN Previous', | ||
save: 'Save', | ||
}, | ||
} | ||
}, | ||
}; | ||
|
||
// easy way to make sure all locales have the complete set of strings | ||
export type RequiredStrings = typeof I18N_STRINGS_EN['en']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const I18N_STRINGS_FR = { | ||
fr: { | ||
translation: { | ||
tab: { | ||
blend: 'Blend', | ||
img2img: 'Img2img', | ||
inpaint: 'Inpaint', | ||
txt2txt: 'Txt2txt', | ||
txt2img: 'Txt2img', | ||
upscale: 'Upscale', | ||
}, | ||
tooltip: { | ||
delete: 'Delete', | ||
next: 'FR-Next', | ||
previous: 'FR-Previous', | ||
save: 'Save', | ||
}, | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,13 @@ | |
dependencies: | ||
regenerator-runtime "^0.13.11" | ||
|
||
"@babel/runtime@^7.19.4": | ||
version "7.21.0" | ||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" | ||
integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== | ||
dependencies: | ||
regenerator-runtime "^0.13.11" | ||
|
||
"@babel/types@^7.18.6": | ||
version "7.20.7" | ||
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" | ||
|
@@ -1852,11 +1859,32 @@ html-escaper@^2.0.0: | |
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" | ||
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== | ||
|
||
html-parse-stringify@^3.0.1: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2" | ||
integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg== | ||
dependencies: | ||
void-elements "3.1.0" | ||
|
||
hyphenate-style-name@^1.0.3: | ||
version "1.0.4" | ||
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz#691879af8e220aea5750e8827db4ef62a54e361d" | ||
integrity sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ== | ||
|
||
i18next-browser-languagedetector@^7.0.1: | ||
version "7.0.1" | ||
resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.0.1.tgz#ead34592edc96c6c3a618a51cb57ad027c5b5d87" | ||
integrity sha512-Pa5kFwaczXJAeHE56CHG2aWzFBMJNUNghf0Pm4SwSrEMps/PTKqW90EYWlIvhuYStf3Sn1K0vw+gH3+TLdkH1g== | ||
dependencies: | ||
"@babel/runtime" "^7.19.4" | ||
|
||
i18next@^22.4.10: | ||
version "22.4.10" | ||
resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.4.10.tgz#cfbfc412c6bc83e3c16564f47e6a5c145255960e" | ||
integrity sha512-3EqgGK6fAJRjnGgfkNSStl4mYLCjUoJID338yVyLMj5APT67HUtWoqSayZewiiC5elzMUB1VEUwcmSCoeQcNEA== | ||
dependencies: | ||
"@babel/runtime" "^7.20.6" | ||
|
||
ignore@^5.2.0: | ||
version "5.2.4" | ||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" | ||
|
@@ -2575,6 +2603,14 @@ react-dom@^18.2.0: | |
loose-envify "^1.1.0" | ||
scheduler "^0.23.0" | ||
|
||
react-i18next@^12.2.0: | ||
version "12.2.0" | ||
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-12.2.0.tgz#010e3f6070b8d700442947233352ebe4b252d7a1" | ||
integrity sha512-5XeVgSygaGfyFmDd2WcXvINRw2WEC1XviW1LXY/xLOEMzsCFRwKqfnHN+hUjla8ZipbVJR27GCMSuTr0BhBBBQ== | ||
dependencies: | ||
"@babel/runtime" "^7.20.6" | ||
html-parse-stringify "^3.0.1" | ||
|
||
react-is@^16.13.1, react-is@^16.7.0: | ||
version "16.13.1" | ||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" | ||
|
@@ -3095,6 +3131,11 @@ v8-to-istanbul@^9.0.0: | |
"@types/istanbul-lib-coverage" "^2.0.1" | ||
convert-source-map "^1.6.0" | ||
|
||
[email protected]: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09" | ||
integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w== | ||
|
||
which-boxed-primitive@^1.0.2: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" | ||
|