View Full Version : How to translate Ext GWT's messages?
cgraf
7 Jul 2008, 10:44 AM
Hi,
I want to translate messages and date picker to another language (portuguese). How can I do that? I noticed that if I change the locale to spanish or french it works fine. I just need the instructions to create a new locale and how can I translate myself...
Thanks in advance,
cgraf
darrellmeyer
8 Jul 2008, 7:11 AM
Take a look at the com.extjs.gxt.ui.client.messages package. This is where the translations are located. Portuguese translations do not exist. I have created 2 new translations:
MyMessages_pt.properties
MyMessages_pt_BR.properties
The files will go out in the next release and I have attached them for your reference.
Thank you Darrell
If you dont mind I did some ajusts to the translation and you can use it if you want. Files are attached.
darrellmeyer
8 Jul 2008, 11:42 AM
I updated the files to use yours.
drenda81
8 Jul 2008, 11:44 AM
Hi,
I've translate in Italian the messages properties. I hope it can be helpfull.
For me of course :)
Thanks!
darrellmeyer
8 Jul 2008, 11:53 AM
Thanks, it has been added.
haattila
9 Jul 2008, 2:06 AM
Darell!
Which languages EXT GWT support?
PS: Very nice work! I will waiting to 1.1 and 1.2 versions.
darrellmeyer
9 Jul 2008, 6:22 PM
Currently, there are translations for:
English
French (fr)
German (de)
Greek (el_GR)
Italian (it)
Portuguese (pt, pt_BR)
Spanish (es)
If anyone needs other translations we can add them.
Hi,
I have translated it into chinese (in utf-8).
Hope it will be useful.
Regards.
Zhou.
Sorry I can not attach a file now. here is the content:
---------------
# UpdateManager
updateManager_indicatorText=<div class="loading-indicator">装载中...</div>
# Grid
grid_ddText={0} 行被选中
# TabPanelItem
tabPanelItem_closeText=关闭这个选项卡
# Field
field_invalidText=该域里的值不合法
# LoadMask
loadMask_msg=装载中...
# MessageBox
messageBox_ok=确认
messageBox_cancel=取消
messageBox_yes=是
messageBox_no=否
messageBox_close=关闭
# DatePicker
datePicker_todayText=今天
datePicker_minText=该日期在最小日期之前
datePicker_maxText=该日期在最大日期之后
datePicker_disabledDaysText=
datePicker_disabledDatesText=
datePicker_nextText=下一个月
datePicker_prevText=前一个月
datePicker_monthYearText=选择一个月份
datePicker_todayTip={0}
datePicker_okText= 确认
datePicker_cancelText=取消
datePicker_startDay=0
# PagingToolBar
pagingToolBar_beforePageText=页
pagingToolBar_afterPageText=之于 {0}
pagingToolBar_firstText=第一页
pagingToolBar_prevText=前一页
pagingToolBar_nextText=下一页
pagingToolBar_lastText=最后一页
pagingToolBar_refreshText=刷新
pagingToolBar_displayMsg=正显示 {2} 中的 {0} - {1}
pagingToolBar_emptyMsg=没有可显示数据
# TextField
textField_minLengthText=该域的最小长度是 {0}
textField_maxLengthText=该域的最大长度是 {0}
textField_blankText=该域是必须的
textField_regexText=
textField_emptyText=
# NumberField
numberField_minText=该域的最小值是 {0}
numberField_maxText=该域的最大值是 {0}
numberField_nanText={0} 不是一个合法数字
# DateField
dateField_disabledDaysText=无效
dateField_disabledDatesText=无效
dateField_minText=该域里的日期必须在 {0} 之后
dateField_maxText=该域里的日期必须在 {0} 之前
dateField_invalidText={0} 是非法日期 - 必须是形式 {1}
#dateField_format=月/日/年
#dateField_altFormats=月/日/年(四位)|月-日-年|月-日-年(四位)|月/日|月-日|月日|月日年|月日年(四位)|日|年(四位)-月-日
dateField_format=m/d/y
dateField_altFormats=m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d
# ComboBox
comboBox_loading=装载中...
# TimeField
timeField_minText=该域里的时间必须和 {0} 相等或在其之后
timeField_maxText=该域里的时间必须和 {0} 相等或在其之前
timeField_invalidText={0} 是非法时间
timeField_format=g:i A
timeField_altFormats=g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H
#GridView
gridView_sortAscText=升序排列
gridView_sortDescText=降序排列
gridView_columnsText=列
#GroupingView
groupingView_emptyGroupText=(无)
groupingView_groupByText=以该域为组
groupingView_showGroupsText=在组中显示
# PropertyColumnModel
propertyColumnModel_nameText=名字
propertyColumnModel_valueText=值
# BorderLayout
borderLayout_splitTip=通过拖拉来重新分配大小.
borderLayout_collapsibleSplitTip=通过拖拉来重新分配大小. 通过双击来隐藏.
# ThemeSelector
themeSelector_blueTheme=蓝色主题
themeSelector_grayTheme=灰色主题
---------------
bjagodzinski
14 Jul 2008, 10:30 PM
I would like also to creat a translation, but where will I find the english equivalents? I've searched in MyMessages.java but without success.
darrellmeyer
15 Jul 2008, 9:52 AM
zhou (http://extjs.com/forum/member.php?u=42130)
Thanks, I have added the info.
bjagodzinski
The translations, including english, are in the same package as MyMessages. They are properties files.
bjagodzinski
15 Jul 2008, 10:29 AM
Ok, now I got confused. I have gxt-1.0 and in the path
\gxt-1.0\src\com\extjs\gxt\ui\client\messages
I have the MyMessages.java file ONLY. What do I need to do to find those properties files?
gslender
15 Jul 2008, 1:17 PM
The src folder seems to be missing these.
Just open the gxt.jar file with winzip, and the properties files are there.
bjagodzinski
15 Jul 2008, 10:57 PM
Thanks a lot, that advice helped :)
So I attach the polish translation, coding UTF-8.
darrellmeyer
16 Jul 2008, 4:47 AM
I have added the Polish translations.
qooyend
22 Jul 2008, 5:36 AM
Hello Darrell,
I have made corrections to the Polish translations file. It had a BOM marker bytes in the begining, and some minor errors in the translation ( min/max length of text fields). Please update the file.
And since this is my first post - congratulations on the fine library!!
darrellmeyer
22 Jul 2008, 7:28 AM
I have updated the file.
smill
11 Aug 2008, 1:34 PM
Sorry, but it's not really clear to me how to make use of these translations, beside accessing GXT.MESSAGES.... manually. I thought there would be a way to switch all GXT strings into a certain language other than english. Is there a way to do that or do I have to set them manually?
Thanks for your help!
BTW: It would be good if this topic will get an example inside the Explorer demo as this is very interesting topic to the community, I guess (like this very good example: http://extjs.com/deploy/dev/examples/locale/multi-lang.html)
gslender
11 Aug 2008, 1:44 PM
smill, you switch locales via this http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Internationalization.html
if the language is included in GXT, then it will use the right locale
simplest way to switch is to add ?locale=en_AU to the end of the url for the page
smill
11 Aug 2008, 1:51 PM
smill, you switch locales via this http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Internationalization.html
if the language is included in GXT, then it will use the right locale
simplest way to switch is to add ?locale=en_AU to the end of the url for the page
gslender, thanks for your quick reply! I also figured out that by passing ?locale=de to my URL, GXT starts talking german. But german is the default locale at my app, so I usualy don't pass any locale argument to the url, just if it should be appear in english. GXT does not realize that, as far as I can see.
Do you know a way?
Thanks again!
gslender
11 Aug 2008, 6:32 PM
smill, its all in the link I provided. You can also place that locale property inside the HTML which will set the default for the GWT application.
smill
12 Aug 2008, 9:31 AM
smill, its all in the link I provided. You can also place that locale property inside the HTML which will set the default for the GWT application.
Thanks for your help, but I don't get it. German is the default language so I don't need to make use of the "?locale=XX" part. Unfortunately GXT is still working in english. When I add the "?locale=de" part to the url I get GXT working in german. My gxt.xml looks like
<module>
<!-- Inherit the GWT stuff -->
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.i18n.I18N" />
<!-- Add GXT support -->
<inherits name="com.extjs.gxt.ui.GXT"/>
<!-- Locale -->
<extend-property name="locale" values="de"/>
<extend-property name="locale" values="en"/>
<!-- Entry point -->
<entry-point class="..."/>
</module>
As I understood the text from your link I need to declare a default locale but I can't find how this works. I also tried to declare the locales within the HTML file but this doesn't work too.
So what can I do?
Thanks again!
gslender
12 Aug 2008, 12:50 PM
as you didn't post your html file I can't say what you did wrong
here is a snippet of a working html file that does work for me
<html>
<head>
<meta name="gwt:property" content="locale=en_AU">
<meta http-equiv="Content-Author" content="Grant Slender" />
<!--include the ext gwt styles-->
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
</head>
smill
12 Aug 2008, 1:20 PM
Ah, now I know what you mean. I've to add the line to my HTML too. I thought I can add locale support by adding it in my gwt.xml OR in the HTML file.
I added the line you mentioned and it worked!
Thanks a lot for your patient help!
gslender
12 Aug 2008, 2:09 PM
the line in the gwt.xml ensures GWT compiles a version of the app with locale support for the locales you defined - otherwise it only compiles a version for the default locale (which I think is en_US)
Branco
18 Nov 2008, 8:15 AM
Here is the translations for pt_PT (and also for just pt).
These were made from the pt_BR provided earlier. They have minor modifications (only the nuances from Portuguese to Brazilian).
Another thing corrected was the fact that the MyMessages_pt.properties was NOT in UTF-8 and therefore all accentuations were being displayed incorrectly.
Both files (pt_PT and pt) are now in UTF-8 and showing words correctly. :D
Please be so kind as to include them in the next release of GXT (so that we don't have to manually insert them in the jar file...)
helgetuser
3 Dec 2008, 11:13 PM
I have translated it into Danish (in utf-8).
I hope it will be useful.
Regards.
Helge
darrellmeyer
5 Dec 2008, 5:26 AM
I have added and updated the translations for da, pt, and pt_PT. Thanks for the files.
Czech translation
cs
UTF-8
widget
27 Dec 2008, 10:27 PM
Russian translation, ru
UTF-8 coding
FireGlow
28 Dec 2008, 4:34 AM
Hm, that doesn't work for me....
I put in ImsClient.gwt.xml:
<extend-property name="locale" values="de"/>
and in my ImsClient.html
<meta name="gwt:property" content="locale=de">
But the shell tells me the following:
ERROR] Could not parse specified locale
com.google.gwt.core.ext.BadPropertyValueException: Property 'locale' cannot be set to unexpected value 'null'
at com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:114)
at com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getPropertyValue(ModuleSpacePropertyOracle.java:59)
at com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:97)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:51)
What do I wrong?
Thanks for answering!
Greetings
Anton
gslender
29 Dec 2008, 3:20 PM
pls post new help questions on a new thread.
Locale is really a GWT issue, so perhaps follow/read this and post a new help thread if you run into any GXT issues. http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/GettingStartedI18n
darrellmeyer
30 Dec 2008, 9:07 AM
Czech and Russian translations have been added. Thanks.
dima_toxsoft
12 Jan 2009, 4:51 AM
Hi every body!
This Russian translation i use in GXT.
lichnost
12 Jan 2009, 1:30 PM
The first Russian translation is better than your, but dates line should be like your and mostly used date separator in Russian is "." not / or -.
dateField_altFormats=d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d
Here are Ukrainian and Russian(a bit modified dateField_format) translations.
gslender
26 Jan 2009, 12:43 PM
thanks - added in SVN
dima_toxsoft
29 Mar 2009, 5:37 PM
Hi everybody!
I found there is no section for DualListField in MyMessages_ru.properties.
Edited file attached.
Sorry for my English
monk3y
30 Mar 2009, 12:44 AM
Hi Everyone
Would it be possible to add accessor methods to set the labels and such in these widgets(Datepicker and the Table context menu). The reason that i ask this is because we have our clients do their own translations and we have a mechanism where they create their own properties file.
Comments?
monk3y
13 Apr 2009, 11:30 PM
bump!
Rvanlaak
20 Apr 2009, 12:47 AM
Hi,
I've translated the XMessages properties file to the dutch language. Think it might be usefull for you guys. Dutch is mij primary language, but i've used Google Translate as a basis. The weird thing was that Google translated it very well, funny to see...
The translation is for 95% acurate, because i wanted to keep some translations at the same text width... :)
Rvanlaak
20 Apr 2009, 12:48 AM
Hi,
I've translated the XMessages properties file to the dutch language. Think it might be usefull for you guys. Dutch is mij primary language, but i've used Google Translate as a basis. The weird thing was that Google translated it very well, funny to see...
The translation is for 95% acurate, because i wanted to keep some translations at the same text width... :)
Oh, probably good to know: I've did the translation for the GXT 2.0 M1 src... \:D/
eelco
22 Apr 2009, 4:25 AM
Hi,
I've translated the XMessages properties file to the dutch language. Think it might be usefull for you guys. Dutch is mij primary language, but i've used Google Translate as a basis. The weird thing was that Google translated it very well, funny to see...
The translation is for 95% acurate, because i wanted to keep some translations at the same text width... :)
How can I use this file (other than repacking the original ext gwt jar file)? Is there a way to include it somehow in my application?
Rvanlaak
25 May 2009, 7:08 AM
I also still wonder how to implement the language file to get a multilang app.
Well, you need live read and lern GWT Internationalization & Accessibility (http://code.google.com/webtoolkit/doc/1.6/DevGuideI18nAndA11y.html)
knutjd
16 Jun 2009, 12:59 AM
Here's a Norwegian translation. 14310
vsevik
2 Feb 2010, 12:25 PM
I've added messages for new features missing in russian translations.
(htmleditor, roweditor, file upload etc.)
protocyber
19 Feb 2010, 2:54 AM
I've created gxt translation (properties file) in my language (indonesian).
So now, how should i include this in my project? Should i modify the gxt.jar file and place it in com.extjs.gxt.ui.client.messages package? i hope not.
I've read gwt internationalization docs but i got that it's only used if we want to translate the strings in my own code OR translate to languages that have been existed in com.extjs.gxt.ui.client.messages package.
briefly: what should i do to translate all the GXT UI to Indonesian language?
notes:
- I will upload the translation file if it's required -- does it mean that i should wait for the next gxt release which include Indonesian language?
- For now i dont' need multi-language
- I'm new in java, I was php programmer, so it would be very nice if you give me some step-by-step explanation.
Thank you very much for the answers.
vsevik
19 Feb 2010, 3:22 AM
The common way as I understand it is following:
1) You modify your own gxt.jar
2) You put your translation as an attachment in this thread
3) You wait until they include your translation in official version :)
Don't be afraid of modifying gxt.jar, but don't forget to make a backup copy of your current version in case something goes wrong.
protocyber
19 Feb 2010, 3:34 AM
Thank you vsevik. So the fastest way is that i must modify the gxt.jar. would you mind giving me the steps to do it? i'm really2 new in java and i'm affraid of doing this.
Thank you.
vsevik
19 Feb 2010, 3:37 AM
put your tanslation of gxt ui in XMessages_<indonesian suffix>.properties file.
open gxt.jar as a zip archive and add this file to the folder
\com\extjs\gxt\ui\client\messages\
and that's it.
Arno.Nyhm
19 Feb 2010, 10:36 AM
i think gxt should give us a better way to make more or own language files for the gxt
protocyber
19 Feb 2010, 11:10 PM
Here is Indonesian translation file: http://www.extjs.com/forum/images/attach/zip.gif 18835
Thank you vsevik. I've add this translation in my gxt.jar file using winrar.
For another newbie, here are the steps for translating gxt to your language:
Create the messages file. You can translate from english language in com/extjs/gxt/ui/client/messages/XMessages.properties
Save your file as "XMessages_<country code>.properties" e.g XMessages_id.properties
Open gxt.jar with winzip or winrar or another program and goto "com/extjs/gxt/ui/client/messages" folder and add your translation file there
That's it. Your translation is already included in gxt.jar file. -- In my case, I need to reconfigure my build path (I'm using eclipse and it doesn't automatically detect the new translation file). I remove the gxt.jar from the build path and re-include it in my project
Now, add the locale to your gwt module xml (YourProject.gwt.xml) file like this:
<module>
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.google.gwt.i18n.I18N"/>
<!-- Below is the line. Replace the "id" string to your country code (same as your XMessages_<country code>) file -->
<extend-property name="locale" values="id"/>
</module>
Your translation (locale) is already included in your gwt module. Now you must specify your locale to be loaded by the client side script (html). Add this line to your html file like this:
<html>
<head>
<!-- Below is the line. Replace the "id" string to your country code (same as your XMessages_<country code>) file -->
<meta name="gwt:property" content="locale=id">
</head>
<body>
<!-- Load the GWT compiled module code -->
<script src="com.google.gwt.examples.i18n.ColorNameLookupExample.nocache.js " />
</body>
</html>
You can also load the locale by setting from query string like:
http://www.example.org/myapp.html?locale=id
Refresh your browser or recompile your project. Done. Your gxt is now in your language.
Now...there is still another question I want to ask.
How to set my language as the default locale so i don't have to specify it in each client side (html) page?
In messages files, I didn't see the month strings used in datefield. How do we translate the datefield?
Thank you.
zhou
21 Feb 2010, 12:26 AM
please see the attachment.
vsevik
21 Feb 2010, 3:59 PM
How to set my language as the default locale so i don't have to specify it in each client side (html) page?
Try that, there are several advices there:
http://stackoverflow.com/questions/2109762/how-to-change-default-locale-in-gwt
In messages files, I didn't see the month strings used in datefield. How do we translate the datefield?
I guess they are taken from GWT date formatter, aren't they?
In this case they should be translated without any explicit changes in gxt messages.
My russian version has translated days of the week.
So I see 3 possibilities here:
1. They already look fine in your application
2. Gwt didn't make a translation of days of the week in indonesian
2. You are using wrong indonesian language suffix :)
Actually that seem weird to me especially because of:
Indonesia is the fourth most populous nation in the world. Of its large population the number of people who fluently speak Indonesian is fast approaching 100%, thus making Indonesian one of the most widely spoken languages in the world.
protocyber
22 Feb 2010, 6:43 PM
OMG...yes the datefield is already in Indonesian. sorry, it's my foolish. i didn't check this first. It's because I adopted the translation from ExtJS which already has Indonesian locale. I found months strings there, so I wondered why they didn't exist in gxt messages.
Thank you.
lhanusiak
19 Jul 2010, 11:03 PM
Attached translation contains missing rowEditor properties such as rowEditor_dirtyText and rowEditor_tipTitleText.
tm-pbpolsoft
1 Sep 2010, 7:55 AM
Did polish translation with missing row editor's properties included in last release? I can't find it in commit log and neither in changelog. Please update it as soon as it is possible.
TM
gaudeo
22 Nov 2010, 5:18 AM
Hello, i put slovak translation here and czech translation update (there were some errors).
Gaudeo
gaudeo
22 Nov 2010, 5:38 AM
Sorry, there is again the updated version of czech translation. The previous i sent was the original one.
Gaudeo
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.