You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2015/03/21 08:18:38 UTC

[jira] [Updated] (ISIS-1104) Remove some of the chattiness in the log if there are no translations for a given locale

     [ https://issues.apache.org/jira/browse/ISIS-1104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Haywood updated ISIS-1104:
------------------------------
    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.

  was:
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).

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 is returned.

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 no WEB-INF/translations.po ("fallback") file exists then suppress log WARN messages
- otherwise preserve current behaviour.

This means that:
- systems that do care about i18n requirements should include a WEB-INF/translations.po with translations in WEB-INF
- those that don't should simply omit it.

There was a WARN message if the fallback (transltions.po) file was missing; this is now a simple INFO message instead.


> Remove some of the chattiness in the log if there are no translations for a given locale
> ----------------------------------------------------------------------------------------
>
>                 Key: ISIS-1104
>                 URL: https://issues.apache.org/jira/browse/ISIS-1104
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: core-1.8.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: 1.9.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)