Content deleted Content added
sync from sandbox; |
sync from sandbox; |
||
Line 23:
local synonym_table = mw.loadData ('Module:Lang/ISO 639 synonyms'); -- ISO 639-2/639-2T code translation to 639-1 code
--local cfg = mw.loadData ('Module:Lang/Configuration' .. (mw.getCurrentFrame():getTitle():match ('/sandbox') or '')); -- for internationalization
local good, cfg = pcall (mw.loadData, 'Module:Lang/configuration' .. (mw.getCurrentFrame():getTitle():match ('/sandbox') or '')); -- for internationalization
if not good then
cfg = mw.loadData ('Module:Lang/Configuration' .. (mw.getCurrentFrame():getTitle():match ('/sandbox') or '')); -- for internationalization
end
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
Line 724 ⟶ 728:
title_text = substitute ('$1-$2', {title_text, cfg.misc_text_t.language}); -- skip this text (individual and macro languages only)
end
title_text = substitute ('$1 $2', {title_text,
elseif is_set (std) and is_set (tscript) then -- when both are specified
Line 1,330 ⟶ 1,334:
end
args.engvar =
if args[xlate_idx] and (args.translation or args.lit) then
Line 1,453 ⟶ 1,457:
if translit_title_obj.exists and (cfg.keywords_t.negative ~= args.link) then
table.insert (out, make_wikilink (substitute ('$1 $2', {cfg.lang_xx_t.romanization, translit_script_name or language_name}),
substitute ('$1', {
else
table.insert (out, substitute ('$1:', {
end
Line 1,821 ⟶ 1,825:
if not title_table[args.translit_std] then
return make_error_msg (substitute (cfg.transl_t.unrecog_xlit_std, {args.translit_std}), args, template);
end
Line 1,833 ⟶ 1,836:
else
args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message
return make_error_msg (cfg.transl_t.missing_lang_scr, args, template);
end
Line 1,843 ⟶ 1,845:
args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters) or private-use; lower case because table indexes are lower case
else
return make_error_msg (substitute (cfg.transl_t.unrecog_lang_scr, {args[1]}), args, template); -- invalid language / script code
end
else
return make_error_msg (cfg.transl_t.missing_lang_scr, args, template); -- missing language / script code so quit
end
Line 1,853:
local latn, pos = is_latin (args.text, nil, true);
if not latn then -- text is not latn
return make_error_msg (substitute (cfg.lang_xx_t.translit_nonlatn, {pos}), args, template);
end
Line 1,860 ⟶ 1,859:
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
Line 1,868 ⟶ 1,866:
end
args.engvar =
if override_table[args.code] then -- is code a language code defined in the override table?
Line 1,882 ⟶ 1,880:
args.code = ''; -- unset because not a language code
else
return make_error_msg (substitute (cfg.transl_t.unrecog_lang_scr, {args.code}), args, template); -- invalid language / script code
end
|