You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2018/03/19 09:01:00 UTC

[jira] [Comment Edited] (SLING-7430) Invalid assumptions in SlingSpecificsSightlyIT#testI18nBasename

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

Radu Cotescu edited comment on SLING-7430 at 3/19/18 9:00 AM:
--------------------------------------------------------------

[~kwin], I'm afraid you didn't check the test properly. The value "die Bank" is expected to be returned whenever an explicit {{basename}} value is passed to the {{org.apache.sling.i18n.ResourceBundleProvider#getResourceBundle(java.lang.String, java.util.Locale)}} method, since there's a dictionary matching both the base name and the locale.

It should probably be the other way around: the value of "das Ufer" might have to be accepted even when not specifying a {{basename}} value. The question is how should this be handled? What's the expected value in the current setup?


was (Author: radu.cotescu):
[~kwin], I'm afraid you didn't check the test properly. The value "die Bank" is expected to be returned whenever an explicit {{basename}} value is passed to the {{org.apache.sling.i18n.ResourceBundleProvider#getResourceBundle(java.lang.String, java.util.Locale)}} method, since there's a dictionary matching both the base name and the locale.

It should probably be the other way around: the value of "das Bank" might have to be accepted even when not specifying a {{basename}} value. The question is how should this be handled? What's the expected value in the current setup?

> Invalid assumptions in SlingSpecificsSightlyIT#testI18nBasename
> ---------------------------------------------------------------
>
>                 Key: SLING-7430
>                 URL: https://issues.apache.org/jira/browse/SLING-7430
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>            Reporter: Konrad Windszus
>            Assignee: Radu Cotescu
>            Priority: Major
>
> The test at https://github.com/apache/sling-org-apache-sling-scripting-sightly-testing/blob/905ffd59bebd8d9adaa5d172d169e6eac1469a03/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java#L342 incorrectly assumes that the key being returned when no basename is set is always the key from the dictionary not having the property {{sling:basename}} is set. This is wrong according to both documentation https://sling.apache.org/documentation/bundles/internationalization-support-i18n.html#resourcebundle-with-base-names and implementation in i18n.
> Although the implementation might change in the future (SLING-7429) right now the IT needs to be fixed to also accept value "die Bank" being returned (https://github.com/apache/sling-org-apache-sling-scripting-sightly-testing-content/blob/91e9397133eea906372aae2ea1f4a1e2e46f4c70/src/main/resources/SLING-INF/apps/sightly/locales/de_finance_basename.json#L13) even when no explicit basename is set.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)