S
S
Sergey Aganezov2011-08-13 20:21:57
Python
Sergey Aganezov, 2011-08-13 20:21:57

Python application and language files

Description



There is an application which is written on Python. Language version 2.7.2. SQLite 3 is used as an information storage, and, accordingly, the library built into the language is used to work with this database. It is necessary that the application run under three main platforms: Windows XP and above; Mac OS 10.6 and above; Ubuntu.

Problem



You need to internationalize the application. In essence, this means the presence of another language in the GUI, the ability to save logs and everything else in the selected language. What is the best way to implement the storage of language files? Their upload? I would like to have the ability to change the language of the program "on the fly". And the standard question is how did you implement such functionality in your application (especially interesting if it was written in Python), what methods exist in principle for implementing such functionality?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Konstantin, 2011-08-13
@Norraxx

gettext (http://docs.python.org/library/gettext.html)

A
anatoly_rr, 2011-08-28
@anatoly_rr

It's amazing how this Q&A is similar to this one ! Almost all the authors and the content of the answers are the same! The first answer is a link to the library, the second is about OS X and a note about unnecessary complication, the third is about native / Pythonic, and the fourth is about similarity!

G
Gosha Arinich, 2011-08-13
@goshakkk_reborn

In OS X, it is customary for an application to be launched in the system's default language (or, if it is not supported by the application, to go through the user's preferred language list), without the user having to select a language. Here is a question on stackoverflow about how to get the system language. But PyObjC is probably indispensable here.

J
jj_killer, 2011-08-14
@jj_killer

Raw gettext is not Pythonic at all, here: babel.edgewall.org/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question