Module:I18n: Difference between revisions

m
no edit summary
m (Fix non-existent translations)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 56: Line 56:
     return translations
     return translations
end
end
function i18n.getTranslatedTitle(title, lang)
    title = title or ''
    lang = lang or ''
    local title_full = title .. lang
    local display_title
    if title_full then
        local tp = mw.title.makeTitle('', title_full)
        if tp.exists then
            display_title = string.match(tp:getContent(), "%{%{DISPLAYTITLE:([^}]+)%}%}")
        end
    end
   
    return display_title
end


function i18n.translate(translations, key)
function i18n.translate(translations, key)