Wiki source code of WOProject-Localization

Last modified by Andrew Lindesay on 2006/10/24 16:36

Show last authors
1 = Localized Resources Handling =
2
3 This has been transcribed by [[Andrew Lindesay>>url:http://www.lindesay.co.nz||shape="rect"]] from the old WOProject site.
4
5 WOApplication and WOFramework tasks must deal with resources. Resources of the applications that have a multilingual audience require localization.
6
7 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.
8
9 In WOProject tasks resources handling is normally done via nested {{code language="none"}}<resources>{{/code}} or {{code language="none"}}<wsresources>{{/code}} elements that specify location of the resources. WOProject adds special handling of resources that are located in directories with extension {{code language="none"}}.lproj{{/code}}. For instance:
10
11 {{noformat}}
12
13 <woframework name="MyFramework" destDir="${dist}/Frameworks">
14 <-- No localization needed -->
15 <resources dir="src/resources">
16 <include name="MyResources/*.wo/**"/>
17 </resources>
18
19 <-- Localization required, since starts with *.lproj -->
20 <wsresources dir="src/frameworks/WSResources">
21 <include name="*.lproj/Images/**"/>
22 </wsresources>
23
24 <-- No localization needed, since path starts with "Images" -->
25 <-- even though it contains *.lproj in the middle -->
26 <wsresources dir="src/frameworks/WSResources">
27 <include name="Images/*.lproj/**"/>
28 </wsresources>
29 </woframework>
30
31 {{/noformat}}
32
33 Here is how WOProject will handle resource copying:
34
35 |=(((
36 WOComponents
37 )))|=(((
38
39 )))
40 |(((
41 Not Localized
42 )))|(((
43 Copied to the top level resources directory ignoring any subdirectories. For instance {{code language="none"}}MyComponents/reusable/Comp.wo{{/code}} will be copied to {{code language="none"}}Resources/Comp.wo{{/code}}.
44 )))
45 |(((
46 Localized
47 )))|(((
48 Copied to the top level resources language-specific directory ignoring any subdirectories under {{code language="none"}}*.lproj{{/code}}. For instance {{code language="none"}}English.lproj/MyComponents/reusable/Comp.wo{{/code}} will be copied to {{code language="none"}}Resources/English.lproj/Comp.wo{{/code}}.
49 )))
50 |(((
51 Localized, but located in Nonlocalized.lproj
52 )))|(((
53 Copied to the top level resources directory ignoring any subdirectories. For instance {{code language="none"}}Nonlocalized.lproj/MyComponents/reusable/Comp.wo{{/code}} will be copied to {{code language="none"}}Resources/Comp.wo{{/code}}.
54 )))
55
56 |=(((
57 Other resources
58 )))|=(((
59
60 )))
61 |(((
62 Not Localized
63 )))|(((
64 Copied to the resources directory preserving subdirectories structure. For instance {{code language="none"}}Other/model.eomodeld{{/code}} will be copied to {{code language="none"}}Resources/Other/model.eomodeld{{/code}}.
65 )))
66 |(((
67 Localized
68 )))|(((
69 Copied to the top level resources language-specific directory preserving subdirectories structure. For instance {{code language="none"}}English.lproj/Images/toolbar/i1.gif{{/code}} will be copied to {{code language="none"}}WebServerResources/English.lproj/Images/toolbar/i1.gif{{/code}}.
70 )))
71 |(((
72 Localized, but located in Nonlocalized.lproj
73 )))|(((
74 Copied to the top level resources stripping "Nonlocalized.lproj", but preserving lower level subdirectories. For instance {{code language="none"}}Nonlocalized.lproj/props/props.plist{{/code}} will be copied to {{code language="none"}}Resources/props/props.plist{{/code}}.
75 )))