[
https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655334#action_12655334
]
Borut Bolcina commented on TAP5-409:
------------------------------------
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
> First entry in properties file for localization is never used.
> --------------------------------------------------------------
>
> Key: TAP5-409
> URL: https://issues.apache.org/jira/browse/TAP5-409
> Project: Tapestry 5
> Issue Type: Bug
> Affects Versions: 5.0.15, 5.0.16, 5.0.17
> Reporter: Borut Bolcina
>
> app.properties has 3 entries:
> openid-provider-title=OpenID provider
> my-account-link=My account
> login-link=Login
> index.tml
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <head>
> <title>${message:openid-provider-title}</title>
> <link rel="stylesheet" type="text/css"
> href="${asset:context:css/iopenid.css}" />
> </head>
> <body>
> <t:security.ifloggedin>
> <p><t:userdetails /> <a t:type="pagelink"
> t:page="AccountEdit" href="#">${message:my-account-link}</a> <a
> t:type="actionlink" t:id="logout">odjava</a></p>
> <t:parameter name="else">
> <a t:type="pagelink" t:page="Login"
> href="#">${message:login-link}</a>
> </t:parameter>
> </t:security.ifloggedin>
> </body>
> </html>
> I also have two other lozalized properties files. Depending on the browser
> preffered language selection the correct translatinos are displayed - EXCEPT
> the first entry, which always falls back to english.
> I first noticed this behaviour when playing arounf with EditBean - the
> translated labels all worked, well, except the first one. Whichever entry was
> the first in the file, that label was not translated.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]