add WIP basic translations
parent
9a357e005b
commit
ba847cf45e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
Subproject commit 20f632085c08e874ac84a59132cb87117820dae6
|
||||
Subproject commit 5226e1d625fafcc62ca828e2817ccd80ea802735
|
@ -0,0 +1,23 @@
|
||||
import type { I18n } from "@lingui/core";
|
||||
import { en, de } from "make-plural/plurals";
|
||||
|
||||
//anounce which locales we are going to use and connect them to approprite plural rules
|
||||
export function initTranslation(i18n: I18n) {
|
||||
i18n.loadLocaleData({
|
||||
en: { plurals: en },
|
||||
de: { plurals: de },
|
||||
pseudo: { plurals: en },
|
||||
});
|
||||
}
|
||||
|
||||
export async function loadTranslation(locale: string, isProduction = true) {
|
||||
if (isProduction) {
|
||||
return (await import(`../translations/locales/${locale}/messages`)).messages;
|
||||
} else {
|
||||
return (
|
||||
await import(
|
||||
`@lingui/loader!../translations/locales/${locale}/messages.po`
|
||||
)
|
||||
).messages;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'de'],
|
||||
},
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"subtitle": "this is german"
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"header": "An Arch based distribution",
|
||||
"subtitle": "Crystal Linux is a brand new Arch Linux based distribution. Friendly, powerful and easy to use.",
|
||||
|
||||
"generics": {
|
||||
"download": "Download",
|
||||
"getting_started": "Getting Started"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue