Tamil does not work in racks 2.3.29

I have an application for multilingual locations, and recently I updated racks from 2.3.20 to 2.3.29. After the update, the Tamil language does not work, even if, if we choose Tamil, the texts will be shown in English.

I checked the locale setting when choosing the Tamil language, this is correct, i.e. request_locale = ta_IN .

I tried to extend I18nInterceptor in my class of custom interceptors, and then override the method as shown below. This also did not work. getLocaleFromParam()

So please let me know if you have a solution for this problem.

Tamil worked great in Struts 2.3.20

protected Locale getLocaleFromParam(Object requestedLocale) 
{
        Locale locale = null;
        if (requestedLocale != null) {
            locale = (requestedLocale instanceof Locale) ?
                    (Locale) requestedLocale :
                  LocalizedTextUtil.localeFromString   
                                (requestedLocale.toString(), null);
            if (locale != null) {
                logger.debug("applied request locale="+locale);
            }
        }
        return locale;
}
+4
1

.

struts, (https://struts.apache.org/docs/struts-defaultxml.html):

<interceptor-stack name="defaultStack">
     <interceptor-ref name="exception"/>
     <interceptor-ref name="alias"/>
     <interceptor-ref name="servletConfig"/>
     <interceptor-ref name="i18n"/>
     <interceptor-ref name="prepare"/>
     <interceptor-ref name="chain"/>
     <interceptor-ref name="scopedModelDriven"/>
     <interceptor-ref name="modelDriven"/>
     <interceptor-ref name="fileUpload"/>
     <interceptor-ref name="checkbox"/>
     <interceptor-ref name="datetime"/>
     <interceptor-ref name="multiselect"/>
     <interceptor-ref name="staticParams"/>
     <interceptor-ref name="actionMappingParams"/>
     <interceptor-ref name="params"/>
     <interceptor-ref name="conversionError"/>
     <interceptor-ref name="validation">
        <param name="excludeMethods">input,back,cancel,browse</param>
     </interceptor-ref>
     <interceptor-ref name="workflow">
          <param name="excludeMethods">input,back,cancel,browse</param>
     </interceptor-ref>
     <interceptor-ref name="debugging"/>

    <interceptor name="customi18n"
        class="foo.bar.CustomI18NInterceptor" />

:

//Give a new name to your stack
<interceptor-stack name="customDefaultStack">
      <interceptor-ref name="exception"/>
      <interceptor-ref name="alias"/>
      <interceptor-ref name="servletConfig"/>
      //Replace your customi18n interceptor
      <interceptor-ref name="customi18n"/>
     //Same as above
  .....

<default-interceptor-ref name="customDefaultStack"/>
+1

Source: https://habr.com/ru/post/1656560/


All Articles