Difference between revisions of "Module:Template translation"

Jump to navigation Jump to search
m
fixed for now (the test for apostrophe is broken and commented out)
>Verdy p
m
>Verdy p
m (fixed for now (the test for apostrophe is broken and commented out))
Line 4: Line 4:
     -- Get the last subpage (this function isolated for debugging purpose)
     -- Get the last subpage (this function isolated for debugging purpose)
     local subpage = mw.title.getCurrentTitle().subpageText
     local subpage = mw.title.getCurrentTitle().subpageText
     --[[If the subpage is a valid language code, check if a translation of the
     --[[Check first if there's an apostrophe, because they break the  
        template exists in that language; if so, put it in langcode.
         isKnownLanguageTag function. THIS TEST DOES NOT WORK
        Check first if there's an apostrophe, because they break the  
         isKnownLanguageTag function.
         ]]
         ]]
     --if (mw.ustring.match(subpage, "'") == nil)
     --if (mw.ustring.match(subpage, "'") == nil)
     --then
     --then
        --[[If the subpage is a valid language code, check if a translation of the
            template exists in that language; if so, put it in langcode.
            ]]
         if (mw.language.isKnownLanguageTag(subpage))
         if (mw.language.isKnownLanguageTag(subpage))
         then
         then
Line 38: Line 39:
     end
     end
     local langcode = 'en'
     local langcode = 'en'
     -- Get the last subpage
     -- Get the last subpage and check if it matches a known language code
     local subpage = this.getLanguageSubpage()
     local subpage = this.getLanguageSubpage()
     if (subpage ~= '')
     if (subpage ~= '')
Anonymous user

Navigation menu