Richard Heck wrote:

> On 04/27/2011 06:49 AM, Liviu Andronic wrote:
>> 2011/4/27 Pavel Sanda<sa...@lyx.org>:
>>>> But he pointed out one problem: in Romanian one would use:
>>>> "Ipotez?." (when not numbered) but "Ipoteza 1" (when numbered)
>>>>
>>>> or
>>>> "Defini??ie." but "Defini??ia 13"
>>>>
>>>> Can this be addressed using the current messages mechanism?
>>> no, i dont think so.
>>>
> The person to ask would obviously be Georg, but I think this can be
> done, in principle. At the moment, we use both \theoremname (etc) in
> both cases, and mark the translation as _(Theorem). If we could tear
> these apart, then Romanian would be OK.

It should be possible to tear them apart at LyX level. Currently, both 
Theorem and Theorem* use \theoremname. It should work to do something like

Style Theorem
Preamble
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
EndPreamble
LangPreamble
\providecommand{\theoremname}{_(Theorem[[numbered]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem[[numbered]])}}
EndBabelPreamble
End

Style Theorem*
Preamble
\theoremstyle{plain}
\newtheorem*{thm*}{\protect\theoremnamestarred}
EndPreamble
LangPreamble
\providecommand{\theoremnamestarred}{_(Theorem[[unnumbered]])}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\theoremnamestarred}
{_(Theorem[[unnumbered]])}}
EndBabelPreamble
End

I don't know if the [[context]] machinery works with the layout file 
translation machinery, but if not it should be easy to fix.

The drawback of this is however that it makes the LaTeX code more 
complicated for all languages, not only for Romanian. Apart from that it is 
also too late to include this in 2.0.0 IMHO, since it would need some 
testing.

A more elegant solution would probably be to extend the layout file syntax 
so that language specific preambles can be used. With this extended syntax 
it would be possible to put Valentins code in the .layout files and use it 
only for Romanian, but this is definitely 2.1 stuff.

For the 2.0.x series I suggest to create a fix-romanian-theorems.module that 
includes Valentins code. This can then added by all users who use Romanian. 
The module does not need to be ready for 2.0.0, 2.0.1 or later would also 
do, since there are no compatibility issues.


Georg


Reply via email to