mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-13 06:08:20 +00:00
134a21158e
commit3008b45a89
Author: Dessalines <happydooby@gmail.com> Date: Thu Aug 15 14:11:02 2019 -0700 Adding moment translation, and to i18next.ts file. commit620be4ecd8
Author: Autom <40275136+AutomCoding@users.noreply.github.com> Date: Thu Aug 15 19:08:57 2019 +0200 Minor tweaks Line 74: Change grammatical gender to neutrum for undefined target. Line 126: Possibly a more accurate translation. commite053040c58
Author: Autom <40275136+AutomCoding@users.noreply.github.com> Date: Thu Aug 15 18:55:32 2019 +0200 Translate remaining Swedish commitb126b59e15
Author: Autom <40275136+AutomCoding@users.noreply.github.com> Date: Thu Aug 15 18:38:20 2019 +0200 Typo (missing apostrophe in contraction) commit50a0c6b590
Author: Autom <40275136+AutomCoding@users.noreply.github.com> Date: Thu Aug 15 18:36:22 2019 +0200 Create sv.ts First half translated
40 lines
816 B
TypeScript
40 lines
816 B
TypeScript
import * as i18n from 'i18next';
|
|
import { getLanguage } from './utils';
|
|
import { en } from './translations/en';
|
|
import { de } from './translations/de';
|
|
import { zh } from './translations/zh';
|
|
import { fr } from './translations/fr';
|
|
import { sv } from './translations/sv';
|
|
|
|
// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
|
|
// TODO don't forget to add moment locales for new languages.
|
|
const resources = {
|
|
en,
|
|
de,
|
|
zh,
|
|
fr,
|
|
sv,
|
|
}
|
|
|
|
function format(value: any, format: any, lng: any) {
|
|
if (format === 'uppercase') return value.toUpperCase();
|
|
return value;
|
|
}
|
|
|
|
i18n
|
|
.init({
|
|
debug: true,
|
|
// load: 'languageOnly',
|
|
|
|
// initImmediate: false,
|
|
lng: getLanguage(),
|
|
fallbackLng: 'en',
|
|
resources,
|
|
interpolation: {
|
|
format: format
|
|
|
|
}
|
|
});
|
|
|
|
export { i18n, resources };
|