Tutorials > Management Center > Add a new locale for Management Center

< Previous | Next >


Creating files for the new locale in Management Center

In this step, you add properties files and resource bundle files for the new locale. WebSphere Commerce defines static text such as prompt text and messages in properties file. To add a new language to the store side, refer to the tutorial: Create a multicultural store.

Management Center properties file are located in WCDE_INSTALL\workspace\LOBTools\src\com\ibm\commerce directory. Each locale owns its own set of properties files. New properties files need to be created to reflect the language description for each new locale you created for the customization task. All the files with the locale name "en_US" embedded in the file name will be copied and renamed to include the "en_GB" locale name instead.

In steps 2-11 you create a new message key and value in a properties file. This information is used to display the new language in the Management Center Languages list.

Other WebSphere Commerce tools such as WebSphere Commerce Accelerator also uses properties files to display the content. You can use a similar approach to add en_GB to those tools as well.


Procedure

  1. Create properties file for en_GB locale. Locale specific messages for Management Center are stored in properties files. These properties files are grouped by the Management Center tool and each tool has a separate directory for its properties files. The properties files can be found in WCDE_INSTALL\workspace\LOBTools\src\com\ibm\commerce\tool\client\lobtools\properties directory.

    1. Navigate through the tool subdirectory until the properties file level.

    2. Copy all the files in the properties file level that has "en_US" embedded in the file name. In each copied file, replace "en_US" with "en_GB" in the file name.

    3. Within each file, replace all occurrences of = with prefix =GB_.

      For example, navigate to the WCDE_INSTALL\workspace\LOBTools\src\com\ibm\commerce\catalog\client\lobtools\properties directory. Copy the files CatalogLOB_en_US.properties and CatalogLOBErrorMessages_en_US.properties. Rename both files to be CatalogLOB_en_GB.properties and CatalogLOBErrorMessages_en_GB.properties respectively. Replace all occurrences of "=" with "=GB_" in both files.

      For the purpose of this tutorial, the "GB_" prefix is used so that when you access Management Center you can validate the changes.

    4. Repeat steps a-c for each tool. Where:

      tool

      attachment, catalog, foundations, marketing, promotions

  2. Create a new package for the extension properties files.

    1. Start WebSphere Commerce Developer.

    2. Expand LOBTools > JavaResources > src.

    3. Right-click the src folder, click New > Package.

    4. In the New Java Package window, name the new package com.mycompany.commerce.client.lobtools.properties then click Finish.

  3. In the new properties package, create a new file.

    1. Right-click com.mycompany.commerce.client.lobtools.properties package, click New > Other.

    2. In the Select a wizard window, click the Simple folder; then click File.

    3. Name the new file ShellLOB.properties.

    4. Click Finish. The file opens in the default XML editor.

  4. Define new properties for en_GB locale. In the ShellLOB.properties file, add the following code:

    languageOptionDisplayText_en_GB=United Kingdom English
    

  5. Save and close the file.

  6. Create a new file ShellLOB_en_GB.properties.

    1. Right-click com.mycompany.commerce.client.lobtools.properties package, click New > Other.

    2. In the Select a wizard window, click the Simple folder; then click File.

    3. Name the new file ShellLOB_en_GB.properties.

    4. Click Finish. The file opens in the default XML editor.

  7. Define the new properties for en_GB locale. In the ShellLOB_en_GB.properties file, add the following code:

    languageOptionDisplayText_en_GB=United Kingdom English
    

  8. Save and close the file.

  9. Register the new properties in the resource bundle.

    1. Expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > shell.

    2. Right-click the shell folder; then click New > Other.

    3. Name the new file shellResourceBundle_ext.lzx

    4. Click Finish. The file opens in the default XML editor.

    5. Define the new resource bundle class and create an instance of it. In the shellResourceBundle_ext.lzx file, add the following code:

      <library> 
      <class name="wcfShellResourceBundleExt" extends="wcfResourceBundle" baseName="com.mycompany.commerce.client.lobtools.properties.ShellLOB"> 
      <wcfResourceBundleKey name="languageOptionDisplayText_en_GB" /> 
      </class> 
      <wcfShellResourceBundleExt /> 
      </library>
      

      The wcfResourceBundle class represents a resource bundle object within the OpenLaszlo and maps the corresponding content in the properties files.

    6. Save and close the file.

  10. Register the shellResourceBundle_ext.lzx file in the shell extensions library:

    1. Open the LOBTools\WebContent\WEB-INF\src\lzx\commerce\shell\ShellExtensionsLibrary.lzx file.

    2. Add the following code in the <library> tag.

      <include href="./shellResourceBundle_ext.lzx" /> 
      

    3. Save and close the file.

  11. Register the en_GB locale in the Preferences dialog.

    1. Open the LOBTools\WebContent\WEB-INF\src\lzx\commerce\shell\UserPreferencePanel.lzx file.

    2. Search for <class name="wcfLanguageList". Add the following code before the </class> tag.

      <wcfPreferenceValue textKey="${shellResourceBundleExt.languageOptionDisplayText_en_GB}" value="en_GB" /> 
      

    3. Save and close the file.

In the next step, you verify the customization.

< Previous | Next >


+

Search Tips   |   Advanced Search