Localizing resource bundles

About this task

To localize the resource bundles:

Procedure

  1. Copy the <INSTALL_DIR>/resources/ycpapibundle.properties file and save it as <INSTALL_DIR>/resources/ycpapibundle_<language>_<country>.properties.
  2. Copy the <INSTALL_DIR>/resources/yscpapibundle.properties file and save it as <INSTALL_DIR>/resources/yscpapibundle_<language>_<country>.properties.
  3. Each resource bundle contains a <key>=<value> pair, where key is the resource key and value is the literal displayed for the corresponding locale. Replace <value> with the translated value.
    • When localizing menus in the Applications Manager, by default, the accelerator key is the first character in a menu item. To specify any other character as the accelerator key, insert an ampersand (&) just before that character.
    • When localizing the console UI, be aware that changing the height or width of the text in the application may affect the layout of the screens. It may be necessary to customize certain screens to achieve optimal layout after the other localization steps are complete. For example, if the resource bundle contains translated literals that are lengthy, you may have to increase the width of the screen in order to accommodate the larger size of the translated literal.
    • Some of the literals that have to be translated in the resource bundles contain data place holders. These data place holders indicate that the literal is displayed with one or more data values within the literal. For example, when the application displays the error message "Priority should be greater than X", where X could be any number. Because the location of "X" within the literal can be different for different languages, the resource bundle uses a place holder that can be placed anywhere in the literal during translation. The resource bundle entry looks like this:
         PRIORITY_ERROR_MESSAGE=Priority should be greater than {0}

      Notice how the "{0}" place holder indicates where the dynamic data value appears in the literal. This "{0}" can be placed anywhere in the literal, for example, the following two options are valid possibilities:

         PRIORITY_ERROR_MESSAGE=A number greater than {0} should be entered

      or

         PRIORITY_ERROR_MESSAGE={0}: Priority entered should be greater than this

      Placeholders give you the flexibility to translate the literal in any way the corresponding language dictates. Note that multiple place holders may appear in the literal as well, for example, {0}, {1}, {2}, and so on. Each place holder must exist somewhere in the corresponding translated literal.

    • When using literals that contain data place holders, you cannot use single quotation marks. If a single quotation mark is used in conjunction with a place holder, the single quotation mark is not displayed and the place holder is not replaced with its replacement value. In order to avoid this situation, enter two single quotes wherever a single quote is required. For example, the following statement is invalid:
         PRIORITY_ERROR_MESSAGE=The primary organization's name is {0}

      However, the following statement is valid:

         PRIORITY_ERROR_MESSAGE=The primary organization''s name is {0}
    • Files should be returned in native format with UTF-8 encoding.
    • Properties should be returned in escaped Unicode format with UTF-8 encoding.
  4. The default font used is Tahoma. Therefore if you want to display or type Unicode characters, you should localize the theme. This is done by changing the font to Unicode in the theme-specific XML files.
  5. Save the modified file. If the file is in UTF-8 format, convert it to ASCII by running the native2ascii command as follows:
       native2ascii -encoding UTF-8 <source file> <target file>
       

    The file should be returned in the following format:

       <filename>_<2 letter code for language as given by ISO 639>_<2 letter code 
    for territory as given by ISO 3166>.<file extension>

    For example, ycpapibundle.properties should be returned as ycpapibundle_fr_FR.properties and yscpapibundle.properties should be returned as yscpapibundle_fr_FR.properties.

  6. If you are customizing Sterling Selling and Fulfillment Foundation, save the extended resource bundles as <INSTALL_DIR>/resources/extn/extnbundle_<language>_<country>.properties.

    For example, ycpapibundle.properties should be saved as ycpapibundle_fr_FR.properties and yscpapibundle.properties should be saved as yscpapibundle_fr_FR.properties.

  7. For extended tag attributes, add the following bundle entry in extnbundle.properties for each extended tag attribute:
       Item_Tag_<TagName>=<Tag Name>
  8. Create the resource jar using the ./deployer.sh -t resourcejar.
  9. If you are using Oracle WebLogic or IBM® WebSphere®, rebuild the EAR.
    Note: The Custom_Code_Prefix and Custom_Code_Postfix properties in the ycpapibundles.properties file are used to prefix or append identifying literals or extensions to your newly created custom transaction IDs, supply types, demand types, or document types. When you create a new transaction ID, supply type, demand type, or document type, the value specified for these properties is prefixed or appended to each of these types of literals when displayed in the user interface. The default value for the Custom_Code_Prefix is "" (blank) and the Custom_Code_Postfix is ".ex". You can change this value if it does not suit your requirements.