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

Kai Denzel edited comment on WW-4929 at 11/21/20, 4:53 PM:
-----------------------------------------------------------

Hello [~lukaszlenart] thanks for looking but i don't understand this fully. 
Shouldn't it be the duty of the interceptor to filter out the correct locale 
and insert them into the {{LocalizedTextProvider}}? The 
{{LocalizedTextProvider}} does not need a fully set of Locales, only the one 
filtered out by the interceptor. If i understand the code in the 
{{I18nInterceptor}} correctly, then it must be the {{LocaleHandler's}} or 
{{DefaultLocaleProvider's }} duty to filter out the Locale from the 
"Accept-language"-Header or am i wrong?


was (Author: kdenzel):
Hello [~lukaszlenart] thanks for looking but i don't understand this fully. 
Shouldn't it be the duty of the interceptor to filter out the correct locale 
and insert them into the {{LocalizedTextProvider}}? The 
{{LocalizedTextProvider}}does not need a fully set of Locales, only the one 
filtered out by the interceptor. If i understand the code in the 
{{I18nInterceptor}} correctly, then it must be the {{LocaleHandler's}} or 
{{DefaultLocaleProvider's }} duty to filter out the Locale from the 
"Accept-language"-Header or am i wrong?

> Fallback i18n Locale
> --------------------
>
>                 Key: WW-4929
>                 URL: https://issues.apache.org/jira/browse/WW-4929
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>    Affects Versions: 2.5.14.1
>            Reporter: Kai Denzel
>            Priority: Major
>             Fix For: 2.6
>
>
> What i noticed is, when i set the perfered languages in my browser for 
> example in this order:
> fr - francais
> de - german
> en - english
> The framework will set the ActionContext.getLocale() to fr. Then the 
> framework will look for resources for francais, and if this locale resources 
> do not exist, the framework will look for the system locale. If the system 
> locale in this example is en, the german resources will be overlooked.
> I mean the HTTP-Header "Accept-language" has an Array of locales. So why not 
> fallback to the next selected if the first Locale does not exist? 
> Is it possible, to make the framework ready for fallback?
>  
>  



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

Reply via email to