[CONF] Apache Tapestry Localization

2013-01-21 Thread confluence







Localization
Page edited by Bob Harner


Comment:
Added list of supported languages, and instructions on providing translations to Tapestry's built-in messages


 Changes (4)
 




...
h2. Changing the Locale  
The [PersistentLocale service|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html] can be used to programmatically override the locale for the current request. 
The [PersistentLocale service|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html] can be used to programmatically override the locale. Note: You should be careful to only set the persistent locale to a supported locale. 
 {code:java|title=Toggle between English and German} 
...
Once a persistent locale is set, you will see the locale name as the first virtual folder in page render and component event requests URLs. In this way, a persistent locale will, in fact, persist from request to request, or in a users bookmarks.  
You should be careful to only set the persistent locale to a supported locale.  
You will see the new locale take effect on the next request. If it is changed in a component event request (which is typical), the new locale will be used in the subsequent page render request.  Note that the locale for a page is fixed (it cant change once the page instance is created). In addition, a page may only be attached to a request once. In other words, if code in your page changes the persistent locale, you wont see a change to the pages locale (or localized messages) _in that request_. 
 h2. Built-in Locales  While your application can support any locale (and thus any language) that you want, Tapestry provides only a limited set of translations for its own built-in messages. As of Tapestry 5.3, the following locales have translations provided:  | en (English)| es (Spanish)   | ja (Japanese)| ru (Russian)  | bg (Bulgarian)  | fi (Finnish)   | mk (Macedonian)  | sr (Serbian)  | da (Danish) | fr (French)| nl (Dutch)   | sv (Swedish)  | de (German) | hr (Croatian)  | no (Norwegian)   | zh (Chinese)  | el (Greek)  | it (Italian)   | pt (Portuguese)  |   h3. Providing translations for Tapestry built-in messages  Fortunately, Tapestry uses all the same mechanisms for its own locale support as it provides for your application. So, to support other locales, just translate the built-in message catalog (property) files yourself:  {html} style type=text/csstable.sectionMacro { width: auto; }/style {html}  {section:width=auto} {column} || Tapestry 5.4 and later || | [core.properties|https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-core/src/main/resources/org/apache/tapestry5/core.properties;hb=HEAD] | | [tapestry-kaptcha.properties|https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties;hb=HEAD] | {column} {column} || Tapestry 5.3.x || | [BeanEditForm.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm.properties?view=markup] | | [DateField.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties?view=markup] | | [Errors.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors.properties?view=markup] | | [GridColumns.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns.properties?view=markup] | | [GridPager.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridPager.properties?view=markup] | | [Palette.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Palette.properties?view=markup] | | [ValidationMessages.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages.properties?view=markup] | | [tapestry-kaptcha.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties?view=markup] | {column} {section}  To have Tapestry use these new files, just put them in the corresponding package-named directory within your own app (for 

[CONF] Apache Tapestry Localization

2013-01-21 Thread confluence







Localization
Page edited by Bob Harner


 Changes (1)
 




h1. Localization  
{float:right|background="" {contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=component-templates,localization} {float}   
Localization is all about getting the right text to the user, in the right language.  
...


Full Content

Localization


Related Articles


 Page:
 Templating and Markup FAQ





 Page:
 Component Classes





 Page:
 Component Parameters




 

Localization is all about getting the right text to the user, in the right language.

Localization support is well integrated into Tapestry. Tapestry allows you to easily separate the text you present to your users from the rest of your application ... pull it out of your Java code and even out of your component templates. You can then translate your messages into other languages and let Tapestry put everything together.

Component Message Catalogs

Each component class may have a component message catalog. A component message catalog is a set of files with the extension ".properties". These property files are the same format used by java.util.ResourceBundle, just lines of key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (that's a language code plus a country code, and you can even go further and add variants ... but its unlikely that you'll ever need to go beyond just language codes in practice).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Properties File Charset

Tapestry uses the UTF-8 charset when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool. Make sure that your properties files don't contain byte order marks (BOM) as Java - and thus Tapestry - doesn't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Message Catalog Inheritance

If a component class is a subclass of another component class, then it inherits that base class' message catalog. Its own message catalog extends and overrides the values inherited from the base class.

In this way, you could have a base component class that contained common messages, and extend or override those messages in subclasses (just as you would extend or override the methods of the base component class). This, of course, works for as many levels of inheritance as you care to support.

Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Localized Component Templates

The same lookup mechanism applies to component templates. Tapestry will search for a localized version of each component template and use the closest match. Thus you could have MyPage_fr.html for French users, and MyPage.html for all other users.

Accessing Localized Messages

The above discusses what files to create and where to store them, but doesn't address how to make use of that information.

Messages can be accessed in one of two ways:


	Using the "message:" binding _expression_ in a component template
	By injecting the component's Messages object
In the first case, you may use the message: binding prefix with 

[jira] [Assigned] (TAP5-2055) Polish translations

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner reassigned TAP5-2055:


Assignee: Bob Harner

 Polish translations
 ---

 Key: TAP5-2055
 URL: https://issues.apache.org/jira/browse/TAP5-2055
 Project: Tapestry 5
  Issue Type: New Feature
  Components: tapestry-core
Affects Versions: 5.3.6
Reporter: Ryszard Trojnacki
Assignee: Bob Harner
 Attachments: BeanEditForm_pl.properties, DateField_pl.properties, 
 Errors_pl.properties, GridColumns_pl.properties, GridPager_pl.properties, 
 Palette_pl.properties, tapestry-kaptcha_pl.properties


 Polish translations

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (TAP5-2055) Polish translations

2013-01-21 Thread Bob Harner (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13559064#comment-13559064
 ] 

Bob Harner commented on TAP5-2055:
--

Ryszard,

The upcoming Tapestry 5.4 consolidates most of the translation files into a 
core property file, and it has some additional messages. I've copied your 
Polish translations into the attached core_pl.properties file, but it needs a 
few more messages translated (those starting with FIX-). Can you update it an 
send it back?

 Polish translations
 ---

 Key: TAP5-2055
 URL: https://issues.apache.org/jira/browse/TAP5-2055
 Project: Tapestry 5
  Issue Type: New Feature
  Components: tapestry-core
Affects Versions: 5.3.6
Reporter: Ryszard Trojnacki
Assignee: Bob Harner
 Attachments: BeanEditForm_pl.properties, core_pl.properties, 
 DateField_pl.properties, Errors_pl.properties, GridColumns_pl.properties, 
 GridPager_pl.properties, Palette_pl.properties, tapestry-kaptcha_pl.properties


 Polish translations

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (TAP5-2055) Polish translations

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner updated TAP5-2055:
-

Attachment: core_pl.properties

Polish translation file, still needing more work

 Polish translations
 ---

 Key: TAP5-2055
 URL: https://issues.apache.org/jira/browse/TAP5-2055
 Project: Tapestry 5
  Issue Type: New Feature
  Components: tapestry-core
Affects Versions: 5.3.6
Reporter: Ryszard Trojnacki
Assignee: Bob Harner
 Attachments: BeanEditForm_pl.properties, core_pl.properties, 
 DateField_pl.properties, Errors_pl.properties, GridColumns_pl.properties, 
 GridPager_pl.properties, Palette_pl.properties, tapestry-kaptcha_pl.properties


 Polish translations

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (TAP5-2055) Polish translations

2013-01-21 Thread Ryszard Trojnacki (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13559068#comment-13559068
 ] 

Ryszard Trojnacki commented on TAP5-2055:
-

Yes I will translate it.
Tommorow I will send core_pl.properties and one missing file to trapestry 5.3.

 Polish translations
 ---

 Key: TAP5-2055
 URL: https://issues.apache.org/jira/browse/TAP5-2055
 Project: Tapestry 5
  Issue Type: New Feature
  Components: tapestry-core
Affects Versions: 5.3.6
Reporter: Ryszard Trojnacki
Assignee: Bob Harner
 Attachments: BeanEditForm_pl.properties, core_pl.properties, 
 DateField_pl.properties, Errors_pl.properties, GridColumns_pl.properties, 
 GridPager_pl.properties, Palette_pl.properties, tapestry-kaptcha_pl.properties


 Polish translations

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Assigned] (TAP5-672) Translation for Vietnamese

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner reassigned TAP5-672:
---

Assignee: Bob Harner

 Translation for Vietnamese
 --

 Key: TAP5-672
 URL: https://issues.apache.org/jira/browse/TAP5-672
 Project: Tapestry 5
  Issue Type: Improvement
  Components: tapestry-core
Affects Versions: 5.1.0.5, 5.0.18
Reporter: Tam Du
Assignee: Bob Harner
  Labels: bulk-close-candidate
 Attachments: org.zip


 Files for translation of components in Vietnamese

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (TAP5-672) Translation for Vietnamese

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner updated TAP5-672:


Labels:   (was: bulk-close-candidate)

 Translation for Vietnamese
 --

 Key: TAP5-672
 URL: https://issues.apache.org/jira/browse/TAP5-672
 Project: Tapestry 5
  Issue Type: Improvement
  Components: tapestry-core
Affects Versions: 5.1.0.5, 5.0.18
Reporter: Tam Du
Assignee: Bob Harner
 Attachments: org.zip


 Files for translation of components in Vietnamese

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: TAP5-672 (Translation for Vietnamese)

2013-01-21 Thread bobharner
Updated Branches:
  refs/heads/5.3 d53e4b0e3 - 4f4b68efa


TAP5-672 (Translation for Vietnamese)

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4f4b68ef
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4f4b68ef
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4f4b68ef

Branch: refs/heads/5.3
Commit: 4f4b68efa8b35396ca558181cf1ad3cdd21cc3f5
Parents: d53e4b0
Author: bharner bobhar...@apache.org
Authored: Mon Jan 21 16:38:26 2013 -0500
Committer: bharner bobhar...@apache.org
Committed: Mon Jan 21 16:38:26 2013 -0500

--
 .../corelib/components/BeanEditForm_vi.properties  |   15 ++
 .../corelib/components/Errors_vi.properties|   15 ++
 .../corelib/components/GridColumns_vi.properties   |   17 +++
 .../corelib/components/GridPager_vi.properties |   15 ++
 .../corelib/components/Palette_vi.properties   |   21 +
 .../internal/ValidationMessages_vi.properties  |   34 +++
 6 files changed, 117 insertions(+), 0 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4f4b68ef/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm_vi.properties
--
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm_vi.properties
 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm_vi.properties
new file mode 100644
index 000..8d59f0a
--- /dev/null
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm_vi.properties
@@ -0,0 +1,15 @@
+# Copyright 2007 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an AS IS BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+submit-label=Tạo/Cập nhật

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4f4b68ef/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors_vi.properties
--
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors_vi.properties
 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors_vi.properties
new file mode 100644
index 000..a4b05d2
--- /dev/null
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors_vi.properties
@@ -0,0 +1,15 @@
+# Copyright 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an AS IS BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+default-banner=Bạn phải sửa lại các lỗi sau trước khi tiếp 
tục.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4f4b68ef/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns_vi.properties
--
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns_vi.properties
 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns_vi.properties
new file mode 100644
index 000..b46dfc6
--- /dev/null
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns_vi.properties
@@ -0,0 +1,17 @@
+# Copyright 2007 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an AS IS BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing 

git commit: TAP5-672 (Translation for Vietnamese)

2013-01-21 Thread bobharner
Updated Branches:
  refs/heads/master 09637fa27 - e32f931cb


TAP5-672 (Translation for Vietnamese)

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e32f931c
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e32f931c
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e32f931c

Branch: refs/heads/master
Commit: e32f931cbb193c4b4f70aaf3afa20b1cb4f1c5be
Parents: 09637fa
Author: bharner bobhar...@apache.org
Authored: Mon Jan 21 16:45:41 2013 -0500
Committer: bharner bobhar...@apache.org
Committed: Mon Jan 21 16:45:41 2013 -0500

--
 .../org/apache/tapestry5/core_vi.properties|   53 +++
 1 files changed, 53 insertions(+), 0 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e32f931c/tapestry-core/src/main/resources/org/apache/tapestry5/core_vi.properties
--
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/core_vi.properties 
b/tapestry-core/src/main/resources/org/apache/tapestry5/core_vi.properties
new file mode 100644
index 000..578274d
--- /dev/null
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/core_vi.properties
@@ -0,0 +1,53 @@
+# Copyright 2013 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an AS IS BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# We try to keep the validation messages consistent, with the constraint
+# value (if applicable) as the first parameter, and the field's label as the
+# second parameter. Occasionally we must use specific indexing when that's
+# not the best order.
+
+core-ascending=[Tăng]
+core-cancel-label=hủy bỏ
+core-date-value-not-parseable=Ngày giá trị '%s' không phải là hợp 
lệ
+core-default-banner=Bạn phải sửa lại các lỗi sau trước khi 
tiếp tục.
+core-descending=[Giảm]
+core-dismiss-label=Loại bỏ tất cả
+core-goto-page=Đến trang %d
+core-no-grid-data-to-display=Không có dữ liệu để hiển thị
+core-palette-available-label=chọn được
+core-palette-deselect-label= Bỏ chọn
+core-palette-down-label=chuyển xuống
+core-palette-select-label=Chọn 
+core-palette-selected-label=Đã chọn
+core-palette-up-label=chuyển lên
+core-progressive-display-loading=Đang tải ...
+core-sortable=[Có thể sắp xếp]
+core-submit-label=Tạo/Cập nhật
+integer-format-exception=Bạn phải cung cấp một số nguyên cho %s.
+invalid-email='%s' không là một địa chỉ thư điện tử hợp lệ.
+max-integer=%2$s yêu cầu một giá trị không lớn hơn %1$d.
+maximum-string-length=Bạn có thể cung cấp tối đa %d ký tự cho %s.
+min-integer=%2$s yêu cầu một giá trị không nhỏ hơn %1$d. 
+minimum-string-length=Bạn phải cung cấp ít nhất %d ký tự cho %s.
+number-format-exception=Bạn phải cung cấp một số cho %s.
+regexp=%2$s không phù hợp với mẫu '%1$s'.
+required=Bạn phải cung cấp một giá trị cho %s.
+
+# Messages that exist specifically for the client side:
+
+core-input-not-numeric=giá trị trị không phải là dạng số.
+core-input-not-integer=giá trị trị không phải là một số nguyên.
+
+core-datefield-today=hôm nay
+core-datefield-none=hủy bỏ
\ No newline at end of file



[jira] [Resolved] (TAP5-672) Translation for Vietnamese

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner resolved TAP5-672.
-

   Resolution: Fixed
Fix Version/s: 5.4
   5.3.7

Fixed in rev 4f4b68efa (5.3 branch) and e32f931cb (master)

 Translation for Vietnamese
 --

 Key: TAP5-672
 URL: https://issues.apache.org/jira/browse/TAP5-672
 Project: Tapestry 5
  Issue Type: Improvement
  Components: tapestry-core
Affects Versions: 5.1.0.5, 5.0.18
Reporter: Tam Du
Assignee: Bob Harner
 Fix For: 5.3.7, 5.4

 Attachments: org.zip


 Files for translation of components in Vietnamese

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Assigned] (TAP5-1010) Fix Finnish validation message translation - corrected file attached

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner reassigned TAP5-1010:


Assignee: Bob Harner

 Fix Finnish validation message translation - corrected file attached
 

 Key: TAP5-1010
 URL: https://issues.apache.org/jira/browse/TAP5-1010
 Project: Tapestry 5
  Issue Type: Bug
Affects Versions: 5.1.0.0, 5.1.0.1, 5.1.0.2, 5.1.0.3, 5.1.0.4, 5.1.0.5, 
 5.1.0.6, 5.1.0.7, 5.0.15, 5.0.16, 5.0.17, 5.0.18, 5.0.19
Reporter: Ville Virtanen
Assignee: Bob Harner
  Labels: bulk-close-candidate
 Attachments: ValidationMessages_fi_FI.properties


 The file in the distribution is borked in every release, the file has wrong 
 encodings on some letters. attached is correctly encoded file (UTF-8). Please 
 use this file, do NOT copy the contents to the old file.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[CONF] Apache Tapestry Localization

2013-01-21 Thread confluence







Localization
Page edited by Bob Harner


Comment:
Added Vietnamese to list of supported languages


 Changes (2)
 




...
| bg (Bulgarian)  | fi (Finnish)   | mk (Macedonian)  | sr (Serbian)  | da (Danish) | fr (French)| nl (Dutch)   | sv (Swedish)  
| de (German) | hr (Croatian)  | no (Norwegian)   | zh (Chinese) vi (Vietnamese) 
| el (Greek)  | it (Italian)   | pt (Portuguese)  | zh (Chinese) 
 h3. Providing translations for Tapestry built-in messages 
...


Full Content

Localization


Related Articles


 Page:
 Templating and Markup FAQ





 Page:
 Component Classes





 Page:
 Component Parameters





 Page:
 Localization




 

Localization (aka L10n) is all about getting the right text to the user, in the right language.

Localization support is well integrated into Tapestry. Tapestry allows you to easily separate the text you present to your users from the rest of your application ... pull it out of your Java code and even out of your component templates. You can then translate your messages into other languages and let Tapestry put everything together.

Component Message Catalogs

Each component class may have a component message catalog. A component message catalog is a set of files with the extension ".properties". These property files are the same format used by java.util.ResourceBundle, just lines of key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (that's a language code plus a country code, and you can even go further and add variants ... but its unlikely that you'll ever need to go beyond just language codes in practice).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Component Message Catalog Inheritance

If a component class is a subclass of another component class, then it inherits that base class' message catalog. Its own message catalog extends and overrides the values inherited from the base class.

In this way, you could have a base component class that contained common messages, and extend or override those messages in subclasses (just as you would extend or override the methods of the base component class). This, of course, works for as many levels of inheritance as you care to support.

Application-wide Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Avoid BOMsMake sure that your properties files don't contain byte order marks (BOM), because Java  and thus Tapestry  doesn't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Properties File Charset

Tapestry uses the UTF-8 character set (charset) when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool.

Localized Component Templates

The same lookup mechanism applies to component templates. Tapestry will search for a localized version of each component template and use the closest match. Thus you could have MyPage_fr.html for 

[jira] [Commented] (TAP5-672) Translation for Vietnamese

2013-01-21 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13559185#comment-13559185
 ] 

Hudson commented on TAP5-672:
-

Integrated in tapestry-trunk-freestyle #1012 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1012/])
TAP5-672 (Translation for Vietnamese) (Revision 
e32f931cbb193c4b4f70aaf3afa20b1cb4f1c5be)

 Result = SUCCESS
bobharner : 
Files : 
* tapestry-core/src/main/resources/org/apache/tapestry5/core_vi.properties


 Translation for Vietnamese
 --

 Key: TAP5-672
 URL: https://issues.apache.org/jira/browse/TAP5-672
 Project: Tapestry 5
  Issue Type: Improvement
  Components: tapestry-core
Affects Versions: 5.1.0.5, 5.0.18
Reporter: Tam Du
Assignee: Bob Harner
 Fix For: 5.3.7, 5.4

 Attachments: org.zip


 Files for translation of components in Vietnamese

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


git commit: TAP5-1010 (Fix Finnish validation message translation)

2013-01-21 Thread bobharner
Updated Branches:
  refs/heads/master e32f931cb - 1dd33e198


TAP5-1010 (Fix Finnish validation message translation)

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/1dd33e19
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/1dd33e19
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/1dd33e19

Branch: refs/heads/master
Commit: 1dd33e198134296c13048b07e928eb0d2b9e2a96
Parents: e32f931
Author: bharner bobhar...@apache.org
Authored: Mon Jan 21 18:49:53 2013 -0500
Committer: bharner bobhar...@apache.org
Committed: Mon Jan 21 18:49:53 2013 -0500

--
 .../org/apache/tapestry5/core_fi_FI.properties |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1dd33e19/tapestry-core/src/main/resources/org/apache/tapestry5/core_fi_FI.properties
--
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/core_fi_FI.properties 
b/tapestry-core/src/main/resources/org/apache/tapestry5/core_fi_FI.properties
index d379c52..c6d74e0 100644
--- 
a/tapestry-core/src/main/resources/org/apache/tapestry5/core_fi_FI.properties
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/core_fi_FI.properties
@@ -1,4 +1,4 @@
-# Copyright 2012 The Apache Software Foundation
+# Copyright 2013 The Apache Software Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the License);
 # you may not use this file except in compliance with the License.
@@ -38,3 +38,11 @@ minimum-string-length=Syötä vähintään %d merkkiä %s 
-kenttään.
 number-format-exception=%s -kentŠn syštteen pitŠŠ olla numero.
 regexp=%2$s ei vastaa merkkijonoa '%1$s'.
 required=%s -kentästä puuttu syöte.
+
+# Messages that exist specifically for the client side:
+
+core-input-not-numeric=Arvo ei ole numero.
+core-input-not-integer=Arvo ei ole kokonaisluku.
+
+core-datefield-today=tänään
+core-datefield-none=Poista valinta
\ No newline at end of file



git commit: TAP5-1010 (Fix Finnish validation message translation)

2013-01-21 Thread bobharner
Updated Branches:
  refs/heads/5.3 4f4b68efa - 54b23c461


TAP5-1010 (Fix Finnish validation message translation)

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/54b23c46
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/54b23c46
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/54b23c46

Branch: refs/heads/5.3
Commit: 54b23c461433e4446b3d417ae9750508fcced0fb
Parents: 4f4b68e
Author: bharner bobhar...@apache.org
Authored: Mon Jan 21 18:55:42 2013 -0500
Committer: bharner bobhar...@apache.org
Committed: Mon Jan 21 18:55:42 2013 -0500

--
 .../internal/ValidationMessages_fi_FI.properties   |   20 +++---
 1 files changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/54b23c46/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fi_FI.properties
--
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fi_FI.properties
 
b/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fi_FI.properties
index a282907..396d1d7 100644
--- 
a/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fi_FI.properties
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fi_FI.properties
@@ -1,4 +1,4 @@
-# Copyright 2006, 2007, 2009 The Apache Software Foundation
+# Copyright 2006, 2007, 2008 The Apache Software Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the License);
 # you may not use this file except in compliance with the License.
@@ -16,17 +16,17 @@
 # as the first parameter, and the field's label as the second parameter. 
Occasionally
 # we must use specific indexing when that's not the best order.
 
-required=\%s\ -kent\u00E4st\u00E4 puuttu sy\u00F6te.
-minimum-string-length=Sy\u00F6t\u00E4 v\u00E4hint\u00E4\u00E4n %d merkki\u00E4 
\%s\ -kentt\u00E4\u00E4n.
-maximum-string-length=Voit sy\u00F6tt\u00E4\u00E4 enint\u00E4\u00E4n %d 
merkki\u00E4 \%s\ -kentt\u00E4\u00E4n.
-min-integer=\%2$s\ -kent\u00E4n arvo pit\u00E4\u00E4 olla 
v\u00E4hint\u00E4\u00E4n %1$d. 
-max-integer=\%2$s\ -kent\u00E4n arvo saa olla enint\u00E4\u00E4n %1$d.
+required=\%s\ -kentästä puuttuu syöte.
+minimum-string-length=Syötä vähintään %d merkkiä \%s\ -kenttään.
+maximum-string-length=Voit syöttää enintään %d merkkiä \%s\ 
-kenttään.
+min-integer=\%2$s\ -kentän arvo pitää olla vähintään %1$d. 
+max-integer=\%2$s\ -kentän arvo saa olla enintään %1$d.
 # This is lousy as a default, since the pattern string is meaningless to the 
user. You should always override
 # this.
 regexp=%2$s ei vastaa merkkijonoa '%1$s'.
-invalid-email='%s' ei ole s\u00E4hk\u00F6postiosoite.
+invalid-email='%s' ei ole sähköpostiosoite.
 
-integer-format-exception= \%s\ -kent�n sy�tteen pit�� olla 
kokonaisluku.
-number-format-exception=\%s\ -kent�n sy�tteen pit�� olla numero.
+integer-format-exception= \%s\ -kentän syötteen pitää olla kokonaisluku.
+number-format-exception=\%s\ -kentän syötteen pitää olla numero.
 
-# This is where the translator messages go.
+# This is where the translator messages go.
\ No newline at end of file



[jira] [Resolved] (TAP5-1010) Fix Finnish validation message translation - corrected file attached

2013-01-21 Thread Bob Harner (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Harner resolved TAP5-1010.
--

   Resolution: Fixed
Fix Version/s: 5.4
   5.3.7

Fixed in 54b23c (5.3) and 1dd33e1 (5.4)

 Fix Finnish validation message translation - corrected file attached
 

 Key: TAP5-1010
 URL: https://issues.apache.org/jira/browse/TAP5-1010
 Project: Tapestry 5
  Issue Type: Bug
Affects Versions: 5.1.0.0, 5.1.0.1, 5.1.0.2, 5.1.0.3, 5.1.0.4, 5.1.0.5, 
 5.1.0.6, 5.1.0.7, 5.0.15, 5.0.16, 5.0.17, 5.0.18, 5.0.19
Reporter: Ville Virtanen
Assignee: Bob Harner
  Labels: bulk-close-candidate
 Fix For: 5.3.7, 5.4

 Attachments: ValidationMessages_fi_FI.properties


 The file in the distribution is borked in every release, the file has wrong 
 encodings on some letters. attached is correctly encoded file (UTF-8). Please 
 use this file, do NOT copy the contents to the old file.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (TAP5-1010) Fix Finnish validation message translation - corrected file attached

2013-01-21 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13559247#comment-13559247
 ] 

Hudson commented on TAP5-1010:
--

Integrated in tapestry-trunk-freestyle #1013 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1013/])
TAP5-1010 (Fix Finnish validation message translation) (Revision 
1dd33e198134296c13048b07e928eb0d2b9e2a96)

 Result = SUCCESS
bobharner : 
Files : 
* tapestry-core/src/main/resources/org/apache/tapestry5/core_fi_FI.properties


 Fix Finnish validation message translation - corrected file attached
 

 Key: TAP5-1010
 URL: https://issues.apache.org/jira/browse/TAP5-1010
 Project: Tapestry 5
  Issue Type: Bug
Affects Versions: 5.1.0.0, 5.1.0.1, 5.1.0.2, 5.1.0.3, 5.1.0.4, 5.1.0.5, 
 5.1.0.6, 5.1.0.7, 5.0.15, 5.0.16, 5.0.17, 5.0.18, 5.0.19
Reporter: Ville Virtanen
Assignee: Bob Harner
  Labels: bulk-close-candidate
 Fix For: 5.3.7, 5.4

 Attachments: ValidationMessages_fi_FI.properties


 The file in the distribution is borked in every release, the file has wrong 
 encodings on some letters. attached is correctly encoded file (UTF-8). Please 
 use this file, do NOT copy the contents to the old file.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira