Python And Internationalization maybe a pre-pep?
sombDELETE at pobox.ru
Sat Jan 10 15:08:21 CET 2004
"Brian Kelley" <bkelley at wi.mit.edu> wrote in message news:YSKLb.10550$5V2.17781 at attbi_s53...
> Martin v. Loewis wrote:
> > Brian Kelley wrote:
> >> So, am I being silly, redundant or just plain different?
> > I do wonder what kind of application are you looking at. How
> > many strings? How many different translators? How often do
> > the strings change? Are the strings presented to the immediate
> > user of the application sitting in front of the terminal where
> > the application is running, or are there multiple simultaneous
> > accesses to the same application, e.g. through a Web server?
> The number of strings doesn't really matter I think as long as you can
> automatically generate the ones that need to be translated. Both
> mechanisms do this.
> I hadn't previously thought about multiple simultaneous users but this
> could fit in nicely. After some experimentation with the string
> classes, it turns out that as long as the __repr__ of the string stays
> unchanged, i.e. in this case the original english version, then the
> __str__ of a string (the locale specific changes) can change willy-nilly
> and not affect things like dictionaries and class name lookups.
If you keep translator instance in a global variable then users won't
be able to select different languages.
> I suppose that there really isn't much difference in the long run as
> long as tools exist that make these translations relatively easy but I
> can't quite shake the thought of trying to teach my brother, a
> biologist, how to enable localization in his code in an easy manner.
> Anyway, you have made good points and maybe all I need are some better
> integrated tools for localizing my applications.
Exactly. At the link you provided, the description of creating database of
strings for translation takes 120 words whereas the whole text is about
2500 words. And I beleive collection of strings to translate should take
place only before a release. How often is it?
> Since you brought it up, how does gettext handle multiple users? Does
> each user get a different gettext library (dll) instance?
No. Different translator class instances. Your pre-pep doesn't help
More information about the Python-list