refactor: refs #6425 translation files in .yml format and minor changes

This commit is contained in:
Jon Elias 2024-04-02 14:12:01 +02:00
parent 7658573ec6
commit 33c54042df
20 changed files with 2257 additions and 2546 deletions

View File

@ -93,13 +93,11 @@ module.exports = configure(function (/* ctx */) {
[
VueI18nPlugin({
runtimeOnly: false,
include: [
path.resolve(__dirname, './src/i18n/locale/**'),
path.resolve(__dirname, './src/pages/**/locale/**'),
],
}),
{
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
// you need to set i18n resource including paths !
include: path.resolve(__dirname, './src/i18n/**'),
},
],
],
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,21 @@
const langs = import.meta.glob(`./**/*.js`);
const files = import.meta.glob(`../pages/**/Translation/en.js`);
const importLang = {};
const files = import.meta.glob(`./locale/*.yml`);
const modules = import.meta.glob(`../pages/**/locale/en.yml`);
const translations = {};
for (const fileLang in langs) {
const lang = fileLang.split('/').at(1);
import(fileLang)
for (const file in files) {
const lang = file.split('/').at(2).split('.')[0];
import(file)
.then((t) => {
importLang[lang] = t.default;
translations[lang] = t.default;
})
.finally(() => {
for (const file in files) {
const splittedFile = file.split('/');
for (const module in modules) {
const splittedFile = module.split('/');
splittedFile.pop();
const langFiles = splittedFile.join('/') + '/' + lang + '.js';
console.log('myFile: ', langFiles);
import(langFiles)
.then((t) => {
Object.assign(importLang[lang], t.default);
})
.catch((err) => {
console.log('no va: ' + err, file, importLang);
});
const moduleFiles = splittedFile.join('/') + '/' + lang + '.yml';
import(moduleFiles).then((t) => {
Object.assign(translations[lang], t.default);
});
}
});
}
@ -29,4 +23,5 @@ for (const fileLang in langs) {
export const localeEquivalence = {
en: 'en-GB',
};
export default importLang;
export default translations;

1104
src/i18n/locale/en.yml Normal file

File diff suppressed because it is too large Load Diff

1101
src/i18n/locale/es.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -174,7 +174,6 @@ en:
params:
search: Contains
fi: FI
salesPersonFk: Salesperson
provinceFk: Province
city: City
@ -186,8 +185,6 @@ es:
params:
search: Contiene
fi: NIF
name: Nombre
socialName: Razón Social
salesPersonFk: Comercial
provinceFk: Provincia
city: Ciudad
@ -196,8 +193,6 @@ es:
zoneFk: Zona
postcode: CP
FI: NIF
Salesperson: Comercial
Province: Provincia
City: Ciudad

View File

@ -1,8 +0,0 @@
export default {
customerFilter: {
filter: {
name: 'Name',
socialName: 'Social name',
},
},
};

View File

@ -1,8 +0,0 @@
export default {
customerFilter: {
filter: {
name: 'Nombre',
socialName: 'Razón Social',
},
},
};

View File

@ -0,0 +1,4 @@
customerFilter:
filter:
name: Name
socialName: Social name

View File

@ -0,0 +1,4 @@
customerFilter:
filter:
name: Nombre
socialName: Razón Social

View File

@ -1,14 +0,0 @@
export default {
entryList: {
list: {
inventoryEntry: 'Inventory entry',
virtualEntry: 'Virtual entry',
},
},
entryFilter: {
filter: {
search: 'General search',
reference: 'Reference',
},
},
};

View File

@ -1,14 +0,0 @@
export default {
entryList: {
list: {
inventoryEntry: 'Es inventario',
virtualEntry: 'Es una redada',
},
},
entryFilter: {
filter: {
search: 'Búsqueda general',
reference: 'Referencia',
},
},
};

View File

@ -0,0 +1,8 @@
entryList:
list:
inventoryEntry: 'Inventory entry'
virtualEntry: 'Virtual entry'
entryFilter:
filter:
search: 'General search'
reference: 'Reference'

View File

@ -0,0 +1,8 @@
entryList:
list:
inventoryEntry: 'Es inventario'
virtualEntry: 'Es una redada'
entryFilter:
filter:
search: 'Búsqueda general'
reference: 'Referencia'

View File

@ -1,8 +0,0 @@
export default {
travelFilter: {
filter: {
warehouseOutFk: 'Warehouse Out',
warehouseInFk: 'Warehouse In',
},
},
};

View File

@ -1,8 +0,0 @@
export default {
travelFilter: {
filter: {
warehouseInFk: 'Alm. entrada',
warehouseOutFk: 'Alm. salida',
},
},
};

View File

@ -0,0 +1,4 @@
travelFilter:
filter:
warehouseOutFk: 'Warehouse Out'
warehouseInFk: 'Warehouse In'

View File

@ -0,0 +1,4 @@
travelFilter:
filter:
warehouseInFk: 'Alm. entrada'
warehouseOutFk: 'Alm. salida'

View File

@ -19,7 +19,7 @@ export default defineConfig({
plugins: [
vue({
template: {
transformAssetUrls
transformAssetUrls,
},
}),
quasar({