I have directory, which is called locale and subdirectories with languages (ru, ua, de etc.)
My Python script is translated:
from libs.gettext_windows import gettext_windows
scriptdir = os.path.abspath(os.path.dirname(__file__)) # directory with this script
# translating strings in _()
lang = gettext_windows.get_language()
translation = gettext.translation("vk_stats", localedir="{}/locale".format(scriptdir), languages=lang)
_ = translation.gettext
How I can localize my GUI (in development)?
I prefer to use Glade.
See this answer:
https://stackoverflow.com/a/10540744/439494
The procedure is very well explained there.
Also you might need to do this also:
https://stackoverflow.com/a/8377533/439494