Mòdul:Multilang module tools: diferència entre les revisions

Contingut suprimit Contingut afegit
mCap resum de modificació
Cap resum de modificació
Línia 11:
Lang = 'lang',
}
function p.DemoItemLang ()
return {p.arg.Demo, p.arg.Item, p.arg.Lang}
end
Línia 20:
 
p.lang = nil -- Used for demos for other languages.
p.LangsDifDirect = false
p.direc_str = 'ltr'
p.compare_lang = 'en'
p.local LangsDifDirect = false
local WDirect = 'ltr'
 
function p.LangsDifWriteDirect ()
return LangsDifDirect
end
 
function p.WriteDirect ()
return WDirect
end
 
function p.IsRTL (lang)
Linha 55 ⟶ 63:
end --IsRTLf
 
function p.IniLang (args)
p.lang = SA.Str_Par (args, p.arg.Lang)
local CurrLang = mw.language.getContentLanguage().code
Linha 65 ⟶ 73:
local ContentLangIsRTL = p.IsRTL (CurrLang)
if LangIsRTL then
p.direc_strWDirect = 'rtl'
end
p.LangsDifDirect = LangIsRTL ~= ContentLangIsRTL
end
end --IniLang
Linha 85 ⟶ 93:
if tab_main[k] == nil then
error ('Not found '..k..' in main table') --for debug, don't translate
elseif tab_main[k] == "" then
error ('Empty value for '..k..' in main table') --for debug, don't translate
end
end --check_tab_main
Linha 159 ⟶ 165:
return mod_abbrev, key, wd_main, wd_lang, lnk
end --GetLabelX
 
----------------------------------------
 
function p.GetArgType (key, tab_int, tab_num, tab_date, tab_bool)