Localize a mobile app

Follow this procedure to localize your mobile app.

Before completing this procedure, you have an app that works but is not yet localized.

You can use localized string files to provide different languages for your mobile app. Before you complete the steps in this procedure, it would benefit you to read on the use of localized strings in the Genero Business Development Language User Guide.
Important: An app must be deployed to see localization take place. Localization does not work in developer mode.
  1. Modify your app source and resource files for localized string use.
    1. For your text-based source files (4gl and per), see the article Localized strings in program sources in the Genero Business Development Language User Guide.
    2. For your graphical form files (4fd), see Localizing your form.
    3. For your resource files (such as your action defaults (4ad) and presentation styles (4st) files), see the article Localized strings in XML resource files in the Genero Business Development Language User Guide.
  2. Create the localized string files.
    1. For your text-based source files (4gl and per), see the article Extracting strings from sources in the Genero Business Development Language User Guide.
    2. For your graphical form files (4fd), see Localizing your form.
    3. For your resource files (such as your action defaults (4ad) and presentation styles (4st) files), an extraction tool is not provided. You must create the localized string file by hand.
    You now have a localized string file for each of your source files. These files serve as the starting point for language-specific localized string files; you will create a copy these files for each language you wish to provide.
    Tip: Save these base localized string files in your Resources folder in your project. You do not, however, want them to be compiled. Select each of the base localized string files and check the Exclude from compilation property.
  3. Update your fglprofile file to list the required string files.
    See Using localized strings at runtime in the Genero Business Development Language User Guide.
  4. Identify the languages and their corresponding locale codes needed for your localization effort.
    The selected language is identified by a locale code following the ISO 639 standard. See Using localized strings at runtime in the Genero Business Development Language User Guide.
  5. Create a sub-directory for each language you wish to localize.
    For the directory name, use the locale code identified in the previous step.
  6. Copy all the localized string files into each locale sub-directory.
  7. Edit the localized string files within each locale sub-directory to provide the translations. Save your changes.
  8. Compile each localized string file.
    If you are using the command line to compile the localized string files, see Compiling string files in the Genero Business Development Language User Guide. If you are using Genero Studio to compile the localized string files, follow these steps.
    1. Create a library node for each language.
      For example, you could create a library named en to hold your generic English localized string files, and you could create a library named en_US to hold your English (United States) localized string files.
    2. Select the library node and change the Target directory property to $(ProjectDir)/bin/xx, where xx is the language code.
      For example, you would specify $(ProjectDir)/bin/en for the generic English library node, or $(ProjectDir)/bin/en_US for the English (United States) library node. The target directory specifies where the compiled string files will be placed after compilation. These examples assume that the compiled program files are being placed in $(ProjectDir)/bin.
    3. Right-click on the library node and select Add Files to add your localized string files (str) from the corresponding language directory on disk.
    4. Right-click on the library node and select Build.
      The compiled localized string files (42s) appear in the specified Target directory.
    5. Right-click on the Application node and select Advanced Properties.
    6. Select the Dependencies page and select each language library in the Dependencies property page.
  9. For each package node, add a Directory node for each language library node.
    The Directory node places the compiled string files into the correct directory. For example, if the Source directory is set to $(ProjectDir)\bin\en_US, then the Destination directory must be set to $(ProjectDir)\bin\en_US. Set the Included files filter to *.42?.
  10. Deploy your package.
  11. Test each language.
    1. Change the language in the device's settings to one of the languages you have set for localization.
    2. Launch your app.