PO Lengthier Text Author (POLenTA) is a tool for creating a new `.po` file for a fake language that includes the longest translation of each text from a set of `.po` files.
The aim is to help the UI/UX and QA departments of companies who use .po files in their localization pipeline, especially videogame developers using Unreal Engine.
Since longer translations take up more space, you can then import this fake language into your application to test the worst case for your UI/UX in a single run, without the need to constantly change the language from the settings.
Please note that the generated scenario may be worse than the real ones. If your UI can handle this well, you're good to go.
If used in FontBased mode, POLenTA will also find characters that aren't supported by the specified font files.
POLenTA takes its name from a food of Northern Italy, its developer's homeland. https://en.wikipedia.org/wiki/Polenta
POLenTA is a C# console application for Windows that requires .NET 6.0 or higher.
- Go to https://dotnet.microsoft.com/en-us/download/dotnet/6.0
- Find section
.NET Desktop Runtime - Download x64 Windows installer
- Run the installer
C# is not the developer's primary language, so code style and architectural choices may be less than ideal.
How to use POLenTA:
- (Only once) Get and unzip the latest version of the tool from the Releases folder.
- (Only once) Configure the
Localization Dashboard(instructions below) - Configure the
Settings.ini(instructions below) - Run
POLenTA.exe - (Optional) Check the log file in the
Logsfolder - Import the generated
.pofile(s) into your project - Test the generated localization
- Open the
Localization Dashboard(underWindowin UE4, underToolsin UE5) - Select the target(s), scroll all the way down
- Press
Add new cultureand select your output culture - Restart the editor
In the Localization Dashboard, press Import Text, select the localization folder, wait for the end of the process. It will take some time, the .archive file will be created.
Now the output culture's word count should be at 100%.
Press Compile Text, so the .locres file will be created. The new culture is ready to be used.
QA: launch the game, select the output culture language from the settings, play the game.
UI: Open a widget blueprint, use the button next to the world globe icon to select the localization preview language
English:
Italian:
Japanese:
Output culture:
POLenTA's lifecycle is made up of these step:
- Read the settings from the
inifile - Eventually load the requested fonts.
- For each target
- Parse the
.pofiles of the specified cultures - Get the longest translation of each text
- Generate the
.pofile with those long translations
- Parse the
A log file will be created for each run. Contains info about the scanned files, problems or errors that may occur and some statistics.
Most of the information will also appear in the application window.
To avoid showing the application window or creating the log file, see the Console arguments section.
POLenTA uses Settings.ini to know what to do.
In Unreal Engine, the localization folder path is usually
LocalizationFolder = C:\{My game folder path}\Content\Localization
In Unreal Engine, you can find the game localization targets in the Localization Dashboard.
Add a comma (and optionally also a space character) between each item of LocalizationTargets.
LocalizationTargets = Game,Dialogues
You must specify the default and output culture and at least one language to compare against, using culture codes.
Here you can find the list of all culture codes.
The OutputCulture is the culture code of the fake language that POLenTA will create.
I recommend to use Afar, an African culture uncommonly used in games which code is aa.
In this way, the generated output folder will be the first in alphabetical order.
Add a comma (and optionally also a space character) between each item of CompareCultures.
DefaultCulture = en
OutputCulture = aa
CompareCultures = cs,de,es-ES,fr,it,ja,ko,pt-BR,ru,zh-Hans,zh-Hant
POLenTA will use the culture codes to generate working folder paths in this way:
{LocalizationFolder}\{LocalizationTarget}\{CultureCode}\
This is the expected folder tree for the localization in Unreal Engine
├── Localization
│ ├── TargetA
│ │ ├── en
│ │ │ ├── TargetA.po
│ │ ├── it
│ │ │ │── TargetA.po
│ │ ├── ja
│ │ │ ├── TargetA.po
│ ├── TargetB
│ │ ├── en
│ │ │ ├── TargetB.po
│ │ ├── it
│ │ │ ├── TargetB.po
│ │ ├── ja
│ │ │ ├── TargetB.po
The output folder will be automatically created, if missing.
POLenTA provides two ways to calculate to the length of a translation:
NumCharssimply counts the number of the characters in the stringFontBasedsums the rendered glyph size of each character, so you need to provide at least one font file. It requires more memory and longer execution time
Testing a real case with 2 targets and a total of ~6000 entries, it takes:
- Less than 1 second using
NumChars - Less than 3 seconds using
FontBased
Set the chosen mode into the TextLengthCalculatorType property.
TextLengthCalculatorType = NumChars
`DefaultFont` is an optional property used only for font based length calculator.
It allows you to specify the default font used in the project. The value of the property is the font file path.
Like in Unreal Engine, it makes no sense to specify a scaling factor for the default font, it will always be 1.0.
DefaultFont = C:\Windows\Fonts\Arial\arial.ttf
`DoExitCountdown` is an optional property.
By default, POLenTA does a 3 seconds countdown at the end of the task, before closing itself.
You can avoid it using
DoExitCountdown = false
It allows you to specify the fallback fonts to look for if a character glyph cannot be found in default and culture specific fonts.
The name of the property is not important.
The value is the font file path, optionally followed by its scaling factor (default is 1.0).
E.g. for CJK characters fallback with scaling factor of 1.5 is
FF_CJK = C:\{My folder path}\Fonts\Noto\SimplifiedChinese\NotoSansSC-Medium.otf, 1.5
Don't forget the comma between the file path and the scaling factor!
It allows you to specify the font used for a culture and (optionally) its scaling factor.
You can't specify a specific font only for a characters subset, like in Unreal Engine.
The name of the property is the culture code.
The value is the font file path, optionally followed by its scaling factor (default is 1.0).
E.g. for Japanese with scaling factor of 1.5 is
ja = C:\{My folder path}\Fonts\Noto\Japanese\NotoSansJP-Medium.otf, 1.5
Don't forget the comma between the file path and the scaling factor!
POLenTA supports some console arguments to better fit your pipeline:
-NoLogFilewill skip the creation of the log file (you can still read part of the log output in the console window)-HideWindowwill hide the console window
The case of the characters of the console argument is not important.
To apply the one or more console arguments:
- If you like the command prompt, just invoke
POLenTA.exefollowed by the args - Or create a custom shortcut
- Right click on
POLenTA.exeand selectCreate shortcut - Right click on the just created shortcut, select
Properties, then select theShortcuttab - Add the args after
POLenTA.exeinTarget.
- Right click on
In both cases, you will obtain
{POLenTA folder path}\POLenTA.exe -NoLogFile -HideWindow
Applying both -NoLogFile and -HideWindow won't give any information of the execution but will simply generate the output culture files.
POLenTA is licensed under the MIT NON-AI License (see LICENSE).
If you use POLenTA during the development of your software, I would be very pleased if you would add me in the credits with this line (or something similar)
This software uses POLenTA by Michele Caovilla
POLenTA uses the following libraries:
- Karambolo.PO (MIT License)
- IniFile.NET (Apache License 2.0)
- NLog (BSD 3-Clause License)
The respective licenses can be found in the Licenses folder.
POLenTA's icon is based on this free image.
A sincere thank you to their creators, without whom POLenTA would not have been possible.







