Client - init Spanish (es) and Galician (gl) translation files
This commit is contained in:
parent
01d56041d3
commit
0a8efdb30c
@ -17,6 +17,7 @@
|
||||
"@zxcvbn-ts/language-common": "^2.0.1",
|
||||
"@zxcvbn-ts/language-de": "^2.1.0",
|
||||
"@zxcvbn-ts/language-en": "^2.1.0",
|
||||
"@zxcvbn-ts/language-es-es": "^2.1.1",
|
||||
"@zxcvbn-ts/language-fr": "^2.2.0",
|
||||
"@zxcvbn-ts/language-it": "^2.1.0",
|
||||
"axios": "^1.3.4",
|
||||
|
@ -6,7 +6,7 @@ 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`.
|
||||
* See: https://github.com/intlify/vue-i18n-loader#rocket-i18n-resource-pre-compilation
|
||||
*/
|
||||
const disabledLanguages = ['nb'] // to update after translations release
|
||||
const disabledLanguages = ['nb', 'es', 'gl'] // to update after translations release
|
||||
|
||||
function loadLocaleMessages(): Record<string, LocaleMessages<VueMessageType>> {
|
||||
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.ts$/i)
|
||||
|
2
fittrackee_client/src/locales/es/about.json
Normal file
2
fittrackee_client/src/locales/es/about.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/administration.json
Normal file
2
fittrackee_client/src/locales/es/administration.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/api.json
Normal file
2
fittrackee_client/src/locales/es/api.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/buttons.json
Normal file
2
fittrackee_client/src/locales/es/buttons.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/common.json
Normal file
2
fittrackee_client/src/locales/es/common.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/dashboard.json
Normal file
2
fittrackee_client/src/locales/es/dashboard.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/error.json
Normal file
2
fittrackee_client/src/locales/es/error.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
29
fittrackee_client/src/locales/es/es.ts
Normal file
29
fittrackee_client/src/locales/es/es.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,
|
||||
}
|
2
fittrackee_client/src/locales/es/oauth2.json
Normal file
2
fittrackee_client/src/locales/es/oauth2.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
1
fittrackee_client/src/locales/es/privacy_policy.json
Normal file
1
fittrackee_client/src/locales/es/privacy_policy.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
2
fittrackee_client/src/locales/es/sports.json
Normal file
2
fittrackee_client/src/locales/es/sports.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/statistics.json
Normal file
2
fittrackee_client/src/locales/es/statistics.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/user.json
Normal file
2
fittrackee_client/src/locales/es/user.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/es/workouts.json
Normal file
2
fittrackee_client/src/locales/es/workouts.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/about.json
Normal file
2
fittrackee_client/src/locales/gl/about.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/administration.json
Normal file
2
fittrackee_client/src/locales/gl/administration.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/api.json
Normal file
2
fittrackee_client/src/locales/gl/api.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/buttons.json
Normal file
2
fittrackee_client/src/locales/gl/buttons.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/common.json
Normal file
2
fittrackee_client/src/locales/gl/common.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/dashboard.json
Normal file
2
fittrackee_client/src/locales/gl/dashboard.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/error.json
Normal file
2
fittrackee_client/src/locales/gl/error.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
29
fittrackee_client/src/locales/gl/gl.ts
Normal file
29
fittrackee_client/src/locales/gl/gl.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,
|
||||
}
|
2
fittrackee_client/src/locales/gl/oauth2.json
Normal file
2
fittrackee_client/src/locales/gl/oauth2.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
1
fittrackee_client/src/locales/gl/privacy_policy.json
Normal file
1
fittrackee_client/src/locales/gl/privacy_policy.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
2
fittrackee_client/src/locales/gl/sports.json
Normal file
2
fittrackee_client/src/locales/gl/sports.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/statistics.json
Normal file
2
fittrackee_client/src/locales/gl/statistics.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/user.json
Normal file
2
fittrackee_client/src/locales/gl/user.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
2
fittrackee_client/src/locales/gl/workouts.json
Normal file
2
fittrackee_client/src/locales/gl/workouts.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
@ -96,7 +96,9 @@ const availableDateFormats = [
|
||||
export const dateStringFormats: Record<string, string> = {
|
||||
de: 'do MMM yyyy',
|
||||
en: 'MMM. do, yyyy',
|
||||
// es: 'd MMM yyyy',
|
||||
fr: 'd MMM yyyy',
|
||||
// gl: 'd MMM yyyy',
|
||||
it: 'd MMM yyyy',
|
||||
// nb: 'do MMM yyyy',
|
||||
nl: 'd MMM yyyy',
|
||||
|
@ -7,7 +7,9 @@ import createI18n from '@/i18n'
|
||||
export const localeFromLanguage: Record<string, Locale> = {
|
||||
de: de,
|
||||
en: enUS,
|
||||
// es: es, // disabled for now
|
||||
fr: fr,
|
||||
// gl: gl, // disabled for now
|
||||
it: it,
|
||||
// nb: nb, // disabled for now
|
||||
nl: nl,
|
||||
@ -16,7 +18,9 @@ export const localeFromLanguage: Record<string, Locale> = {
|
||||
export const languageLabels: Record<string, string> = {
|
||||
de: 'Deutsch',
|
||||
en: 'English',
|
||||
// es: 'Español', // disabled for now
|
||||
fr: 'Français',
|
||||
// gl: 'Galego', // disabled for now
|
||||
it: 'Italiano',
|
||||
// nb: 'Norsk bokmål', // disabled for now
|
||||
nl: 'Nederlands',
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { zxcvbnOptions } from '@zxcvbn-ts/core'
|
||||
|
||||
export const loadLanguagePackage = async (language: string) => {
|
||||
// no package available for norwegian bokmal and dutch (Nederlands)
|
||||
// no package available for
|
||||
// - dutch (Nederlands)
|
||||
// - galician
|
||||
// - norwegian bokmal
|
||||
// fallback to english
|
||||
switch (language) {
|
||||
case 'fr':
|
||||
@ -16,6 +19,10 @@ export const loadLanguagePackage = async (language: string) => {
|
||||
return await import(
|
||||
/* webpackChunkName: "password.it" */ '@zxcvbn-ts/language-it'
|
||||
)
|
||||
// case 'es':
|
||||
// return await import(
|
||||
// /* webpackChunkName: "password.es" */ '@zxcvbn-ts/language-es-es'
|
||||
// )
|
||||
default:
|
||||
return await import(
|
||||
/* webpackChunkName: "password.en" */ '@zxcvbn-ts/language-en'
|
||||
|
@ -2271,6 +2271,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@zxcvbn-ts/language-en/-/language-en-2.1.0.tgz#52c797914380546b191e5b915e0e9843116eae18"
|
||||
integrity sha512-I3n4AAbArjPAZtwCrk9MQnSrcj5+9rq8sic2rUU44fP5QaR17Vk8zDt61+R9dnP9ZRsj09aAUYML4Ash05qZjQ==
|
||||
|
||||
"@zxcvbn-ts/language-es-es@^2.1.1":
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@zxcvbn-ts/language-es-es/-/language-es-es-2.1.1.tgz#960b28bf58e537547293d555a36b1c42ef1ce66b"
|
||||
integrity sha512-uDXU/z1df6YGmacFVcFhsvQ2Uu/EbMFCjLeNoM/95vH3GCTb/10eI5IlzjgSP4EG305vd9oNpBy6MODu+9SvNg==
|
||||
|
||||
"@zxcvbn-ts/language-fr@^2.2.0":
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@zxcvbn-ts/language-fr/-/language-fr-2.2.0.tgz#0b7dd93ebba0044fbe733836bc7091b76d42afe1"
|
||||
|
Loading…
Reference in New Issue
Block a user