You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Borut Bolcina (JIRA)" <ji...@apache.org> on 2008/12/10 12:14:44 UTC

[jira] Created: (TAP5-409) First entry in properties file for localization is never used.

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.17, 5.0.16, 5.0.15
            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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Borut Bolcina (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660500#action_12660500 ] 

Borut Bolcina commented on TAP5-409:
------------------------------------

Simple solution: a warning should be added at http://tapestry.apache.org/tapestry5/guide/localization.html like: "Make sure you don't have BOM bytes in your properties file. Some editors on Windows platform do that when you save a file in UTF-8 encoding."

Smarter solution: tapestry should use smarter file reader (like Martijn suggested).

> 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
>            Assignee: Howard M. Lewis Ship
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Borut Bolcina (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Borut Bolcina updated TAP5-409:
-------------------------------

    Attachment: locale-not-working.zip

An Eclipse project.

> 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
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Andy Blower (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655273#action_12655273 ] 

Andy Blower commented on TAP5-409:
----------------------------------

It's only ignoring the first entry if it's on the first line. So if you leave a blank line at the start that will get round this issue until it gets fixed.

> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-409:
-----------------------------------------

    Assignee: Howard M. Lewis Ship

> 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
>            Assignee: Howard M. Lewis Ship
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Issue Comment Edited: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Borut Bolcina (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655337#action_12655337 ] 

borutb edited comment on TAP5-409 at 12/10/08 11:57 AM:
---------------------------------------------------------------

Attaching an Eclipse project.

      was (Author: borutb):
    An Eclipse project.
  
> 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
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Massimo Lusetti (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655573#action_12655573 ] 

Massimo Lusetti commented on TAP5-409:
--------------------------------------

Isn't this a show-stopper for the GA release?

> 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
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Issue Comment Edited: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Andy Blower (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655273#action_12655273 ] 

andyb edited comment on TAP5-409 at 12/10/08 8:42 AM:
------------------------------------------------------------

It's only ignoring the first entry if it's on the first line. So if you leave a blank line at the start that will get round this issue until it gets fixed. (Tested on 5.0.18)

      was (Author: andyb):
    It's only ignoring the first entry if it's on the first line. So if you leave a blank line at the start that will get round this issue until it gets fixed.
  
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Martijn Brinkers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655575#action_12655575 ] 

Martijn Brinkers commented on TAP5-409:
---------------------------------------

Java does not have support for the BOM. 

This reader does recognize the BOM so perhaps this reader can be used?
 
http://koti.mbnet.fi/akini/java/unicodereader/

It should be documented that property files should not be saved with BOM

> 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
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Borut Bolcina (JIRA)" <ji...@apache.org>.
    [ 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Borut Bolcina (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655338#action_12655338 ] 

Borut Bolcina commented on TAP5-409:
------------------------------------

I played a little more with Notepad++ Format/Convert commands. There is an option Convert to "UTF-8 without BOM". If file is encoded with this option then the translation works. So it has to do something with Byte Order Mark.

> 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
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-409) First entry in properties file for localization is never used.

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659968#action_12659968 ] 

Howard M. Lewis Ship commented on TAP5-409:
-------------------------------------------

I'm not seeing what's broken. I downloaded the example app and ran it and see exactly what I should see, using both 5.0.17 and 5.0.18.

T5 includes tests with UTF-8 encoded .properties files that work fine.  I just manually revalidated the tests using the debugger.

>From what I can tell, this is an issue with certain editors creating the file in the wrong format?

> 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
>            Assignee: Howard M. Lewis Ship
>         Attachments: locale-not-working.zip
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org