Finding local translations?

Boudewijn Rempt boud at valdyas.org
Sun Apr 10 11:16:02 UTC 2016


On Sat, 9 Apr 2016, Chusslove Illich wrote:

>>> [: Boudewijn Rempt :]
>>> However, KCatalog::catalogLocaleDir is run before the main runs, and uses
>>> QStandardPaths to find the location of the translations. That's before
>>> the XDG_DATA_DIRS environment variable is set.
>>
>> [: Alexander Potashev :]
>> You can use a wrapper application that runs Krita with XDG_DATA_DIRS set
>> to whatever appropriate. Of course this is dirty, and we should instead
>> support custom paths to .mo files in KI18n.
>
> I don't think there should be specific support in KI18n for setting custom
> paths. What makes KI18n special compared to other code that uses
> QStandardPaths?

Well... My goal is to make it possible to run krita without any environment
variables set. I already have a wrapper around QStandardPaths that also adds
paths relative to the executable itself. I also don't want wrapper applications
because that gives weird results in the task manager.

> Regarding KCatalog::catalogLocaleDir being called before main runs in Krita,
> I don't know why that is happening. KCatalog::catalogLocaleDir should first
> execute when the first translation call happens (or first
> availableDomainTranslations/availableApplicationTranslations call). I
> checked it now with KWrite, and that is what is happening. I could happily
> munge XDG_DATA_DIRS before QApplication in KWrite is created, and KCatalog
> would heed it.

I will check that.

-- 
Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org


More information about the Kde-frameworks-devel mailing list