Michal Skrzypek wrote:
Dear LyX developers,
I have some question: I will soon need to write a paper in Polish,
but currently there is no way of having "Theorem", "Proposition" and
alike in Polish language other than translating layouts manually (or
have I missed something?). What is the best approach to this task, i.e.
how to do it universally, so that such a translation could later be
integrated into LyX and into the future versions of layouts itself?
Some framework for doing so would be quite useful in my opinion,
because as of now, it seems to me that all the names are hardcoded into
layout files, which makes the work of maintaining them for different
languages needlessly complicated.
Am I right in these observations? If so, are there any plans to
solve this? It seems important, because as of now setting the language
in the document has no effect for the generated documents, on the other
hand, setting the language for the LyX interface seems to translate some
names (still not all of them: "Axiom" for example is not trasnlated
into Polish), but only in the LyX GUI - this is not happening in sync
with the target document (why?), so everything has to be translated
twice for the full effect.
There are two separable issues here. One is how things appear in LyX
itself. The other is how the LaTeX output appears. So the answer to your
last question is just that these are different.
As for LyX, the strings used in layout files are all translatable, but
whether they have actually been translated is another matter. Our
translators work hard, but it's not always easy to keep up, and we don't
always have active translators for every language for which we have
partial GUI translations. It appears from a quick look at the pl.po file
that, as you mention, the label string for the axiom environment hasn't
yet been translated. If you'd like to translate it, and anything else,
we'd be happy to have it. Just check out the pl.po file, where you'll
also find names and email addresses for the earlier contributors. The
file can be edited with a simple text editor or with a GUI such as
kbabel (for Linux) or poedit (http://www.poedit.net/), which is
allegedly cross-platform. I'm sure there are lots more, too.
How things appear in LaTeX is an entirely different matter. The LaTeX
babel package is supposed to handle this sort of thing, but it doesn't
handle every environment one might introduce. The good news is that,
thanks to work by Georg Baum, this sort of thing will be handled
automatically in LyX 2.0. The bad news is that Georg's fixes cannot be
backported to 1.6.x, because they change the format of the layout files.
So for 1.6.x, you have to do things manually (as you would in straight
LaTeX, too). See http://wiki.lyx.org/LyX/I18nLabels for information on
what needs doing, including detailed information on translating the AMS
environments. The best thing to do would be to produce a set of modules
theorems-ams-pl.module
theorems-ams-extended-pl.module
that would encapsulate the relevant translations and then can be used
whenever you need to write in Polish.
Not to mention, that switching language for LyX GUI has problems of
its own. Changing the LANG variable gives a lot of warning messages
about conflicting or non-existing keyboard shortcuts.
These are probably due to conflicts in the translation files, which
again we'd love for you to fix.
Richard