Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Debugging techniques in offline localization

Updated on December 13, 2022
Applicable to Theme Cosmos applications

Ensure that offline localization of your app works as intended by applying the recommended debugging techniques.

Your application UI is not translated in offline mode

Resolving issues with offline localization

  1. In Dev Studio, check the configuration of the field value associated with the untranslated text to determine whether the field value is dynamic (a property reference), or static.
    Note: Generally, field values associated with out-of-the-box controls or that are directly referenced in the UI are static. Field values that are referenced in other ways are dynamic.
  2. Depending on how the system references the field value, ensure that you have the correct configuration:
    • If the text is retrieved dynamically from a property reference, ensure that the required field values are present in the pyFieldValueWhitelistForOffline HTML rule. For more information about adding dynamically referenced field values to the allow list, see Configuring localization for offline-enabled mobile apps.
    • If the field value that is associated with the untranslated text is static, check the section and the field value classes. Ensure that the field value is present in the section class or in the inheritance of the section class.
  3. If steps 1 and 2 are ineffective, in the console, run the following script to fetch the localization object, and then verify whether the required field values are available in the correct class:
    • To fetch all the field values, enter:
      pega.offline.clientstorehelper.getLocaleData(localeName,
       /* success */
       function(data) {
       console.log(data);
       },
       /* failure */
       function(error) {
       console.log("An error has occurred");
       }
       );
      
    • To fetch a single field value, enter:
      pega.clientTools.getLocalizedTextForString(fieldName, FieldValue)
    • To fetch a paragraph, enter:
      pega.offline.clientstorehelper.getParagraph(pxInsName, /* success */
       function(data) {
       console.log(data);
       },
       /* failure */
       function(error) {
       console.log("An error has occurred");
       }
      );
      

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us