Abdelrazak Younes wrote:

> My idea would be to cache the translated text instead of translating
> each time updateLabels() is called. But I am not sure I can do that on
> untranslatable layouts.

They are not different than the translatable ones. The only problem I can
imagine is that the cache could get out of date if somebody changes the
layout file.

> I seem to remember from previous discussions that user-defined layout
> command are not allowed any more.

Wrong. That would mean that nobody could create custom layouts in
~/.lib/layouts. There is no reason to forbid that.

> How is this layout business related to that translateLabel() method? Can
> I just ditch the method and use _() directly?

No. _() would assert if a user defined layout contained a label name with
non-ascii characters. That was the very reason to introduce
Buffer::translateLabel. Besides the slowness is in _(), not the additional
ascii test.

> Another idea would be to translate the layout on first loading and use
> that later on. Then we could continue to support untranslatable layouts.

That would be problematic since the translation depends on the buffer
language. But if you introduce a cache at buffer level it should work.

> I am not sure I got everything right so please explain me.

I hope it is clear now.


Georg

Reply via email to