Discussion:
LyX 2.0 and XeTeX: Floats (figures, etc) are not translated
(too old to reply)
Jürgen Spitzmüller
2011-03-19 17:56:44 UTC
Permalink
[...]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\renewcommand{\figurename}{Xaxa}%
\makeatother
\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{greek}
\setotherlanguage{english}
\addto\captionsenglish{\renewcommand{\figurename}{Figure}}
\addto\captionsgreek{\renewcommand{\figurename}{Figure}}
\begin{document}
[...]
I'm confused. Why does LyX change \figurename to "Figure" on its own?
This is indeed not necessary. We can safely assume that babel and polyglossia
translate the builtin floats and thus skip them in getTClassI18nPreamble.

The attached patch does this.

Georg, do you object?

JÃŒrgen
Jürgen Spitzmüller
2011-03-20 10:23:58 UTC
Permalink
Post by Jürgen Spitzmüller
This is indeed not necessary. We can safely assume that babel and
polyglossia translate the builtin floats and thus skip them in
getTClassI18nPreamble.
The attached patch does this.
The attached patch goes one step further. It only puts translations into the
preamble if translateIfPossible returned something different to the source.
This way, we prevent what seems to have happened in the case of the OP: a
back-translation to English in cases where a po file does not contain a
translation.

The (English) source expression would be used nevertheless if
babel/polyglossia did not know a translation, so we lose nothing.
But now, it can happen that we force babel/polyglossia to use the English term
even if they contain a proper translation.

Jürgen
Georg Baum
2011-03-20 10:38:07 UTC
Permalink
Post by Jürgen Spitzmüller
The attached patch goes one step further. It only puts translations into
the preamble if translateIfPossible returned something different to the
source. This way, we prevent what seems to have happened in the case of
the OP: a back-translation to English in cases where a po file does not
contain a translation.
The (English) source expression would be used nevertheless if
babel/polyglossia did not know a translation, so we lose nothing.
But now, it can happen that we force babel/polyglossia to use the English
term even if they contain a proper translation.
Even better!


Georg
Jürgen Spitzmüller
2011-03-20 10:50:43 UTC
Permalink
Post by Georg Baum
Post by Jürgen Spitzmüller
The attached patch goes one step further. It only puts translations into
the preamble if translateIfPossible returned something different to the
source. This way, we prevent what seems to have happened in the case of
the OP: a back-translation to English in cases where a po file does not
contain a translation.
The (English) source expression would be used nevertheless if
babel/polyglossia did not know a translation, so we lose nothing.
But now, it can happen that we force babel/polyglossia to use the English
term even if they contain a proper translation.
Even better!
Good. Committed.

Jürgen
Nikos Chantziaras
2011-03-20 13:30:50 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Jürgen Spitzmüller
This is indeed not necessary. We can safely assume that babel and
polyglossia translate the builtin floats and thus skip them in
getTClassI18nPreamble.
The attached patch does this.
The attached patch goes one step further. It only puts translations into the
preamble if translateIfPossible returned something different to the source.
This way, we prevent what seems to have happened in the case of the OP: a
back-translation to English in cases where a po file does not contain a
translation.
po files? Does that mean that if I build LyX without i18n support
(which I do; I only need English), it has an effect on the work produced
with it rather than just its GUI?
Jürgen Spitzmüller
2011-03-20 13:41:08 UTC
Permalink
Post by Nikos Chantziaras
Post by Jürgen Spitzmüller
The attached patch goes one step further. It only puts translations into
the preamble if translateIfPossible returned something different to the
source. This way, we prevent what seems to have happened in the case of
the OP: a back-translation to English in cases where a po file does not
contain a translation.
po files? Does that mean that if I build LyX without i18n support
(which I do; I only need English), it has an effect on the work produced
with it rather than just its GUI?
Yes, that's correct.

Jürgen
Pavel Sanda
2011-03-20 16:24:50 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Nikos Chantziaras
Post by Jürgen Spitzmüller
The attached patch goes one step further. It only puts translations into
the preamble if translateIfPossible returned something different to the
source. This way, we prevent what seems to have happened in the case of
the OP: a back-translation to English in cases where a po file does not
contain a translation.
po files? Does that mean that if I build LyX without i18n support
(which I do; I only need English), it has an effect on the work produced
with it rather than just its GUI?
Yes, that's correct.
i wonder whether there is something we could do so this is stable through the
releases. it sounds wrong that document output should be different when new
translation is done or updated.

pavel
Nikos Chantziaras
2011-03-20 17:47:24 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Nikos Chantziaras
Post by Jürgen Spitzmüller
The attached patch goes one step further. It only puts translations into
the preamble if translateIfPossible returned something different to the
source. This way, we prevent what seems to have happened in the case of
the OP: a back-translation to English in cases where a po file does not
contain a translation.
po files? Does that mean that if I build LyX without i18n support
(which I do; I only need English), it has an effect on the work produced
with it rather than just its GUI?
Yes, that's correct.
Well, IMO that should not be the case. po files are used for GUI
translations of the application. Using them for other stuff sounds like
abuse rather than use.
Jürgen Spitzmüller
2011-03-20 17:58:12 UTC
Permalink
Post by Nikos Chantziaras
Well, IMO that should not be the case. po files are used for GUI
translations of the application. Using them for other stuff sounds like
abuse rather than use.
I see your point.

Jürgen
Georg Baum
2011-03-20 19:42:24 UTC
Permalink
Post by Nikos Chantziaras
Post by Jürgen Spitzmüller
Post by Nikos Chantziaras
po files? Does that mean that if I build LyX without i18n support
(which I do; I only need English), it has an effect on the work produced
with it rather than just its GUI?
Yes, that's correct.
Well, IMO that should not be the case. po files are used for GUI
translations of the application. Using them for other stuff sounds like
abuse rather than use.
Using the same translations for LaTeX output and GUI is rather important
IMO. It would be very confusing if you see on screen "Abbildung 5.1", but in
the PDF "Grafik 5.1". Another reason for doing that is the reduced burden on
the translators: This way all translations of a particular language are
centralized in one .po file.

I agree however that this results in two problems:

1) Stability of the translations (as mentioned by Pavel)
2) The installed (or not) .mo files influence the document output, and this
is wrong, since people expect that .mo files are only used for UI
translation.

Problem 1) could be solved partially if the translations were marked as
layout translations using the context mechanism, e.g. with [[layout]]. This
could be automated with a trivial change of po/lyx_pot.py.

Solving problem 2) requires that the translations are read from a different
source than the installed .mo files. I suggest a new file per language, e.g.
lib/layouts/translations/de. This file could be automatically created by
po/lyx_pot.py. The ultimate responsibility for stable translations would
then lay on those persons who remerge the translations.


Georg
Pavel Sanda
2011-03-20 20:01:41 UTC
Permalink
Post by Georg Baum
Solving problem 2) requires that the translations are read from a different
source than the installed .mo files. I suggest a new file per language, e.g.
lib/layouts/translations/de. This file could be automatically created by
po/lyx_pot.py. The ultimate responsibility for stable translations would
then lay on those persons who remerge the translations.
i came to something similar when thinking about the issue. maybe plus some
policy we do this update only for major? releases and do not remove them even if
.po files are marked as unmaintained.

pavel
Nikos Chantziaras
2011-03-20 20:41:35 UTC
Permalink
Post by Georg Baum
Post by Nikos Chantziaras
Post by Jürgen Spitzmüller
Post by Nikos Chantziaras
po files? Does that mean that if I build LyX without i18n support
(which I do; I only need English), it has an effect on the work produced
with it rather than just its GUI?
Yes, that's correct.
Well, IMO that should not be the case. po files are used for GUI
translations of the application. Using them for other stuff sounds like
abuse rather than use.
Using the same translations for LaTeX output and GUI is rather important
IMO. It would be very confusing if you see on screen "Abbildung 5.1", but in
the PDF "Grafik 5.1".
LyX already behaves like that in a lot of places and is very pedantic
about making it clear that WYSIWYM and that LaTeX is solely responsible
for what you see in the output. If I see "Figure" in a German or Greek
document in LyX (which I actually do), I know already that this is
because I'm using the English version of LyX. I don't expect it to pull
a translation out of its bottom :-)

What I do expect though, is that the final output generated by LaTeX
should be the same regardless of whether I'm using the English or German
or Greek version of LyX. If that's not the case, then this would be the
confusing thing because it means that the output produced by LaTeX is
being modified due to circumstances that are not represented in the
configuration dialog or in the document settings. It sounds logical to
me that when using the exact same settings, all LyX localizations should
produce the exact same *.tex output.
Pavel Sanda
2011-03-20 20:46:47 UTC
Permalink
What I do expect though, is that the final output generated by LaTeX should
be the same regardless of whether I'm using the English or German or Greek
version of LyX. If that's not the case, then this would be the confusing
thing because it means that the output produced by LaTeX is being modified
due to circumstances that are not represented in the configuration dialog
or in the document settings. It sounds logical to me that when using the
exact same settings, all LyX localizations should produce the exact same
*.tex output.
no, we gain translation from .po file currently, but which language is used
is dependent on language of document iirc.

pavel

Georg Baum
2011-03-20 10:30:50 UTC
Permalink
Post by Jürgen Spitzmüller
I'm confused. Why does LyX change \figurename to "Figure" on its own?
This is indeed not necessary. We can safely assume that babel and
polyglossia translate the builtin floats and thus skip them in
getTClassI18nPreamble.
The attached patch does this.
Georg, do you object?
No, this looks fine.


Georg
Loading...