Pseudo Localization

From Lingoport Wiki
Revision as of 16:28, 9 April 2024 by Olibouban (talk | contribs) (Configuration: config_pseudo_loc.xml.xml)
Jump to: navigation, search

What is Pseudo-Localization?

Pseudo-localization is an effective way to test the localization-readiness of an application.  By pseudo-localizing the resource files, an application can be tested for internationalization without waiting for localization.

Creating pseudo-localized resource files help test for

  • embedded strings,
  • text that was externalized but should not be,
  • text expansion issues,
  • character-encoding problems,
  • text concatenation issues, and
  • UI boundary issues can be identified.

An application typically retrieves strings based on a locale, such as French. A pseudo-locale is like a normal locale, but the strings are not translated, they simply show differently.

Showing i18n Issues with Pseudo-localization

In the example below, the pseudo-locale is 'esperanto' and the English strings have been pseudo-localized. Some issues can be identified when the application is running using the pseudo-locale:

Pseudo-Localization Example Issues.jpg
  • 1 : Truncation: The end characters have been truncated, indicating a likely UI issues around the space set for the text. The UI may need to be refactored to accommodate for longer text in languages such as German.
  • 2 : Mojibake: When the pseudo-localized text is showing as mojibake, such as �, this likely indicates a character encoding or a font issue. The application does not support non ASCII characters or non Latin-1 characters.
  • 3 : Embedded String / Hard Code String: If the text shows in the original source locale, here English, as opposed to being pseudo-localized, it indicates a likely hard coded string which has not been externalized into a resource file. That string cannot be sent to translation and will show in the interface as the original source string. This is a common internationalization issue.
  • 4: Concatenation: The pseudo-localization shows that two strings have been put together to make up Y-Wing Galactic Fighter, since the end character shows up after Galactic Fighter and a start character shows up before Fighter.

Corrected Version

If the i18n issues above were corrected, running the application using the pseudo-locale would look like the following:

Pseudo-Localization No Issues.jpg.png

Configuration

Localyzer makes pseudo-localization quite simple: For the resource files in a repository to be pseudo-localized, edit the Locales by clicking the pseudo-locale checkbox and enter the locale to be used as shown below with eo (esperanto):

Pseudo-Localization Examples

Typical Configuration Example

      <expansion>
        <lengths>
           <length max="10" expand-percentage="200"/>
           <length max="20" expand-percentage="100"/>
           <length max="30" expand-percentage="80"/>
           <length max="50" expand-percentage="60"/>
           <length max="70" expand-percentage="40"/>
           <length max=""   expand-percentage="30"/>
        </lengths>
        <expansion-char>-</expansion-char>
        
        <!-- П: A Cyrillic character - (for Russian or ‘R’) -->
        <!-- 國: A common Chinese character (Hanzi, Kanji or Hanja) defined in Unicode BMP or Plane 0 – (for Chinese or ‘C’) -->	    
        <!-- カ: A Katakana character (used for Japanese or ‘J’) -->
        <!-- 내: A Hangul character (for Korean or ‘K’) -->
        <expansion-end-chars> П國カ내</expansion-end-chars>
      </expansion>
      <start-char>[</start-char>
      <end-char>]</end-char>
      <accent-chars>1</accent-chars>
      <!-- Flag indicating whether to add instrumented (non-printable unicode characters) to the start and end of the string
        The instrumented characters will be before any start character and after any end character 
        0 - do not add instrumented characters 
        1 - add instrumented characters     -->
      <add-invisible-chars>0</add-invisible-chars>

Based on this configuration, an example pseudo-localization would be:

Base Resource string: "This is an example using the typical configuration"
Pseudo-localized string: "[Ţĥîš îš åñ éẋåɱþļé ûšîñĝ ţĥé ţýþîçåļ çöñƒîĝûŕåţîöñ------------------------П國カ내]"

No Expansion Configuration Example

Edit the config_pseudo_loc.xml for no expansion by setting the expand-percentage to 0 and not entering any characters for the expansion character as well as the expansion end characters.

      <expansion>
        <lengths>
           <length max=""   expand-percentage="0"/>
        </lengths>
        <expansion-char></expansion-char>
        <expansion-end-chars></expansion-end-chars>
      </expansion>
      <start-char>[</start-char>
      <end-char>]</end-char>
      <accent-chars>1</accent-chars>
      <add-invisible-chars>0</add-invisible-chars>

Based on this configuration, an example pseudo-localization would be:

Base Resource string: "This is an example of no expansion configuration"
Pseudo-localized string: "[Ţĥîš îš åñ éẋåɱþļé öƒ ñö éẋþåñšîöñ çöñƒîĝûŕåţîöñ]"

End Character Symbols with no Expansion Configuration Example

Edit the config_pseudo_loc.xml for no expansion by setting the expand-percentage to 0 and not entering any characters for the expansion character as well as the expansion end characters. Add appropriate symbols to the end characters in order to ensure that content from the various code pages are supported.

      <expansion>
         <lengths>
            <length max=""   expand-percentage="0"/>
         </lengths>
         <expansion-char></expansion-char>
         <expansion-end-chars></expansion-end-chars>
      </expansion>
      <start-char>[</start-char>
      <!-- П: A Cyrillic character - (for Russian or ‘R’) -->
      <!-- 國: A common Chinese character (Hanzi, Kanji or Hanja) defined in Unicode BMP or Plane 0 – (for Chinese or ‘C’) -->	    
      <!-- カ: A Katakana character (used for Japanese or ‘J’) -->
      <!-- 내: A Hangul character (for Korean or ‘K’) -->
      <end-char> П國カ내]</end-char>
      <accent-chars>1</accent-chars>
      <add-invisible-chars>0</add-invisible-chars>

Based on this configuration, an example pseudo-localization would be:

Base Resource string: "This is an example of no expansion configuration"
Pseudo-localized string: "[Ţĥîš îš åñ éẋåɱþļé öƒ ñö éẋþåñšîöñ ŵîţĥ éñð çĥåŕåçţéŕš šýɱƀöļš çöñƒîĝûŕåţîöñ П國カ내]"

Accent Only Configuration Example

Edit the config_pseudo_loc.xml for no expansion by setting the expand-percentage to 0 and not entering any characters for the expansion character as well as the expansion end characters. Remove any characters defined in the start and end characters.

      <expansion>
         <lengths>
            <length max=""   expand-percentage="0"/>
         </lengths>
         <expansion-char></expansion-char>
         <expansion-end-chars></expansion-end-chars>
      </expansion>
      <start-char></start-char>
      <end-char></end-char>
      <accent-chars>1</accent-chars>
      <add-invisible-chars>0</add-invisible-chars>

Based on this configuration, an example pseudo-localization would be:

Base Resource string: "This is an example of accent only configuration"
Pseudo-localized string: "Ţĥîš îš åñ éẋåɱþļé öƒ åççéñţ öñļý çöñƒîĝûŕåţîöñ"