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

Stefan Seifert commented on SLING-9407:
---------------------------------------

default locale is Locale.US - but it's possibel to set you own default locale:
{code:java}
        MockResourceBundleProvider bundleProvider = 
(MockResourceBundleProvider)context.getService(ResourceBundleProvider.class);
        bundleProvider.setDefaultLocale(Locale.KOREA);
{code}

it's also possible to add you own translations (in this case for the default 
locale):
{code:java}
        ResourceBundle bundle = context.request().getResourceBundle(null);
        ((MockResourceBundle)bundle).put("key1", "value1");
{code}

> sling-mock: Add mock for ResourceBundleProvider and ResourceBundle (i18n)
> -------------------------------------------------------------------------
>
>                 Key: SLING-9407
>                 URL: https://issues.apache.org/jira/browse/SLING-9407
>             Project: Sling
>          Issue Type: New Feature
>          Components: Testing
>            Reporter: Stefan Seifert
>            Assignee: Stefan Seifert
>            Priority: Major
>             Fix For: Testing Sling Mock 2.5.0
>
>
> currently there is no built-in support for i18n, it's required to implement 
> an own mock of ResourceBundleProvider. we need a default implementation that 
> returns the keys as values, but allows to add your own mappings if needed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to