You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Götz <to...@richmountain.de> on 2010/07/20 10:19:17 UTC

Strange problem with I18N keys in xml resource bundle

I have a strange problem with an I18N key which is stored in an xml resource bundle. I try to set the following keys for a german translation:

- PagingNavigator.first
- PagingNavigator.previous
- PagingNavigator.next
- PagingNavigator.last
- PagingNavigator.page

I noticed that wicket already provides the translation for those keys in several languages in it's Application.properties bundle. Unfortunately, in Apllication_de.properties those keys are missing. Anyway, I put them in MyComponent_de.xml and everything works fine, only the last key (PagingNavigator.page) causes the problem of not beeing translated. Instead, the english (default) translation is used.

Here is the content of MyComponent_de.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
 <entry key="PagingNavigator.first">erste Seite</entry>
 <entry key="PagingNavigator.previous">vorherige Seite</entry>
 <entry key="PagingNavigator.next">nächste Seite</entry>
 <entry key="PagingNavigator.last">letzte Seite</entry>
 <entry key="PagingNavigator.page">Seite ${page}></entry>
</properties>

Is there something wrong with the syntax when using parameterized keys in xml?

 -Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Strange problem with I18N keys in xml resource bundle

Posted by Thomas Götz <to...@richmountain.de>.
On 20.07.2010 12:40, Ernesto Reinaldo Barreiro wrote:
> Tomas,
>
> It might be because PagingNavigation.page is read from within
> PagingNavigation component. Maybe it is consistent in the sense that
> it refers to the component using the resource. I don't know if a
> convention is followed for these things on core components? By the
> way... Would it be a good idea to create a JIRA issue (with a patch)
> for adding those keys/values to Application_de.properties?

It definitely would! I'll have a look at that asap.

    -Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Strange problem with I18N keys in xml resource bundle

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Tomas,

It might be because PagingNavigation.page is read from within
PagingNavigation component. Maybe it is consistent in the sense that
it refers to the component using the resource. I don't know if a
convention is followed for these things on core components? By the
way... Would it be a good idea to create a JIRA issue (with a patch)
for adding those keys/values to Application_de.properties?

Regards,

Ernesto

> Ha! Nice one, thanks ;-)
> The naming is a little bit inconsistent IMHO.
>
>   -Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Strange problem with I18N keys in xml resource bundle

Posted by Thomas Götz <to...@richmountain.de>.
On 20.07.2010 10:53, Ernesto Reinaldo Barreiro wrote:
> Maybe because the key should be PagingNavigation.page?

Ha! Nice one, thanks ;-)
The naming is a little bit inconsistent IMHO.

    -Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Strange problem with I18N keys in xml resource bundle

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Maybe because the key should be PagingNavigation.page?

Ernesto

On Tue, Jul 20, 2010 at 10:19 AM, "Thomas Götz" <to...@richmountain.de> wrote:
> I have a strange problem with an I18N key which is stored in an xml resource bundle. I try to set the following keys for a german translation:
>
> - PagingNavigator.first
> - PagingNavigator.previous
> - PagingNavigator.next
> - PagingNavigator.last
> - PagingNavigator.page
>
> I noticed that wicket already provides the translation for those keys in several languages in it's Application.properties bundle. Unfortunately, in Apllication_de.properties those keys are missing. Anyway, I put them in MyComponent_de.xml and everything works fine, only the last key (PagingNavigator.page) causes the problem of not beeing translated. Instead, the english (default) translation is used.
>
> Here is the content of MyComponent_de.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
> <properties>
>  <entry key="PagingNavigator.first">erste Seite</entry>
>  <entry key="PagingNavigator.previous">vorherige Seite</entry>
>  <entry key="PagingNavigator.next">nächste Seite</entry>
>  <entry key="PagingNavigator.last">letzte Seite</entry>
>  <entry key="PagingNavigator.page">Seite ${page}></entry>
> </properties>
>
> Is there something wrong with the syntax when using parameterized keys in xml?
>
>  -Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org