Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1104

Remove some of the chattiness in the log if there are no translations for a given locale

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: core-1.8.0
    • Fix Version/s: 1.9.0
    • Component/s: Core
    • Labels:
      None

      Description

      Currently if no translation can be found for a given locale then the system generates a lot of WARN messages.

      But for some systems i18n may not be important at all. And for others, we only really want a warning for one of the languages we care to support, and not for others (they can use the fallback, ie "WEB-INF/translations.po").

      This ticket is to remove the WARN logging in these cases.

      ~~~
      Looking at the implementation, I now see/recall that we have an algorithm (cf ResourceBundles and others) that goes searching for the translation file for a given locale; and if none are found then the fallback translations are used.

      So, the warning is logged if there IS a fallback and it doesn't have a translation for a given msgId.

      Therefore the fix I'm going with is:

      • if the fallback is being used then suppress log WARN messages
      • otherwise preserve current behaviour.

      This means that:

      • systems that do care about i18n requirements for a specific locale (language/country) should include a WEB-INF/translations_XX_yy.po (or just WEB-INF/translations_XX.po)
      • those that don't should simply omit it.
      • there is no need to fully translate the translations.po file

      There was a WARN message if the fallback (transltions.po) file was missing; this is now a simple INFO message instead, the new interpretation being that having no translations.po file is basically the same as having one that has no translations in it.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: