tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Borut Bolčina" <borut.bolc...@gmail.com>
Subject Re: [T5] Application Message Catalog not read
Date Thu, 11 Dec 2008 06:28:10 GMT
Just a follow up for those who don't read the jira thread. The problem is in
BOM (Byte Order Mark). If a property file is made with BOM included, then
the localization fails.

A cite from wikipedia (http://en.wikipedia.org/wiki/Byte-order_mark):

"While UTF-8 <http://en.wikipedia.org/wiki/UTF-8> does not have byte order
issues, a BOM encoded in UTF-8 may nonetheless be encountered, though the
Unicode standard does not recommend using
it[1]<http://en.wikipedia.org/wiki/Byte-order_mark#cite_note-0>.
It only identifies a file as UTF-8 and does not state anything about byte
order.[2]<http://en.wikipedia.org/wiki/Byte-order_mark#cite_note-utf-8-bom-1>Many
Windows <http://en.wikipedia.org/wiki/Microsoft_Windows> programs (including
Windows Notepad <http://en.wikipedia.org/wiki/Notepad>) add BOM's to UTF-8
files."

Cheers,
Borut

2008/12/10 Borut Bolčina <borut.bolcina@gmail.com>

> I just found out why the translation does not work. If all property files
> are in ANSI (ISO-8859-1) encoding then everything works as advertised. If
> default file, for example app.properties is in ANSI and the
> app_sl_SI.properties is in utf8, then the localization breaks. If all
> property files are in UTF-8 then I get [[missing key: key1]] if preffered
> language is [sl].
>
> I created both property files in Eclipse and then converted encodings in
> Notepad++ with Format/Convert to ANSI/UTF-8. I verified the encodings in
> Eclipse under Properties/Resource/Text file encoding.
>
> Index.tml
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>     <head>
>         <title>locale-not-working Start Page ${message:key1}</title>
>     </head>
>     <body>
>         <h1>locale-not-working Start Page ${message:key2}</h1>
>
>         <p> This is the start page for this application, a good place to
> start your modifications.
>             Just to prove this is live: </p>
>
>         <p> The current time is: ${currentTime}. </p>
>
>
>         <p>
>             [<t:pagelink t:page="Index">refresh</t:pagelink>]
>         </p>
>     </body>
> </html>
>
>
> Index.properties
> key1=value1
> key2=value2
>
> Index_sl_SI.properties
> key1=value1-translated
> key2=value2-translated
>
>
> I will attach a test project to the jira issue. Using Tapestry 5.0.17.
>
> Regards,
> Borut
>
> 2008/12/10 SergeEby <sdeby@hotmail.com>
>
>
>> Hi,
>>
>> I have a sample application supporting multiple languages which doesn't
>> exhibit this behavior:
>> http://code.google.com/p/tapestry5-appfuse/
>>
>> You may have something else going on.
>>
>> /Serge
>>
>>
>> bbcooper wrote:
>> >
>> > I found a bug. First entry in properties file is never used. I tried
>> > reordering entries and the first entry never gets "translated". I used T
>> > 5.0.15, 5.0.16 and 5.0.17. This applies not only for application wide
>> > catalog but also for page catalogs.
>> >
>> > I am filing a bug report at
>> > https://issues.apache.org/jira/browse/TAP5-409.
>> >
>> > Regards,
>> > Borut
>> >
>> > 2008/12/4 Howard Lewis Ship <hlship@gmail.com>
>> >
>> >> Nothing there has changed; it's still based on the filter name.
>> >>
>> >> On Thu, Dec 4, 2008 at 6:02 AM, Stephane Decleire
>> >> <sdecleire@cariboo-networks.com> wrote:
>> >> > Since 5.0.17, my localized messages are not read anymore from the
>> >> > application message catalog.
>> >> > My application message catalog is named backoffice.properties because
>> >> my
>> >> > filter in web.xml is called backoffice and this file is located in
>> the
>> >> > WEB-INF directory as explained in tapestry localization tutorial
>> >> > (http://tapestry.apache.org/tapestry5/guide/localization.html).
>> >> > I've change nothing since my last tapestry upgrade from
>> 5.0.16-SNAPSHOT
>> >> > and it was working.
>> >> > Has something been modified regarding the application message catalog
>> >> or
>> >> > the localization process ? I can't find any change in the nightly
>> >> > documentation ...
>> >> >
>> >> > Thanks in advance.
>> >> >
>> >> > Stephane
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Howard M. Lewis Ship
>> >>
>> >> Creator Apache Tapestry and Apache HiveMind
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-T5--Application-Message-Catalog-not-read-tp20833984p20934027.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message