How Pseudolocalization can help you in internationalization.

Haroon Khan
Flutter Community
Published in
4 min readNov 28, 2022

Before going deep into psuodolocalization, let’s first understand the basic definition of Internationalization, Localization and psuodolocalization.

Internationalization:

Internationalization is the process of designing a software application so that it can easily be adapted to various other languages and regions without any programming changes.

Localization:

Localization is the process of adapting internationalized software for a specific region or language by adding locale-specific components (€2.99 => 2,99€) and translating text (Hello World! => Hallo Welt!).

Psuodo-Localization

Pseudolocalization is a software testing method used before the localization process in which a fake (or pseudo) translations (with the region and language specific characters) are generated: Hello World! => [ Hellö Wörld! ÜüäßÖ ].

Problems Faced in Localization:

Traditionally localization starts when development is finished as both development and localization are considered as two different process. So there are many issues associated with this approach that include but not limited to:

  1. Some string is hardcoded in the source code:
    Every localizable string should be editable without touching a single line of code. e.g In Flutter we have localization files i.e .arb files or custom localized json files. When a team go with the approach of localizing at the end of development, it may leave some of the localizable string in the source code which is hard to change later and in case you are supporting multiple languages then this effort multiplies by the number of languages you are supporting.
  2. The translated text can be longer or shorter then the language used in the design:
    Here are some text expansion/contraction ratios by smartling:
  • Chinese, Japanese: reduces text size by 50%.
  • Korean: reduces text size by 30%.
  • Baseline: displays pseudo translations with no text expansion.
  • Most European Languages: increases text size by 15%.
  • French, Italian: increases text size by 30%.
  • Dutch, German: increases text size by 50%.

Below are some examples of how these changes in text sizes can affect the design of the application. The text can go beyond the available container size and can even mess-up the whole screen design if this issue arises in a critical location.

Location issues example by Shopify

How Psuodolocalization can help avoid the above mentioned issues.

With Psuodolocation you get your localisable text translated to a psudo translations. e.g “Hello World” gets translated to “[!!! Hèℓℓô Wôřℓδ ℓô !!!]” (There are different formats and standards for psuodolocalization and this is not the only psuodotranslation). Psuodolocalization helps you with the following things:

  1. Identify the localized string e.g “Hello World” gets translated to “[!!! Hèℓℓô Wôřℓδ ℓô !!!]” where translated text is understandable by the developer as compared to, for example if the text is translated to Japanese that some developers may not understand and can’t identify which specific UI component is messing up the design.
  2. To test the visual effects of all the special characters of target language. e.g German
  3. To test the localized text if it can fit in the available area of the box e.g Text Container. And check if the localized string will not overflow.
  4. Find hardcoded strings that is intended to be localized.
  5. Psuodolocalization is not focused on a single language but you can do it for any target region with most languages having somehow matching text stretch or contraction.

Other best thing about psuodolocalization is that you can start development with the psudotranslated text and fix all the issues on the go instead of getting it reported from QA team and then coming back to fix these issues one by one which will waste a good amount of precious engineering hours.

As quoted by Shopify blog

Pseudo-localization allows engineering teams to continuously test their UI for localizability during their development sprints, because pseudo-localization becomes the default development language for the team.

Psuodolocalization in Flutter

Luckily there is also a plugin available in Flutter for Psudolocalization flutter_pseudolocalizor.
With this Flutter plugin you can generate Psuodotranslation for multiple languages at once but it’s mendatory that you have done the localization using flutter_localization.

Steps to use flutter_pseudolocalizor to generate psuodotranslation for multiple languages as these steps are also mentioned in the plugin documentation:

  1. Add plugin as dev_dependency in pubspec.yaml
dev_dependencies: 
flutter_pseudolocalizor:

2. Define settings for languages (e.g du, pl, ru), input file (in .arb formate), output and csv settings etc. Here is the example provided in the documentation:

flutter_pseudolocalizor:
input_filepath: "test.arb"
replace_base: true
unicode_blocks:
- latinSupplement
- latinExtendedA
use_brackets: true
text_expansion_format: 'repeatVowels'
text_expansion_ratio: null
languages_to_generate:
- de
- pl
- ru
patterns_to_ignore:
- '%(\S*?)\$[ds]'
- 'Flutter'
keys_to_ignore:
- 'title'
arb_settings:
output_directory: 'l10n_pseudo'
csv_settings:
output_filepath: 'test_PSEUDO.csv'
delimiter: ";"
column_index: 1

3. Generate the psuodotranslation files:

flutter pub run flutter_pseudolocalizor

and here you go. Now just go ahead and test your UI if it looks fine with the translated text and keep doing development with psuodotranslated text until your team comes up with the actual translated files.

References:

--

--

Haroon Khan
Flutter Community

CTO AntonX | Full Stack Dev | Flutter & Node.js | DevOps | AWS