Changes for page Development-Localization and Internationalization
Last modified by Pascal Robert on 2015/05/04 04:24
From version 60.1
edited by Johan Henselmans
on 2015/05/04 04:24
on 2015/05/04 04:24
Change comment:
Migrated to Confluence 5.3
To version 58.1
edited by Pascal Robert
on 2012/02/11 08:39
on 2012/02/11 08:39
Change comment:
There is no comment for this version
Summary
-
Page properties (4 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 4 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,0 @@ 1 -Localization - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. johanhenselmans1 +XWiki.probert - Tags
-
... ... @@ -1,1 +1,0 @@ 1 -internationalization|localization|favourite - Content
-
... ... @@ -1,10 +1,11 @@ 1 1 == Unicode == 2 2 3 -See also: [[doc:UTF-8 Encoding Tips]] 3 +See also: [[UTF-8 Encoding Tips>>doc:UTF-8 Encoding Tips]] 4 4 5 5 To Enable Unicode for your WO app, add the following to your application constructor: 6 6 7 7 {{code}} 8 + 8 8 WOMessage.setDefaultEncoding("UTF8"); 9 9 10 10 {{/code}} ... ... @@ -14,6 +14,7 @@ 14 14 Then you just need to tell the browser. Make all your .wo pages include this meta tag in their HTML: 15 15 16 16 {{code 0="xml"}} 18 + 17 17 <html> 18 18 <head> 19 19 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ... ... @@ -26,6 +26,7 @@ 26 26 Great tip - here is a simple method call you can stick in your Application object to automatically achieve the results outlined above: 27 27 28 28 {{code}} 31 + 29 29 private boolean enableUTFEncoding = false; 30 30 31 31 public void enableUTFEncoding() { ... ... @@ -50,6 +50,7 @@ 50 50 To make sure that UTF-8 is supported in multipart forms as well, you have to add the following code to your Application object: 51 51 52 52 {{code}} 56 + 53 53 public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, 54 54 NSDictionary someHeaders, NSData aContent, NSDictionary someInfo) { 55 55 WORequest newRequest = super.createRequest(aMethod, aURL, anHTTPVersion, ... ... @@ -79,6 +79,7 @@ 79 79 Let's say your project will be available in English and Japanese. You'll want to include the following in your Project->Resources->Properties file: 80 80 81 81 {{noformat}} 86 + 82 82 # Localization 83 83 er.extensions.ERXLocalizer.defaultLanguage=English 84 84 er.extensions.ERXLocalizer.fileNamesToWatch=("Localizable.strings","ValidationTemplate.strings") ... ... @@ -93,6 +93,7 @@ 93 93 Note that if you need to customize the locale for a language, such as Canadian French, you can do so with this property: 94 94 95 95 {{noformat}} 101 + 96 96 er.extensions.ERXLocalizer.French_CA.locale = fr_ca 97 97 98 98 {{/noformat}} ... ... @@ -101,6 +101,7 @@ 101 101 (% style="color: rgb(51,51,51);" %)In the above case after adding canadian french these would change in: 102 102 103 103 {{noformat}} 110 + 104 104 er.extensions.ERXLocalizer.availableLanguages=(English,Japanese,French_CA) 105 105 106 106 {{/noformat}} ... ... @@ -108,6 +108,7 @@ 108 108 (% style="color: rgb(51,51,51);" %)Localized formatters use this property: 109 109 110 110 {{noformat}} 118 + 111 111 er.extensions.ERXLocalizer.useLocalizedFormatters=false 112 112 113 113 {{/noformat}} ... ... @@ -147,6 +147,7 @@ 147 147 In this example we set the type to //Array// and add an item for each needed language setting its value to the language code. This must be done for each attribute in our model we want to localize. If you have many localized attributes that have the very same list of languages and you will likely be changing that list in the future you can define your language list either for a whole model or for all models instead. The first way to specify a per model language list is to put an ERXLanguages key into the user info of the model. For a global setting put that key into your property file: 148 148 149 149 {{noformat}} 158 + 150 150 ERXLanguages = (en,jp,fr_ca) 151 151 152 152 {{/noformat}} ... ... @@ -163,6 +163,7 @@ 163 163 If you are defaulting to direct actions, you may not have a session. If you do not have a session, the server will return the default language specified in the Properties mentioned above. If you're using direct actions and you don't like that behavior, you can stick this in your direct action class: 164 164 165 165 {{code}} 175 + 166 166 @Override 167 167 public WOActionResults performActionNamed(String actionName) { 168 168 if(!context().hasSession()) { ... ... @@ -189,6 +189,6 @@ 189 189 190 190 ===== Localization presentation from WOWODC West 2009 ===== 191 191 192 -Guido Neitzer did a localization presentation at WOWODC West 2009 that give a good overview of how to localize your apps. The presentation is available [[here>>url:http://www.wocommunity.org/podcasts/wowodc/west09/WOWODC09 W-Localization.mov||shape="rect"]].202 +Guido Neitzer did a localization presentation at WOWODC West 2009 that give a good overview of how to localize your apps. The presentation is available [[here>>url:http://www.wocommunity.org/podcasts/wowodc/west09/WOWODCW09-Localization.mov||shape="rect"]]. 193 193 194 194
- ERXLocalizerEclipseLayout.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiGuest - Size
-
... ... @@ -1,1 +1,0 @@ 1 -15.8 KB - Content
- ERXLocalizerUserInfo.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiGuest - Size
-
... ... @@ -1,1 +1,0 @@ 1 -74.0 KB - Content
- ERXLocalizerUserInfo_correct.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiGuest - Size
-
... ... @@ -1,1 +1,0 @@ 1 -66.3 KB - Content
- LocalizerTest.zip
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiGuest - Size
-
... ... @@ -1,1 +1,0 @@ 1 -53.0 KB - Content