Skip to content

Latest commit

 

History

History

po

Localization

Language Codes

Languages are typically given a two-letter designation.

e.g. fr for French, de for German.

For languages where regional differences exist, a hyphen followed by a region code is added to distinguish it.

e.g. en-GB is English from Great Britain

Usual Language Codes

Regional Language Codes

Adding Support for a New Language

Assume xx is your Language Code:

Gettext

update_pot.sh requires the xgettext utility from the gettext package.

Distro Package Name Install Command
Arch gettext sudo pacman -S gettext
Debian gettext sudo apt-get install gettext
Fedora gettext sudo dnf install gettext
Ubuntu gettext sudo apt-get install gettext

Editing PO Files

You'll likely want to use a PO File Editor:

Testing

Follow the flatpak-builder Instructions for building the project.

Run those commands from the top level directory of the project.

You should now be able to run the app via:

flatpak run io.github.Foldex.AdwSteamGtk

To test out your localization changes you will need to force the locale.

Generating Locale

If you already have the locale for the language you are translating installed, you may skip this step.

In order to run the program with a new locale, you must first generate it on your system.

See: Generating Locale

Flatpak Locale

For freshly generated locales, flatpak will also need to fetch the new locale information.

Switch to the new locale and run:

flatpak update

Running with Locale

For example, to run the Ukrainian locale:

LANG=uk_UA.UTF-8 flatpak run io.github.Foldex.AdwSteamGtk

Locale not Supported Error

If you get this error:

Locale not supported by C library. Using the fallback 'C' locale.

Ensure that:

  • The locale has been Generated on your system
  • You have typed the locale name correctly when passing LANG=
  • Flatpak has downloaded the Runtime Locale
  • The Language Code is present in the LINGUAS file