Opened 20 years ago

Closed 13 years ago

#1476 closed enhancement (fixed)

LyX lacks automatic translation of theorem names

Reported by: pdenapo@… Owned by: nobody@…
Priority: low Milestone: 2.0.0
Component: general Version: 1.3.3
Severity: minor Keywords:
Cc: lasgouttes@…, georg.baum@…, uwestoehr@…, themuse@…

Description (last modified by Uwe Stöhr)

I think it would be nice to add a command for setting the language and
the encoding of the document in the .layout files so that we may create
custom layouts for documents in a particular language.
(for example, I've created some for mathematical articles in Spanish)

Attachments (8)

lyx-layouts.tar.gz (3.5 KB ) - added by pdenapo@… 20 years ago.
my lyx layouts
ams-i18n.diff (11.7 KB ) - added by Georg Baum 15 years ago.
fix
ams-i18n-fr.lyx (1.1 KB ) - added by Georg Baum 15 years ago.
example
ams-i18n-fr.tex (1.6 KB ) - added by Georg Baum 15 years ago.
exported example
attachment2.lyx (1.1 KB ) - added by Uwe Stöhr 15 years ago.
example that fails
bug1476.png (38.9 KB ) - added by Uwe Stöhr 15 years ago.
screenshot showing the problem
ams-i18n-2.diff (16.2 KB ) - added by Georg Baum 15 years ago.
better fix
ams-i18n-3.diff (19.7 KB ) - added by Georg Baum 15 years ago.
latest fix

Download all attachments as: .zip

Change History (32)

comment:1 by pdenapo@…, 20 years ago

Severity: normalenhancement

comment:2 by lasgouttes, 20 years ago

This would make sense for latex document classes that force the language,
but otherwise the right thing to do is to use a template which has the right
language selected.

What kind of document class do you have in mind?

by pdenapo@…, 20 years ago

Attachment: lyx-layouts.tar.gz added

my lyx layouts

comment:3 by pdenapo@…, 20 years ago

guardar el atachment como layouts.tar.gz

comment:4 by themuse@…, 19 years ago

I think it would be good to somehow "internationalize" the layouts - I'd like to
have about the very same thing as Pablo in German, which at the moment would
force me to create a couple of files like amsmaths_de.inc etc., just copying the
original files, leaving any "technical" parts and settings of the layout
unchanged, just translating the texts to be inserted. This is not only redundant
but seems absurd as these items are actually already translated in LyX itself
(style combobox).
Maybe a set of translations that can be accessed by the layouts and are chosen
depending on which language the user selects from within the document settings
dialogue would be a good idea. BTW, is there anything like Babel for theorem and
friends, i.e., a LaTeX-native solution that could be used?

comment:5 by themuse@…, 19 years ago

Cc: themuse@… added

comment:6 by lasgouttes, 19 years ago

Status: newassigned

In LyX 1.4.0, the labels for things like Chapter will be correctly translated on
screen with the language of the document.

We have not (yet) found a clean way to fix the theorem definition issue. I'll
try to find a solution, but this will not be in 1.3.x.

comment:7 by lasgouttes, 19 years ago

To answer your last question, babel unfortunately lacks suppoer for theorems
and friends.

comment:8 by lasgouttes, 19 years ago

Owner: changed from lasgouttes to nobody@…
Status: assignednew

comment:9 by Uwe Stöhr, 16 years ago

Cc: uwestoehr@… added
Summary: Lyx lacks a command for setting the language of the document in the .layout filesLyX lacks automatic translation of theorem names

In LyX 1.5 there is no need to create layout files for certain languages. All
labels and environment names are translatable the same way we translate LyX's
menu names.

The only thing that cannot be dome are the Theorem environments. As babel don't
and won't support the automatic translation of names like "axiom", "proof", we
should think about doing this automatically in LyX. I listed the needed LaTeX
commands here:
http://wiki.lyx.org/LyX/I18nLabels

comment:10 by Georg Baum, 15 years ago

Keywords: patch added
Milestone: 2.0.0

by Georg Baum, 15 years ago

Attachment: ams-i18n.diff added

fix

comment:11 by Georg Baum, 15 years ago

attachments.isobsolete: 01

comment:12 by Uwe Stöhr, 15 years ago

Cc: georg.baum@… added

Hello Georg, I tested you patch and it works fine except of this problem:

I'm using LyX with German menu names and want to write a French document. Then I
get this preamble code:

\newtheorem{claim}[thm]{\protect\claimname}

\AtBeginDocument{\ifx\LdfInit\undefined\relax\else\addto\captionsfrench{\renewcommand{\claimname}{Behauptung}}\fi}

French is recognized, but the translation is in German. So the translation must
be dependent on the document language, not the LyX menu language.

by Georg Baum, 15 years ago

Attachment: ams-i18n-fr.lyx added

example

by Georg Baum, 15 years ago

Attachment: ams-i18n-fr.tex added

exported example

by Uwe Stöhr, 15 years ago

Attachment: attachment2.lyx added

example that fails

comment:13 by Uwe Stöhr, 15 years ago

It works here (see attached example)

When I open your file and reset the language of all text parts to the document
language "French" I get the bug again.

I attached an example file.

by Uwe Stöhr, 15 years ago

Attachment: bug1476.png added

screenshot showing the problem

by Georg Baum, 15 years ago

Attachment: ams-i18n-3.diff added

latest fix

comment:14 by Georg Baum, 15 years ago

attachments.isobsolete: 01

comment:15 by Uwe Stöhr, 15 years ago

Subject: Re: LyX lacks automatic translation of theorem names

In your screenshot both labels are translated into the menu language.

Because I reset the language to the document language. Sorry for the confusion.
The labels within LyX are correct, only the preamble code is incorrect. Perhaps this is due to the
buggy libintl version we have to use under Windows. This version is for example also responsible
that switching the menu language via the preferences doesn't work on Windows, but on Mac and Linux.

Because my example works correctly on Linux, please put it in. That libintl is buggy on Windows is
not your fault and your patch is an improvement also on Windows because in most cases your document
language is LyX's menu language.
When you don't agree, let's discuss this on the list - I guess other like JMarc know more about the
libintl stuff.

comment:16 by Georg Baum, 15 years ago

I did that. Not adding the fixedintrunk keyword since there are still
some .inc/.layout files that could be translated.

comment:17 by Uwe Stöhr, 15 years ago

Subject: Re: LyX lacks automatic translation of theorem names

Can you please also list your new features here:
http://wiki.lyx.org/LyX/NewInLyX20
(This also assures that everything will be documented.)

I would also like when you could use change tracking when you change documentation files. This makes
it much easier to keep tall language versions up to date.

thanks and regards Uwe

comment:18 by Georg Baum, 15 years ago

Keywords: fixedintrunk added

Rev. 28529 includes now a better fix for all theorems. This time I used change
tracking for the manual.

comment:19 by Uwe Stöhr, 15 years ago

Cc: lasgouttes@… added
dependson: 5798
Keywords: fixedintrunk removed

Rev. 28529 includes now a better fix for all theorems.

Not here on Windows. I still get always German translations when I start LyX
with German menus: LyX ignores the language settings of the document and always
translates to LyX's menu language.

JMarc, can you also confirm this for Mac (or even on your Linux)?

comment:20 by Georg Baum, 15 years ago

Well, you guessed already in comment 17 that this is a bug of the libintl that
is used on windows. The symptoms very much look like that, and IMHO documenting
the broken windows behaviour in the embedded objects manual was not a good
idea. Now the manual is wrong for linux users (and probably mac users as well).

comment:21 by Uwe Stöhr, 15 years ago

Subject: Re: LyX lacks automatic translation of theorem names

IMHO documenting
the broken windows behaviour in the embedded objects manual was not a good
idea. Now the manual is wrong for linux users (and probably mac users as well).

But people complained about this, for example also our Spanish translator who's using Linux. The
current description at least work on all systems.

comment:22 by Georg Baum, 15 years ago

Yes, it does, but it is confusing. It implies that the dependency on the menu
language is wanted, and this is wrong. And it prevents users who do not suffer
from the bug to use the correct solution. It would be nice if you could at
least clarify that the described workaround is caused by a bug and not always
needed.

comment:23 by Uwe Stöhr, 15 years ago

Description: modified (diff)
Keywords: fixedintrunk added; patch removed

It seems that this is not better fixable.

comment:24 by ps, 15 years ago

Priority: highlow

comment:25 by ps, 13 years ago

Keywords: fixedintrunk removed
Resolution: fixed
Status: newclosed

2.0.0 is ready

Note: See TracTickets for help on using tickets.