From: Dessalines Date: Sun, 7 Jun 2020 11:51:36 +0000 (-0400) Subject: Adding galician, turkish, hungarian, and ukrainian languages. X-Git-Url: http://these/git/%7Bsrc%7D?a=commitdiff_plain;h=a13e9fe3959e07f901ba0647dfd7f749865a900d;p=lemmy.git Adding galician, turkish, hungarian, and ukrainian languages. --- diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index cba9e3c2..5fa8f4e8 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -20,6 +20,10 @@ import { pl } from './translations/pl'; import { pt_BR } from './translations/pt_BR'; import { ja } from './translations/ja'; import { ka } from './translations/ka'; +import { gl } from './translations/gl'; +import { tr } from './translations/tr'; +import { hu } from './translations/hu'; +import { uk } from './translations/uk'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -43,6 +47,10 @@ const resources = { pl, pt_BR, ja, + gl, + tr, + hu, + uk, }; function format(value: any, format: any, lng: any): any { diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 66a21319..3bad5040 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -17,6 +17,10 @@ import 'moment/locale/pt-br'; import 'moment/locale/ja'; import 'moment/locale/ka'; import 'moment/locale/hi'; +import 'moment/locale/gl'; +import 'moment/locale/tr'; +import 'moment/locale/hu'; +import 'moment/locale/uk'; import { UserOperation, @@ -67,6 +71,8 @@ export const languages = [ { code: 'eo', name: 'Esperanto' }, { code: 'es', name: 'Español' }, { code: 'de', name: 'Deutsch' }, + { code: 'gl', name: 'Galego' }, + { code: 'hu', name: 'Magyar Nyelv' }, { code: 'ka', name: 'ქართული ენა' }, { code: 'hi', name: 'मानक हिन्दी' }, { code: 'fa', name: 'فارسی' }, @@ -77,6 +83,8 @@ export const languages = [ { code: 'fi', name: 'Suomi' }, { code: 'fr', name: 'Français' }, { code: 'sv', name: 'Svenska' }, + { code: 'tr', name: 'Türkçe' }, + { code: 'uk', name: 'українська мова' }, { code: 'ru', name: 'Русский' }, { code: 'nl', name: 'Nederlands' }, { code: 'it', name: 'Italiano' }, @@ -382,6 +390,14 @@ export function getMomentLanguage(): string { lang = 'el'; } else if (lang.startsWith('eu')) { lang = 'eu'; + } else if (lang.startsWith('gl')) { + lang = 'gl'; + } else if (lang.startsWith('tr')) { + lang = 'tr'; + } else if (lang.startsWith('hu')) { + lang = 'hu'; + } else if (lang.startsWith('uk')) { + lang = 'uk'; } else { lang = 'en'; } diff --git a/ui/translations/gl.json b/ui/translations/gl.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/gl.json @@ -0,0 +1 @@ +{} diff --git a/ui/translations/hu.json b/ui/translations/hu.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/hu.json @@ -0,0 +1 @@ +{} diff --git a/ui/translations/tr.json b/ui/translations/tr.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/tr.json @@ -0,0 +1 @@ +{} diff --git a/ui/translations/uk.json b/ui/translations/uk.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/ui/translations/uk.json @@ -0,0 +1 @@ +{}