Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit cde0057

Browse files
authored
Merge branch 'master' into master
2 parents 6ce409d + 675ee98 commit cde0057

File tree

21 files changed

+730
-175
lines changed

21 files changed

+730
-175
lines changed

i18n/config.ts

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ import translationFR from './translations/fr-FR.json';
99
import translationCN from './translations/zh-CN.json';
1010
import translationJP from './translations/ja-JP.json';
1111

12+
const languages = {
13+
'en-US': {
14+
translation: translationEN,
15+
},
16+
'pt-BR': {
17+
translation: translationPT,
18+
},
19+
'es-ES': {
20+
translation: translationES,
21+
},
22+
'de-DE': {
23+
translation: translationDE,
24+
},
25+
'fr-FR': {
26+
translation: translationFR,
27+
},
28+
'zh-CN': {
29+
translation: translationCN,
30+
},
31+
'ja-JP': {
32+
translation: translationJP,
33+
},
34+
};
35+
36+
type Language = keyof typeof languages;
37+
1238
i18n
1339
// pass the i18n instance to react-i18next.
1440
.use(initReactI18next)
@@ -20,33 +46,12 @@ i18n
2046
fallbackLng: 'en-US',
2147
whitelist: ['en-US', 'pt-BR', 'es-ES', 'de-DE', 'fr-FR', 'zh-CN', 'ja-JP'],
2248
load: 'currentOnly',
23-
resources: {
24-
'en-US': {
25-
translation: translationEN,
26-
},
27-
'pt-BR': {
28-
translation: translationPT,
29-
},
30-
'es-ES': {
31-
translation: translationES,
32-
},
33-
'de-DE': {
34-
translation: translationDE,
35-
},
36-
'fr-FR': {
37-
translation: translationFR,
38-
},
39-
'zh-CN': {
40-
translation: translationCN,
41-
},
42-
'ja-JP': {
43-
translation: translationJP,
44-
},
45-
},
49+
resources: languages,
4650
debug: false,
4751
interpolation: {
4852
escapeValue: false, // react already safes from xss
4953
},
5054
});
5155

5256
export default i18n;
57+
export { Language };

i18n/translations/de-DE.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,15 @@
135135
"app-context-not-correct-used": "Der App-Kontext wurde nicht korrekt verwendet",
136136
"theme-context-not-correct-used": "Der Theme-Kontext wurde nicht korrekt verwendet",
137137
"package-meta-is-required-at-detail-context": "packageMeta wird bei DetailContext benötigt"
138-
}
138+
},
139+
"lng": {
140+
"english": "Englisch",
141+
"portuguese": "Portugiesisch",
142+
"spanish": "Spanisch",
143+
"german": "Deutsch",
144+
"chinese": "Chinesisch",
145+
"french": "Französisch"
146+
},
147+
"help-to-translate": "Hilfe beim Übersetzen",
148+
"change-language": "Sprache ändern"
139149
}

i18n/translations/en-US.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,15 @@
135135
"app-context-not-correct-used": "The app context was not used correctly",
136136
"theme-context-not-correct-used": "The theme context was not used correctly",
137137
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext"
138-
}
138+
},
139+
"lng": {
140+
"english": "English",
141+
"portuguese": "Portuguese",
142+
"spanish": "Spanish",
143+
"german": "German",
144+
"chinese": "Chinese",
145+
"french": "French"
146+
},
147+
"help-to-translate": "Help to translate",
148+
"change-language": "Change language"
139149
}

i18n/translations/es-ES.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,15 @@
135135
"app-context-not-correct-used": "El contexto de la aplicación no fue correctamente usado",
136136
"theme-context-not-correct-used": "El contexto del tema no fue correctamente usado",
137137
"package-meta-is-required-at-detail-context": "packageMeta es requerido en DetailContext"
138-
}
138+
},
139+
"lng": {
140+
"english": "Inglés",
141+
"portuguese": "Portugués",
142+
"spanish": "Español",
143+
"german": "Alemán",
144+
"chinese": "Chino",
145+
"french": "francés"
146+
},
147+
"help-to-translate": "Ayuda a traducir",
148+
"change-language": "Cambiar idioma"
139149
}

i18n/translations/fr-FR.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,15 @@
135135
"app-context-not-correct-used": "Le contexte de l'application n'a pas été utilisé correctement",
136136
"theme-context-not-correct-used": "Le contexte du thème n'a pas été utilisé correctement",
137137
"package-meta-is-required-at-detail-context": "packageMeta est obligatoire à DetailContext"
138-
}
138+
},
139+
"lng": {
140+
"english": "Anglaise",
141+
"portuguese": "Portugaise",
142+
"spanish": "Espagnol",
143+
"german": "Allemande",
144+
"chinese": "Chinoise",
145+
"french": "Française"
146+
},
147+
"help-to-translate": "Aide à traduire",
148+
"change-language": "Changer la langue"
139149
}

i18n/translations/pt-BR.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
}
115115
},
116116
"footer": {
117-
"powered-by": "Distribuído por",
117+
"powered-by": "Feito por",
118118
"made-with-love-on": "Feito com amor <0>♥</0> no(a)"
119119
},
120120
"button": {
@@ -135,5 +135,15 @@
135135
"app-context-not-correct-used": "O contexto do aplicativo não foi usado corretamente",
136136
"theme-context-not-correct-used": "O contexto do tema não foi usado corretamente",
137137
"package-meta-is-required-at-detail-context": "packageMeta é requerido em DetailContext"
138-
}
138+
},
139+
"lng": {
140+
"english": "Inglês",
141+
"portuguese": "Português",
142+
"spanish": "Espanhol",
143+
"german": "Alemão",
144+
"chinese": "Chinês",
145+
"french": "Francês"
146+
},
147+
"help-to-translate": "Ajude a traduzir",
148+
"change-language": "Mudar idioma"
139149
}

i18n/translations/zh-CN.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,15 @@
134134
},
135135
"app-context-not-correct-used": "The app context was not correct used",
136136
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext"
137-
}
137+
},
138+
"lng": {
139+
"english": "英語",
140+
"portuguese": "葡萄牙語",
141+
"spanish": "西班牙文",
142+
"german": "德語",
143+
"chinese": "中文",
144+
"french": "法國人"
145+
},
146+
"help-to-translate": "幫助翻譯",
147+
"change-language": "改變語言"
138148
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"bundlesize": [
141141
{
142142
"path": "./static/vendors.*.js",
143-
"maxSize": "200 kB"
143+
"maxSize": "210 kB"
144144
},
145145
{
146146
"path": "./static/main.*.js",

0 commit comments

Comments
 (0)