Client - init Polish (pl) translation files
This commit is contained in:
parent
d37f207cc8
commit
67d434aa6e
@ -6,13 +6,18 @@ import { createI18n, LocaleMessages, VueMessageType } from 'vue-i18n'
|
|||||||
* The loaded `JSON` locale messages is pre-compiled by `@intlify/vue-i18n-loader`, which is integrated into `vue-cli-plugin-i18n`.
|
* The loaded `JSON` locale messages is pre-compiled by `@intlify/vue-i18n-loader`, which is integrated into `vue-cli-plugin-i18n`.
|
||||||
* See: https://github.com/intlify/vue-i18n-loader#rocket-i18n-resource-pre-compilation
|
* See: https://github.com/intlify/vue-i18n-loader#rocket-i18n-resource-pre-compilation
|
||||||
*/
|
*/
|
||||||
|
const disabledLanguages = ['pl'] // to update after translations release
|
||||||
|
|
||||||
function loadLocaleMessages(): Record<string, LocaleMessages<VueMessageType>> {
|
function loadLocaleMessages(): Record<string, LocaleMessages<VueMessageType>> {
|
||||||
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.ts$/i)
|
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.ts$/i)
|
||||||
const messages: Record<string, LocaleMessages<VueMessageType>> = {}
|
const messages: Record<string, LocaleMessages<VueMessageType>> = {}
|
||||||
locales.keys().forEach((key) => {
|
locales.keys().forEach((key) => {
|
||||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
||||||
if (matched && matched.length > 1) {
|
if (
|
||||||
|
matched &&
|
||||||
|
matched.length > 1 &&
|
||||||
|
!disabledLanguages.includes(matched[1])
|
||||||
|
) {
|
||||||
const locale = matched[1]
|
const locale = matched[1]
|
||||||
messages[locale] = locales(key).default
|
messages[locale] = locales(key).default
|
||||||
}
|
}
|
||||||
|
1
fittrackee_client/src/locales/pl/about.json
Normal file
1
fittrackee_client/src/locales/pl/about.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/administration.json
Normal file
1
fittrackee_client/src/locales/pl/administration.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/api.json
Normal file
1
fittrackee_client/src/locales/pl/api.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/buttons.json
Normal file
1
fittrackee_client/src/locales/pl/buttons.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/common.json
Normal file
1
fittrackee_client/src/locales/pl/common.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/dashboard.json
Normal file
1
fittrackee_client/src/locales/pl/dashboard.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/error.json
Normal file
1
fittrackee_client/src/locales/pl/error.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/oauth2.json
Normal file
1
fittrackee_client/src/locales/pl/oauth2.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
29
fittrackee_client/src/locales/pl/pl.ts
Normal file
29
fittrackee_client/src/locales/pl/pl.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import AboutTranslations from './about.json'
|
||||||
|
import AdministrationTranslations from './administration.json'
|
||||||
|
import ApiTranslations from './api.json'
|
||||||
|
import ButtonsTranslations from './buttons.json'
|
||||||
|
import CommonTranslations from './common.json'
|
||||||
|
import DashboardTranslations from './dashboard.json'
|
||||||
|
import ErrorTranslations from './error.json'
|
||||||
|
import OAuth2Translations from './oauth2.json'
|
||||||
|
import PrivacyPolicyTranslations from './privacy_policy.json'
|
||||||
|
import SportsTranslations from './sports.json'
|
||||||
|
import StatisticsTranslations from './statistics.json'
|
||||||
|
import UserTranslations from './user.json'
|
||||||
|
import WorkoutsTranslations from './workouts.json'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
about: AboutTranslations,
|
||||||
|
admin: AdministrationTranslations,
|
||||||
|
api: ApiTranslations,
|
||||||
|
buttons: ButtonsTranslations,
|
||||||
|
common: CommonTranslations,
|
||||||
|
dashboard: DashboardTranslations,
|
||||||
|
error: ErrorTranslations,
|
||||||
|
oauth2: OAuth2Translations,
|
||||||
|
privacy_policy: PrivacyPolicyTranslations,
|
||||||
|
sports: SportsTranslations,
|
||||||
|
statistics: StatisticsTranslations,
|
||||||
|
user: UserTranslations,
|
||||||
|
workouts: WorkoutsTranslations,
|
||||||
|
}
|
1
fittrackee_client/src/locales/pl/privacy_policy.json
Normal file
1
fittrackee_client/src/locales/pl/privacy_policy.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/sports.json
Normal file
1
fittrackee_client/src/locales/pl/sports.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/statistics.json
Normal file
1
fittrackee_client/src/locales/pl/statistics.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/user.json
Normal file
1
fittrackee_client/src/locales/pl/user.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
1
fittrackee_client/src/locales/pl/workouts.json
Normal file
1
fittrackee_client/src/locales/pl/workouts.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ }
|
@ -100,6 +100,7 @@ export const dateStringFormats: Record<string, string> = {
|
|||||||
fr: 'd MMM yyyy',
|
fr: 'd MMM yyyy',
|
||||||
gl: 'd MMM yyyy',
|
gl: 'd MMM yyyy',
|
||||||
it: 'd MMM yyyy',
|
it: 'd MMM yyyy',
|
||||||
|
// pl: 'd MMM yyyy', // disabled for now
|
||||||
nb: 'do MMM yyyy',
|
nb: 'do MMM yyyy',
|
||||||
nl: 'd MMM yyyy',
|
nl: 'd MMM yyyy',
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ export const localeFromLanguage: Record<string, Locale> = {
|
|||||||
fr: fr,
|
fr: fr,
|
||||||
gl: gl,
|
gl: gl,
|
||||||
it: it,
|
it: it,
|
||||||
|
// pl: pl,
|
||||||
nb: nb,
|
nb: nb,
|
||||||
nl: nl,
|
nl: nl,
|
||||||
}
|
}
|
||||||
@ -22,6 +23,7 @@ export const languageLabels: Record<string, string> = {
|
|||||||
fr: 'Français',
|
fr: 'Français',
|
||||||
gl: 'Galego',
|
gl: 'Galego',
|
||||||
it: 'Italiano',
|
it: 'Italiano',
|
||||||
|
// pl: 'Polski',
|
||||||
nb: 'Norsk bokmål',
|
nb: 'Norsk bokmål',
|
||||||
nl: 'Nederlands',
|
nl: 'Nederlands',
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,11 @@ export const loadLanguagePackage = async (language: string) => {
|
|||||||
return await import(
|
return await import(
|
||||||
/* webpackChunkName: "password.es" */ '@zxcvbn-ts/language-es-es'
|
/* webpackChunkName: "password.es" */ '@zxcvbn-ts/language-es-es'
|
||||||
)
|
)
|
||||||
|
// TODO: add package
|
||||||
|
// case 'pl':
|
||||||
|
// return await import(
|
||||||
|
// /* webpackChunkName: "password.pl" */ '@zxcvbn-ts/language-pl'
|
||||||
|
// )
|
||||||
default:
|
default:
|
||||||
return await import(
|
return await import(
|
||||||
/* webpackChunkName: "password.en" */ '@zxcvbn-ts/language-en'
|
/* webpackChunkName: "password.en" */ '@zxcvbn-ts/language-en'
|
||||||
|
Loading…
Reference in New Issue
Block a user