Add new languages
This commit is contained in:
parent
ebd97c253b
commit
6858485e41
1 changed files with 17 additions and 3 deletions
|
@ -16,6 +16,8 @@ import sv from './locales/sv.json';
|
||||||
import cs from './locales/cs.json';
|
import cs from './locales/cs.json';
|
||||||
import nbNO from './locales/nb-NO.json';
|
import nbNO from './locales/nb-NO.json';
|
||||||
import nl from './locales/nl.json';
|
import nl from './locales/nl.json';
|
||||||
|
import zhHant from './locales/zh-Hant.json';
|
||||||
|
import fa from './locales/fa.json';
|
||||||
|
|
||||||
const resources = {
|
const resources = {
|
||||||
en: { translation: en },
|
en: { translation: en },
|
||||||
|
@ -24,10 +26,12 @@ const resources = {
|
||||||
it: { translation: it },
|
it: { translation: it },
|
||||||
ru: { translation: ru },
|
ru: { translation: ru },
|
||||||
'pt-BR': { translation: ptBr },
|
'pt-BR': { translation: ptBr },
|
||||||
|
fa: { translation: fa },
|
||||||
fr: { translation: fr },
|
fr: { translation: fr },
|
||||||
ja: { translation: ja },
|
ja: { translation: ja },
|
||||||
pl: { translation: pl },
|
pl: { translation: pl },
|
||||||
'zh-Hans': { translation: zhHans },
|
'zh-Hans': { translation: zhHans },
|
||||||
|
'zh-Hant': { translation: zhHant },
|
||||||
sr: { translation: sr },
|
sr: { translation: sr },
|
||||||
sv: { translation: sv },
|
sv: { translation: sv },
|
||||||
cs: { translation: cs },
|
cs: { translation: cs },
|
||||||
|
@ -72,7 +76,10 @@ export const languages = [
|
||||||
label: 'Norsk (Bokmål)',
|
label: 'Norsk (Bokmål)',
|
||||||
value: 'nb-NO',
|
value: 'nb-NO',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'فارسی',
|
||||||
|
value: 'fa',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Português (Brasil)',
|
label: 'Português (Brasil)',
|
||||||
value: 'pt-BR',
|
value: 'pt-BR',
|
||||||
|
@ -97,6 +104,10 @@ export const languages = [
|
||||||
label: '简体中文',
|
label: '简体中文',
|
||||||
value: 'zh-Hans',
|
value: 'zh-Hans',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '繁體中文',
|
||||||
|
value: 'zh-Hant',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const lowerCasePostProcessor: PostProcessorModule = {
|
const lowerCasePostProcessor: PostProcessorModule = {
|
||||||
|
@ -125,7 +136,7 @@ const titleCasePostProcessor: PostProcessorModule = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const ignoreSentenceCaseLanguages = ['de']
|
const ignoreSentenceCaseLanguages = ['de'];
|
||||||
|
|
||||||
const sentenceCasePostProcessor: PostProcessorModule = {
|
const sentenceCasePostProcessor: PostProcessorModule = {
|
||||||
type: 'postProcessor',
|
type: 'postProcessor',
|
||||||
|
@ -136,7 +147,10 @@ const sentenceCasePostProcessor: PostProcessorModule = {
|
||||||
return sentences
|
return sentences
|
||||||
.map((sentence) => {
|
.map((sentence) => {
|
||||||
return (
|
return (
|
||||||
sentence.charAt(0).toLocaleUpperCase() + (!ignoreSentenceCaseLanguages.includes(translator.language) ? sentence.slice(1).toLocaleLowerCase() : sentence.slice(1))
|
sentence.charAt(0).toLocaleUpperCase() +
|
||||||
|
(!ignoreSentenceCaseLanguages.includes(translator.language)
|
||||||
|
? sentence.slice(1).toLocaleLowerCase()
|
||||||
|
: sentence.slice(1))
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.join('. ');
|
.join('. ');
|
||||||
|
|
Reference in a new issue