sii
This commit is contained in:
parent
cff4b94c5a
commit
0a0fd71974
@ -32,13 +32,16 @@ function createCommonPath(router, path, renderParams = {
|
||||
}
|
||||
renderOptions.lang = default_lang
|
||||
renderOptions.langPath = ""
|
||||
renderOptions = {
|
||||
...renderOptions,
|
||||
...getTlPartials(default_lang, path)
|
||||
}
|
||||
createPath('/' + path, cb, renderOptions, router)
|
||||
for(let l in langs){
|
||||
if(langs[l] == default_lang){
|
||||
// getTlPartials()
|
||||
continue
|
||||
}
|
||||
const otherLangRender = {...renderOptions}
|
||||
const otherLangRender = {...renderOptions, ...getTlPartials(langs[l], path)}
|
||||
otherLangRender.lang = langs[l]
|
||||
otherLangRender.langPath = '/' + langs[l]
|
||||
createPath(otherLangRender.langPath + '/' + path, cb, otherLangRender, router)
|
||||
@ -53,15 +56,19 @@ function createPath(path, cb, renderOptions, router){
|
||||
})
|
||||
}
|
||||
|
||||
// function getTlPartials(){
|
||||
// try{
|
||||
// console.log(langs[l])
|
||||
// const filenames = fs.readdirSync(appDir + '/views/partials/translations/' + default_lang + '/' + path)
|
||||
// const partialName = f.split('hbs')[0]
|
||||
// // tlElements =
|
||||
// }catch(e){
|
||||
// // console.log(e)
|
||||
// }
|
||||
// }
|
||||
function getTlPartials(lang, path){
|
||||
try{
|
||||
const partialsDic = {}
|
||||
const tlPath = "translations/" + lang + '/' + path
|
||||
const filenames = fs.readdirSync(appDir + '/views/partials' + '/' + tlPath)
|
||||
filenames.forEach(f => {
|
||||
const viewName = f.split('.hbs')[0]
|
||||
partialsDic["tl_" + viewName] = tlPath + '/' + viewName
|
||||
})
|
||||
return partialsDic
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = createCommonPath
|
||||
|
@ -2,7 +2,7 @@
|
||||
<center id="top" height="4" class="main_div">
|
||||
<br>
|
||||
<br>
|
||||
<marquee>{{> translations/es/home/red}}</marquee>
|
||||
<marquee>{{> (lookup . 'tl_red')}}</marquee>
|
||||
<table class="tabidachi_table" cellspacing="20" cellmargin="60" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
1
views/partials/translations/en/home/red.hbs
Normal file
1
views/partials/translations/en/home/red.hbs
Normal file
@ -0,0 +1 @@
|
||||
This network might stop working through https every 30 minutes. Use <a href="http://lyricaltokarev.com/en/home">http</a> instead.
|
@ -1 +1 @@
|
||||
Puede que esta red deje de andar por https cada 30 minutos. En su lugar, usa <a href="http://lyricaltokarev.com/home">http</a>
|
||||
Puede que esta red deje de andar por https cada 30 minutos. En su lugar, usa <a href="http://lyricaltokarev.com/home">http</a>.
|
Loading…
Reference in New Issue
Block a user