diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 000000000000..4fc75068ba60 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,6 @@ +preserve_hierarchy: false +files: + - source: /frontend/src/locales/messages/en-US.json + translation: /frontend/src/locales/messages/%locale%.json + - source: /frontend/src/locales/dateTimeFormats/en-US.json + translation: /frontend/src/locales/dateTimeFormats/%locale%.json diff --git a/frontend/src/i18n.js b/frontend/src/i18n.js index f5320dcc215b..e63f45a8c54a 100644 --- a/frontend/src/i18n.js +++ b/frontend/src/i18n.js @@ -36,8 +36,8 @@ function loadDateTimeFormats() { export default new VueI18n({ - locale: "en", - fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || "en", + locale: "en-US", + fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || "en-US", messages: loadLocaleMessages(), dateTimeFormats: loadDateTimeFormats() }); diff --git a/frontend/src/locales/dateTimeFormats/da.json b/frontend/src/locales/dateTimeFormats/da-DK.json similarity index 100% rename from frontend/src/locales/dateTimeFormats/da.json rename to frontend/src/locales/dateTimeFormats/da-DK.json diff --git a/frontend/src/locales/dateTimeFormats/de.json b/frontend/src/locales/dateTimeFormats/de-DE.json similarity index 100% rename from frontend/src/locales/dateTimeFormats/de.json rename to frontend/src/locales/dateTimeFormats/de-DE.json diff --git a/frontend/src/locales/dateTimeFormats/en.json b/frontend/src/locales/dateTimeFormats/en-US.json similarity index 100% rename from frontend/src/locales/dateTimeFormats/en.json rename to frontend/src/locales/dateTimeFormats/en-US.json diff --git a/frontend/src/locales/dateTimeFormats/fr.json b/frontend/src/locales/dateTimeFormats/fr-FR.json similarity index 100% rename from frontend/src/locales/dateTimeFormats/fr.json rename to frontend/src/locales/dateTimeFormats/fr-FR.json diff --git a/frontend/src/locales/dateTimeFormats/pl.json b/frontend/src/locales/dateTimeFormats/pl-PL.json similarity index 100% rename from frontend/src/locales/dateTimeFormats/pl.json rename to frontend/src/locales/dateTimeFormats/pl-PL.json diff --git a/frontend/src/locales/dateTimeFormats/pt-PT.json b/frontend/src/locales/dateTimeFormats/pt-PT.json new file mode 100644 index 000000000000..2181d13f1ba0 --- /dev/null +++ b/frontend/src/locales/dateTimeFormats/pt-PT.json @@ -0,0 +1,7 @@ +{ + "short": { + "month": "short", + "day": "numeric", + "weekday": "long" + } +} \ No newline at end of file diff --git a/frontend/src/locales/dateTimeFormats/sv.json b/frontend/src/locales/dateTimeFormats/sv-SE.json similarity index 100% rename from frontend/src/locales/dateTimeFormats/sv.json rename to frontend/src/locales/dateTimeFormats/sv-SE.json diff --git a/frontend/src/locales/messages/da.json b/frontend/src/locales/messages/da-DK.json similarity index 100% rename from frontend/src/locales/messages/da.json rename to frontend/src/locales/messages/da-DK.json diff --git a/frontend/src/locales/messages/de.json b/frontend/src/locales/messages/de-DE.json similarity index 100% rename from frontend/src/locales/messages/de.json rename to frontend/src/locales/messages/de-DE.json diff --git a/frontend/src/locales/messages/en.json b/frontend/src/locales/messages/en-US.json similarity index 100% rename from frontend/src/locales/messages/en.json rename to frontend/src/locales/messages/en-US.json diff --git a/frontend/src/locales/messages/fr.json b/frontend/src/locales/messages/fr-FR.json similarity index 100% rename from frontend/src/locales/messages/fr.json rename to frontend/src/locales/messages/fr-FR.json diff --git a/frontend/src/locales/messages/pl.json b/frontend/src/locales/messages/pl-PL.json similarity index 100% rename from frontend/src/locales/messages/pl.json rename to frontend/src/locales/messages/pl-PL.json diff --git a/frontend/src/locales/pt-PT.json b/frontend/src/locales/messages/pt-PT.json similarity index 100% rename from frontend/src/locales/pt-PT.json rename to frontend/src/locales/messages/pt-PT.json diff --git a/frontend/src/locales/messages/sv.json b/frontend/src/locales/messages/sv-SE.json similarity index 100% rename from frontend/src/locales/messages/sv.json rename to frontend/src/locales/messages/sv-SE.json diff --git a/frontend/src/plugins/vuetify.js b/frontend/src/plugins/vuetify.js index 1e8c87b6bc88..522f30fd3d82 100644 --- a/frontend/src/plugins/vuetify.js +++ b/frontend/src/plugins/vuetify.js @@ -3,11 +3,16 @@ import Vuetify from "vuetify/lib"; Vue.use(Vuetify); +// language IDs should match those from VueI18n with _ instead of - +import de_DE from 'vuetify/es5/locale/de'; +import en_US from 'vuetify/es5/locale/en'; +import fr_FR from 'vuetify/es5/locale/fr'; +import pl_PL from 'vuetify/es5/locale/pl'; +import pt_PT from 'vuetify/es5/locale/pt'; +import sv_SE from 'vuetify/es5/locale/sv'; +import zh_CN from 'vuetify/es5/locale/zh-Hans'; +import zh_TW from 'vuetify/es5/locale/zh-Hant'; -import fr from 'vuetify/es5/locale/fr'; -import pl from 'vuetify/es5/locale/pl'; -import sv from 'vuetify/es5/locale/sv'; -import de from 'vuetify/es5/locale/de'; const vuetify = new Vuetify({ theme: { @@ -37,9 +42,16 @@ const vuetify = new Vuetify({ }, lang: { locales: { - fr, pl, sv, de + de_DE, + en_US, + fr_FR, + pl_PL, + pt_PT, + sv_SE, + zh_CN, + zh_TW }, - current: 'en', + current: 'en_US', }, }); diff --git a/frontend/src/store/modules/language.js b/frontend/src/store/modules/language.js index 7eed2de85680..963cfb1aea3f 100644 --- a/frontend/src/store/modules/language.js +++ b/frontend/src/store/modules/language.js @@ -5,23 +5,23 @@ const state = { allLangs: [ { name: "English", - value: "en", + value: "en-US", }, { name: "Danish", - value: "da", + value: "da-DK", }, { name: "French", - value: "fr", + value: "fr-FR", }, { name: "Polish", - value: "pl", + value: "pl-PL", }, { name: "Swedish", - value: "sv", + value: "sv-SE", }, { name: "简体中文", @@ -33,7 +33,7 @@ const state = { }, { name: "German", - value: "de", + value: "de-DE", }, { name: "Português", @@ -52,7 +52,7 @@ const mutations = { const actions = { initLang({ getters }, { currentVueComponent }) { VueI18n.locale = getters.getActiveLang; - currentVueComponent.$vuetify.lang.current = getters.getActiveLang; + currentVueComponent.$vuetify.lang.current = getters.getActiveLang.replace('-', '_'); }, };