To edit or add content to this Wiki, you can simply create a new account at http://wocommunity.org/account.

Localized Resources Handling

This has been transcribed by Andrew Lindesay from the old WOProject site.

WOApplication and WOFramework tasks must deal with resources. Resources of the applications that have a multilingual audience require localization.

In a deployed WebObjects application or framework resources are separated into "Resources" and "WebServerResources" directories. For instance WOComponents are "Resources", images are "WebServerResources", etc. Both "Resources" and "WebServerResources" require special handling of localization issues.

In WOProject tasks resources handling is normally done via nested <resources> or <wsresources> elements that specify location of the resources. WOProject adds special handling of resources that are located in directories with extension .lproj. For instance:

<woframework name="MyFramework" destDir="${dist}/Frameworks">
   <-- No localization needed -->
   <resources dir="src/resources">
       <include name="MyResources/*.wo/**"/>
   </resources>
   
   <-- Localization required, since starts with *.lproj -->
   <wsresources dir="src/frameworks/WSResources">
       <include name="*.lproj/Images/**"/>
   </wsresources>
   
   <-- No localization needed, since path starts with "Images" -->
   <-- even though it contains *.lproj in the middle           -->
   <wsresources dir="src/frameworks/WSResources">
       <include name="Images/*.lproj/**"/>
   </wsresources>
</woframework>

Here is how WOProject will handle resource copying:

WOComponents

 

Not Localized

Copied to the top level resources directory ignoring any subdirectories. For instance MyComponents/reusable/Comp.wo will be copied to Resources/Comp.wo.

Localized

Copied to the top level resources language-specific directory ignoring any subdirectories under *.lproj. For instance English.lproj/MyComponents/reusable/Comp.wo will be copied to Resources/English.lproj/Comp.wo.

Localized, but located in Nonlocalized.lproj

Copied to the top level resources directory ignoring any subdirectories. For instance Nonlocalized.lproj/MyComponents/reusable/Comp.wo will be copied to Resources/Comp.wo.

Other resources

 

Not Localized

Copied to the resources directory preserving subdirectories structure. For instance Other/model.eomodeld will be copied to Resources/Other/model.eomodeld.

Localized

Copied to the top level resources language-specific directory preserving subdirectories structure. For instance English.lproj/Images/toolbar/i1.gif will be copied to WebServerResources/English.lproj/Images/toolbar/i1.gif.

Localized, but located in Nonlocalized.lproj

Copied to the top level resources stripping "Nonlocalized.lproj", but preserving lower level subdirectories. For instance Nonlocalized.lproj/props/props.plist will be copied to Resources/props/props.plist.

  • No labels