refactor: refs #6425 translation files in .yml format and minor changes
This commit is contained in:
parent
7658573ec6
commit
33c54042df
|
@ -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/**'),
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
|
|
1227
src/i18n/en/index.js
1227
src/i18n/en/index.js
File diff suppressed because it is too large
Load Diff
1227
src/i18n/es/index.js
1227
src/i18n/es/index.js
File diff suppressed because it is too large
Load Diff
|
@ -1,26 +1,20 @@
|
|||
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;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
export default {
|
||||
customerFilter: {
|
||||
filter: {
|
||||
name: 'Name',
|
||||
socialName: 'Social name',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -1,8 +0,0 @@
|
|||
export default {
|
||||
customerFilter: {
|
||||
filter: {
|
||||
name: 'Nombre',
|
||||
socialName: 'Razón Social',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
customerFilter:
|
||||
filter:
|
||||
name: Name
|
||||
socialName: Social name
|
|
@ -0,0 +1,4 @@
|
|||
customerFilter:
|
||||
filter:
|
||||
name: Nombre
|
||||
socialName: Razón Social
|
|
@ -1,14 +0,0 @@
|
|||
export default {
|
||||
entryList: {
|
||||
list: {
|
||||
inventoryEntry: 'Inventory entry',
|
||||
virtualEntry: 'Virtual entry',
|
||||
},
|
||||
},
|
||||
entryFilter: {
|
||||
filter: {
|
||||
search: 'General search',
|
||||
reference: 'Reference',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
export default {
|
||||
entryList: {
|
||||
list: {
|
||||
inventoryEntry: 'Es inventario',
|
||||
virtualEntry: 'Es una redada',
|
||||
},
|
||||
},
|
||||
entryFilter: {
|
||||
filter: {
|
||||
search: 'Búsqueda general',
|
||||
reference: 'Referencia',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
entryList:
|
||||
list:
|
||||
inventoryEntry: 'Inventory entry'
|
||||
virtualEntry: 'Virtual entry'
|
||||
entryFilter:
|
||||
filter:
|
||||
search: 'General search'
|
||||
reference: 'Reference'
|
|
@ -0,0 +1,8 @@
|
|||
entryList:
|
||||
list:
|
||||
inventoryEntry: 'Es inventario'
|
||||
virtualEntry: 'Es una redada'
|
||||
entryFilter:
|
||||
filter:
|
||||
search: 'Búsqueda general'
|
||||
reference: 'Referencia'
|
|
@ -1,8 +0,0 @@
|
|||
export default {
|
||||
travelFilter: {
|
||||
filter: {
|
||||
warehouseOutFk: 'Warehouse Out',
|
||||
warehouseInFk: 'Warehouse In',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -1,8 +0,0 @@
|
|||
export default {
|
||||
travelFilter: {
|
||||
filter: {
|
||||
warehouseInFk: 'Alm. entrada',
|
||||
warehouseOutFk: 'Alm. salida',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
travelFilter:
|
||||
filter:
|
||||
warehouseOutFk: 'Warehouse Out'
|
||||
warehouseInFk: 'Warehouse In'
|
|
@ -0,0 +1,4 @@
|
|||
travelFilter:
|
||||
filter:
|
||||
warehouseInFk: 'Alm. entrada'
|
||||
warehouseOutFk: 'Alm. salida'
|
|
@ -19,7 +19,7 @@ export default defineConfig({
|
|||
plugins: [
|
||||
vue({
|
||||
template: {
|
||||
transformAssetUrls
|
||||
transformAssetUrls,
|
||||
},
|
||||
}),
|
||||
quasar({
|
||||
|
|
Loading…
Reference in New Issue