Portlet Factory, Version 6.1.2


 

Localizing portlet titles

Resource bundles are available to facilitate displaying portlet titles in different local languages. After you add a Portlet Adapter builder to a model, and rebuild the portlet war, the necessary resources are generated and available for you to establish localization of portlet titles.

  1. Locate the generated resource bundles for a particular portlet in the following location.
    web-inf/classes/nls/modelpath/modelname

  2. Copy the existing resource bundle, and create duplicates for each language to be supported.

    For example, you can start with a resource bundle named siebelperson.properties. Copy this file so that the name of the translated resource bundle for English would be siebelperson_en.properties and for French would be siebelperson_fr.properties.

    Each resource bundle file for each language to be supported needs to have the correct language and country suffix.

  3. Repeat the copy and edit action for the remainder of the existing portlet resource bundles for this particular project.

  4. Find the appropriate portlet deployment descriptor file.

    • For the JSR 168 portlet
      web-inf/bin/deployment/portlet_base.standard

    • For the JSR 286 portlet
      web-inf/bin/deployment/portlet_base.standard.286

  5. Open the appropriate portlet deployment descriptor file in a text editor and perform the following steps.

    1. Search to the following section that includes the default supported locale (English denoted by en).
      <expiration-cache>0</expiration-cache>
      
      <supports>
          <mime-type>text/html</mime-type>
          <portlet-mode>view</portlet-mode>
      </supports>
      
      <supported-locale>en</supported-locale>
      
      <resource-bundle></resource-bundle>
    2. Add additional locale entries for each language that you are facilitating.
      <expiration-cache>0</expiration-cache>
      
      <supports>
          <mime-type>text/html</mime-type>
          <portlet-mode>view</portlet-mode>
      </supports>
      
      <supported-locale>en</supported-locale>
      <supported-locale>de</supported-locale>
      <supported-locale>fr</supported-locale>
      <supported-locale>es</supported-locale>
      
      <resource-bundle></resource-bundle>
    3. Save the changes and close the file.

  6. Optional: If you already deployed the portlet WAR, remove that portlet WAR.

    Each portlet only gets the supported local values registered once when the portlet WAR is first deployed.

  7. Add (or remove) resource bundles for each portlet.

    You do not have to remove the portlet war again.

After you deploy the portlet WAR with the supported locales, if you add additional portlets to the project and to the portlet WAR or add updates to existing portlets, you only need to add additional locale resource bundles. You do not need any changes to the portlet deployment descriptor template.

Parent topic: Overview: localizing applications


Library | Support |