Hi Roberto,

On Tue, Mar 15, 2016 at 6:18 PM, Roberto Lavalle de Juan <
[email protected]> wrote:

> Hi all!
>
> we translate our pages with "/getSession().setLocale(new Locale("gb"));/"
> or "g/etSession().setLocale(new Locale("es"));/" and it works, but if we
> use this code to translate some menu bars:
>
> /protected void addServiceActionMenuBars() {//
> //    addMenuBar(this, ID_PRIMARY_MENU_BAR,
> DomainServiceLayout.MenuBar.PRIMARY);//
> //    addMenuBar(this, ID_SECONDARY_MENU_BAR,
> DomainServiceLayout.MenuBar.SECONDARY);//
> //    addMenuBar(this, ID_TERTIARY_MENU_BAR,
> DomainServiceLayout.MenuBar.TERTIARY);//
> //}//
> //
> //private void addMenuBar(final MarkupContainer container, final String
> id, final DomainServiceLayout.MenuBar menuBar) {//
> //        final ServiceActionsModel model = new
> ServiceActionsModel(menuBar);//
> //Component menuBarComponent =
> getComponentFactoryRegistry().createComponent(ComponentType.SERVICE_ACTIONS,
> id, model);//
> //menuBarComponent.add(AttributeAppender.append("class",
> menuBar.name().toLowerCase(Locale.ENGLISH)));//
> //        container.add(menuBarComponent); //
> //}/
>
> when "/createComponent/" is executed the
> "/RequestCycle.get().getRequest().getLocale().getLanguage()/" has the
> initial language of the navigator. For example, if navigator is in spanish
> and we


RequestCycle.get().getRequest().getLocale().getLanguage() is the locale
sent by the browser.
Wicket uses the locale set in the Session for i18n If Session#locale is
null then it falls back to the locale of the request.


> translate to english the menu bars are created they will be in spanish.
> And if navigator is in english and we translate to spanish the menu bars
> are created they will be in english.
>
> Thanks a lot for your help.
>
> Roberto Lavalle de Juan
> CTO - tellmeGen
> tlf. +34 650 129 806
>
> El 14/03/2016 a las 9:28, Martin Grigorov escribió:
>
>> Hi,
>>
>> Tellmegen was using 1.9.0-SNAPSHOT last time I worked on it.
>> The menus are loaded from the .po files. The content of the pages is
>> custom, so it is using Wicket's .properties.xml.
>>
>> The history of
>>
>> https://github.com/apache/isis/commits/master/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/services/LocaleProviderWicket.java
>> doesn't show in which version it has been introduced and improved.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Mon, Mar 14, 2016 at 8:20 AM, Dan Haywood <
>> [email protected]>
>> wrote:
>>
>> We implemented the TranslationServicePo for this project.  As I recall
>>> that
>>> was part of 1.8.0, and then there were some subsequent fixes/refinements
>>> in
>>> the following releases, which is why I wanted to know which version they
>>> are on (so we don't go chasing an issue that might already have been
>>> fixed)...
>>>
>>> thx
>>>
>>> Dan
>>>
>>>
>>>
>>>
>>> On 13 Mar 2016 21:05, "Óscar Bou - GOVERTIS" <[email protected]> wrote:
>>>
>>> Hi Dan and ROBERTO.
>>>>
>>>> Roberto is a mate of Carlos in the TellmeGen project.
>>>>
>>>> Not sure but I slightly remember there was some custom code in that
>>>> project for localization depending on browser.
>>>>
>>>> Not sure if it was an Isis or Wicket trick ...
>>>>
>>>>
>>>> El 13 mar 2016, a las 20:03, Dan Haywood <[email protected]
>>>>>
>>>> escribió:
>>>>
>>>>> Hi Roberto,
>>>>>
>>>>> which version of Apache Isis are you on?  And can you provide a small
>>>>> example in github, based on the simpleapp, and describe how to
>>>>>
>>>> reproduce
>>>
>>>> the issue?
>>>>>
>>>>> thx
>>>>> Dan
>>>>>
>>>>>
>>>>> On 9 March 2016 at 16:34, Roberto Lavalle de Juan <
>>>>> [email protected]> wrote:
>>>>>
>>>>> Hi again :)
>>>>>>
>>>>>> if I have the browser in English and translated into Spanish I feel
>>>>>>
>>>>> the
>>>
>>>> same, its all translated into Spanish except the menu bars...
>>>>>>
>>>>>> Let's see if someone can help me...
>>>>>>
>>>>>> Thanks again!!!
>>>>>>
>>>>>> Roberto Lavalle de Juan
>>>>>> CTO - tellmeGen
>>>>>> tlf. +34 650 129 806
>>>>>>
>>>>>> El 08/03/2016 a las 11:01, Roberto Lavalle de Juan escribió:
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> we have a problem, because if we change the user language with a
>>>>>>>
>>>>>> button
>>>
>>>> with this code (we change the language to english with the button,
>>>>>>>
>>>>>> and
>>>
>>>> we
>>>>
>>>>> have an spanish "Chrome" navigator):
>>>>>>>
>>>>>>> getSession().setLocale(new Locale("gb"));
>>>>>>>
>>>>>>> then our web is translated to english, but have the menu bars in
>>>>>>>
>>>>>> spanish,
>>>>
>>>>> do not translate. Could I solve this problem?
>>>>>>>
>>>>>>> Thanks a lot!!!
>>>>>>>
>>>>>>
>

Reply via email to