Merge branch 'master' into tonitch/front/serviceInscription
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m57s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s

This commit is contained in:
2024-03-06 23:11:55 +01:00
19 changed files with 507 additions and 14 deletions

View File

@ -24,7 +24,7 @@ let langs;
*
* @return :string The translated text
*/
function i18n(key, options) {
export default function i18n(key, options) {
let ret = langs[key];
if(options != null){
for (let key in options) {
@ -34,14 +34,6 @@ function i18n(key, options) {
return ret;
}
async function reloadLang(){
langs = await loadLangs();
}
reloadLang();
export default i18n;
//
// Those functions are utility functions use by previous exported functions.
//
@ -51,11 +43,11 @@ export default i18n;
* @param select the language to load. could be null to fetch the cookies for an answer
* if nothing is found. default to EN.txt
*/
async function loadLangs(lang){
export async function loadLangs(lang){
lang = lang != null ? lang : getCookie("lang");
lang = lang != "" ? lang : default_lang;
const filename = "./i18n/" + lang.toUpperCase() + ".txt";
const filename = "/i18n/" + lang.toUpperCase() + ".txt";
const content = await (await fetch(filename)).text();
const lines = content.split("\n");
@ -66,5 +58,6 @@ async function loadLangs(lang){
filteredLines[line.substr(0, split)] = line.substr(split+1, line.length);
};
}
return filteredLines;
langs = filteredLines;
}
await loadLangs();

View File

@ -8,6 +8,15 @@ export default defineConfig({
plugins: [
vue(),
],
build: {
rollupOptions:{
input:{
main: './index.html',
login: './login/index.html'
}
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))