You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2015/06/17 11:17:00 UTC

[jira] [Comment Edited] (SLING-4814) i18n translations not working unless server is restarted

    [ https://issues.apache.org/jira/browse/SLING-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589508#comment-14589508 ] 

Konrad Windszus edited comment on SLING-4814 at 6/17/15 9:16 AM:
-----------------------------------------------------------------

Basically the fix from SLING-2881 has been removed when getting rid of the JCR API in SLING-4186. There used to be two different observation listeners:
# one for sling:Message node types (always relevant)
# one for mix:language node types (only relevant if below one of the language roots)
Those have been removed in r1650497   (https://fisheye6.atlassian.com/browse/sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java?r1=1650495&r2=1650497).

Therefore changes outside of any known {{languageRootPath}} is not processed at all.

Fixing this only leveraging the OSGi event listener is not that easy, because it is impossible to get the nodetype with Sling API. Therefore use cases where a new dictionary has been created are hard to detect.


was (Author: kwin):
Basically the fix from SLING-2881 has been removed when getting rid of the JCR API in SLING-4186. There used to be two different observation listeners:
# one for sling:Message node types (always relevant)
# one for mix:language node types (only relevant if below one of the language roots)
Those have been removed in r1650497   (https://fisheye6.atlassian.com/browse/sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java?r1=1650495&r2=1650497).

Therefore changes outside of any known {{languageRootPath}} is not processed at all.

Fixing this only leveraging the OSGi event listener is not that easy, because in case of resource removals no nodetype is available at all, therefore it is impossible to tell whether the removal affected a dictionary or not.

> i18n translations not working unless server is restarted
> --------------------------------------------------------
>
>                 Key: SLING-4814
>                 URL: https://issues.apache.org/jira/browse/SLING-4814
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: i18n 2.4.2
>            Reporter: Nitin Goyal
>
> We have deployed an AEM package where the i18n translations are defined in the standard way under /apps/myapp/i18n as sling:key/sling:value pairs.
> After installing the package on AEM 6.1 we found that none of the strings (not even the English ones) get translated properly. Once we restart the AEM server all translations works fine.
> It works fine in AEM 6.0 without requiring any server restart.
> I tried to capture the logs after setting the org.apache.sling.i18n to DEBUG level.
> When I install the app bundle I see the following entry in the log file:
> 17.06.2015 11:54:14.438 INFO [0:0:0:0:0:0:0:1 [1434522253131] GET /libs/granite/core/content/login.html HTTP/1.1] org.apache.sling.i18n.impl.JcrResourceBundleProvider Currently loaded dictionaries across all locales: [/libs/foundation/components/mobilefooter/i18n/en, /libs/cq/searchpromote/components/pagination/i18n/en, /libs/foundation/components/search/i18n/en, /libs/commerce/components/search/i18n/en]
> It does not list the dictionary of my app bundle. There is no other log related to loading dictionaries.
> However when I restart the server after installing my package I see the entry in the log file related to loading the dictionaries corresponding to my application bundle /apps/connect/i18n/en/strings. Pasting the log entries below:
> 17.06.2015 11:14:38.232 INFO [0:0:0:0:0:0:0:1 [1434519877679] GET /libs/granite/core/content/login.html HTTP/1.1] org.apache.sling.i18n Service [3279, [java.util.ResourceBundle]] ServiceEvent REGISTERED
> 17.06.2015 11:14:38.234 DEBUG [0:0:0:0:0:0:0:1 [1434519877679] GET /libs/granite/core/content/login.html HTTP/1.1] org.apache.sling.i18n.impl.JcrResourceBundleProvider registerResourceBundle(Key(null, en), ...): added service registration and language roots [/libs/foundation/components/mobilefooter/i18n/en, /libs/cq/searchpromote/components/pagination/i18n/en, /libs/foundation/components/search/i18n/en, /libs/commerce/components/search/i18n/en, /apps/connect/i18n/en/strings]
> 17.06.2015 11:14:38.234 INFO [0:0:0:0:0:0:0:1 [1434519877679] GET /libs/granite/core/content/login.html HTTP/1.1] org.apache.sling.i18n.impl.JcrResourceBundleProvider Currently loaded dictionaries across all locales: [/libs/foundation/components/mobilefooter/i18n/en, /libs/cq/searchpromote/components/pagination/i18n/en, /apps/connect/i18n/en/strings, /libs/foundation/components/search/i18n/en, /libs/commerce/components/search/i18n/en]
> 17.06.2015 11:14:38.267 DEBUG [0:0:0:0:0:0:0:1 [1434519877679] GET /libs/granite/core/content/login.html HTTP/1.1] org.apache.sling.i18n.impl.JcrResourceBundleProvider getResourceBundleInternal(Key(null, en)): got cache hit on first try



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