Changes for page Development-Localization and Internationalization
Last modified by Pascal Robert on 2015/05/04 04:24
From version 56.1
edited by David Holt
on 2011/06/10 19:20
on 2011/06/10 19:20
Change comment:
Moved latest addition to the "properties" section
To version 51.1
edited by Pascal Robert
on 2010/09/19 11:17
on 2010/09/19 11:17
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. dholt1 +XWiki.probert - Content
-
... ... @@ -64,13 +64,13 @@ 64 64 65 65 {{/code}} 66 66 67 -To make WOFileUpload components working I also had to add the launch parameter WOUseLegacyMultipartParser true to my application. This launch parameter forces the parsing of all form values, the first time WORequest.formValues is called. See the [[apple developer documentation>>http:// webobjects.mdimension.com/javadoc/WebObjects/5.4.2/com/webobjects/appserver/WORequest.html]] for additional information. Without WOUseLegacyMultipartParser true I had serious problems in my applications using a WOFileUpload component because the bindings //data// and //filePath// have been emptied after a form POST.67 +To make WOFileUpload components working I also had to add the launch parameter WOUseLegacyMultipartParser true to my application. This launch parameter forces the parsing of all form values, the first time WORequest.formValues is called. See the [[apple developer documentation>>http://developer.apple.com/documentation/WebObjects/Reference/api/com/webobjects/appserver/WORequest.html]] for additional information. Without WOUseLegacyMultipartParser true I had serious problems in my applications using a WOFileUpload component because the bindings //data// and //filePath// have been emptied after a form POST. 68 68 69 69 With Jesse's code and this extension, you will be able to handle UTF-8 character data correctly in your WO application. 70 70 71 71 If you use localized strings in your UTF-8 application you may also check out Project Wonder's [[ERXLocalizer>>WOnder-ERXLocalizer]] class. 72 72 73 -=== Project Localization tips === 73 +=== Project Localization tips [[~~ramsey]] === 74 74 75 75 The following are some tips and suggestions for localizing a project in WOLips using Project Wonder. 76 76 ... ... @@ -103,13 +103,8 @@ 103 103 104 104 {{/noformat}} 105 105 106 -{{color value="#333333"}} 107 -The other changes are then in the er.extensions.ERXLocalizer.availableLanguages and ERXLanguages: 108 -{{/color}} 109 - 110 -{{color value="#333333"}} 106 +The other changes are then in the er.extensions.ERXLocalizer.availableLanguages and ERXLanguages: 111 111 In the above case after adding canadian french these would change in: 112 -{{/color}} 113 113 114 114 {{noformat}} 115 115 ... ... @@ -117,16 +117,6 @@ 117 117 118 118 {{/noformat}} 119 119 120 -{{color value="#333333"}} 121 -Localized formatters use this property: 122 -{{/color}} 123 - 124 -{{noformat}} 125 - 126 -er.extensions.ERXLocalizer.useLocalizedFormatters=false 127 - 128 -{{/noformat}} 129 - 130 130 ===== Localized strings and components ===== 131 131 132 132 For each language available, you will need a corresponding Localizable.strings file. This file should be located in Projects->Resources->"Lang".lproj directory. In these directories, you'll store localized resources such as Localizable.strings files and localized components. So, continuing with the above example, you should create two new Localizable.strings files in the following places in your project directory: ... ... @@ -153,14 +153,10 @@ 153 153 154 154 ===== Localized EOAttributes ===== 155 155 156 -In Wonder, it is also possible to localize attributes. Let's say wehaveanentity//Blog// withan attribute//content// thatwe want tolocalize. This will berealized by not creating a column //content//in the database but a column for each specified language we wanti.e. //content//en//, //content//fr//, ...141 +In Wonder, it is also possible to localize attributes. There are two requisites: 157 157 158 - To tell EOFthat we want a specific attributelocalizedyou have to adda keyERXLanguages toitsuser info.143 +First add ERXLanguages to your Properties file: 159 159 160 -[[image:ERXLocalizerUserInfo_correct.png||border="1"]] 161 - 162 -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: 163 - 164 164 {{noformat}} 165 165 166 166 ERXLanguages = (en,jp,fr_ca) ... ... @@ -167,12 +167,9 @@ 167 167 168 168 {{/noformat}} 169 169 170 - Allattributesthat shoulduse thoseglobalsettings must have akey//ERXLanguages//intheiruserinfowith a type **different** to //Array//.Its value can be anythingas onlythepresence of the keyis ofmportance.The order thathe languages are applied to an attributeis:151 +Then, for the attribute you'd like to localize, add the ERXLanguages key to the UserInfo for that specific attribute: 171 171 172 -* attribute user info with an array for ERXLanguages 173 -* if type of found user info is not an array then get array from key ERXLanguages from user info of the model 174 -* if user info of the model has no key ERXLanguages look for a property ERXLanguages in your property files 175 -* if no property ERXLanguages is found ignore localization 153 +[[image:ERXLocalizerUserInfo_correct.png||border="1"]] 176 176 177 177 ===== Direct Actions ===== 178 178 ... ... @@ -180,7 +180,7 @@ 180 180 181 181 {{code}} 182 182 183 -@Override 161 + @Override 184 184 public WOActionResults performActionNamed(String actionName) { 185 185 if(!context().hasSession()) { 186 186 ERXLocalizer localizer = ... ... @@ -190,6 +190,7 @@ 190 190 return super.performActionNamed(actionName); 191 191 } 192 192 171 + 193 193 {{/code}} 194 194 195 195 That should give the user their browser's default language setting instead of your server's default language setting until a session is created. ... ... @@ -207,7 +207,3 @@ 207 207 ===== Localization presentation from WOWODC West 2009 ===== 208 208 209 209 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>>http://www.wocommunity.org/podcasts/wowodc/west09/WOWODCW09-Localization.mov]]. 210 - 211 -=== === 212 - 213 -