Le 2 juin 09 à 19:11, rgheck a écrit :
I've worked on this a bit, but it is a bit harder than it seemed it
might be. I don't think there's anything we can reliably translate
where you put the FIXME. We do this:
counterLabel(it->second.flatLabelString(appendix()))
but flatLabelString() is calculated, so we can't reliably translate
that. What we need to translate is the LabelString itself, I think,
but it's not at all clear when to do that.
Could we have a Counters:setLanguage method that we call before
computing the labelstrings?
One idea would be to do it when we calculate the flat label string,
but we don't have information on the paragraph language at that
point, so that would be less than ideal. But I don't really see what
else we can do.
Does it mean that this flat label stuff needs to be reverted? Maybe,
unfortunately... Or we could have an expansion cache that
depends on the language. I suspect this is getting complicated.
Toward doing something here, though, and starting from a FIXME of
yours, I've got the following patch, which seems to work. Does this
seem OK? If we had this, then we could do the translation, as
suggested, just when we calculate flat label strings, which will be
only when the document class is changed. Though maybe we'd also need
to do it whenever the BufferParams change, since then the Buffer
language might have been changed.
And the problem is probably that we cannot have "Chapter 1" and
"Chapitre 2" in the same document anymore (but this is my fault,
not your patch's).
JMarc