Changes for page Development-Localization and Internationalization
Last modified by Pascal Robert on 2015/05/04 04:24
From version 53.1
edited by Johann Werner
on 2010/12/03 08:10
on 2010/12/03 08:10
Change comment:
There is no comment for this version
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. jw1 +XWiki.probert - Content
-
... ... @@ -138,14 +138,10 @@ 138 138 139 139 ===== Localized EOAttributes ===== 140 140 141 -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: 142 142 143 - To tell EOFthat we want a specific attributelocalizedyou have to adda keyERXLanguages toitsuser info.143 +First add ERXLanguages to your Properties file: 144 144 145 -[[image:ERXLocalizerUserInfo_correct.png||border="1"]] 146 - 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 - 149 149 {{noformat}} 150 150 151 151 ERXLanguages = (en,jp,fr_ca) ... ... @@ -152,12 +152,9 @@ 152 152 153 153 {{/noformat}} 154 154 155 - 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: 156 156 157 -* attribute user info with an array for ERXLanguages 158 -* if type of found user info is not an array then get array from key ERXLanguages from user info of the model 159 -* if user info of the model has no key ERXLanguages look for a property ERXLanguages in your property files 160 -* if no property ERXLanguages is found ignore localization 153 +[[image:ERXLocalizerUserInfo_correct.png||border="1"]] 161 161 162 162 ===== Direct Actions ===== 163 163