Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-9732

Cannot overwrite default translations in documents anymore (in french wiki)

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      To reproduce:

      • set a wiki to unilanguage, default language "fr"
      • create a document with translations, say Sandbox.Translations – the document will have the following language settings
        <language/>
        <defaultLanguage>fr</defaultLanguage>
        <translation>0</translation>
        
      • set this document as localization document in XWikiPreferences in the localization section
      • putting new translation keys in this document and using them all over the wiki with $services.localization.render(key) will work fine
      • we want to overwrite the default login and logout texts, defined in ApplicationRessources_fr.properties
      • we put
        login=New login text
        logout=New logout text
        

        in Sandbox.Translations

      • nothing changes on the UI for the login/logout links

      The cause seems to be the locale of the translations document Sandbox.Translations which is "" . The way translations work is that translations in the exact demanded locale (fr) have priority over default translations, and if a translation for the exact locale is found, the default one is not taken into account. In this case, ApplicationRessources_fr.properties has exact fr as locale, and Sandbox.Translations has "" as locale, even if, indeed, Sandbox.Translations has higher priority than ApplicationResources (as XWIKI-8881 says).

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: