diff -r 4d198a32ac7d -r d4809db37847 plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-63F29096-C1A3-45DB-9E2F-6110562E0237.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-63F29096-C1A3-45DB-9E2F-6110562E0237.html Thu Aug 19 17:48:04 2010 -0700 @@ -0,0 +1,37 @@ + + +Localizing +widget resources

Localizing +widget resources

You might need to localize widget resources, such as images, to +support multiple languages.

+

To localize widget resources

    +
  1. Create localized versions +of the resources for the languages that require localization.

  2. +
  3. Store the files into +the appropriate language +project directories.

  4. +
  5. Provide default resources +in the widget root directory.

    If a specific language does +not require resource localization, the resource files do not need to be included +in the corresponding language project directory. When that language is set +as the device language, the default resources are loaded and used.

  6. +

When loading a localized resource, specify the path to the resource +file as relative to the widget root directory.

+

Example

The following pieces of code provide an +example of widget resource localization for Finnish, English and for a default +case.

    +
  1. Add the Finnish flag for use when system language is Finnish:

    [root]\fi.lproj\
    +   flag.png
  2. +
  3. Add the English flag for use when the system language is English:

    [root]\en.lproj\
    +   flag.png
  4. +
  5. Add the UN flag for use with any other system language:

    [root]\
    +   flag.png
  6. +
  7. In the JavaScript file that implements the logic of the widget, create +the following code to load and show the appropriate flag dynamically. :

    var flag = document.createElement('img');
    +flag.setAttribute('src', 'flag.png');
    +
  8. +
+
\ No newline at end of file