Review Request 118678: [ki18n] Allow querying for translations of a specific domain

David Edmundson david at davidedmundson.co.uk
Wed Jun 11 23:09:54 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118678/#review59840
-----------------------------------------------------------


Can I check I'm understanding the objective. 

For the language KCM we want to list all possible languages. Potentially systemsettings isn't translated so won't be listed. In order to get round this we need to pick a random other component that we can assume is translated in order to list all possible languages?

If so we could just do:
    QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
                                 QString::fromLatin1("locale"),
                                 QStandardPaths::LocateDirectory);
    foreach (const QString &localDirPath, localeDirPaths) {
        languages  << localeDir.entryList(QDir::AllDirs);
    }

which is what kcatalog is doing internally and will list everything.



src/kcatalog.cpp
<https://git.reviewboard.kde.org/r/118678/#comment41684>

    This isn't very relevant.



src/klocalizedstring.cpp
<https://git.reviewboard.kde.org/r/118678/#comment41685>

    I'd make this a new static method;
    availablleDomainTranslations(const QByte..)
    
    We're using a method called availableApplicationTranslations to list things outside the application which is going against the name of the method.
    
    


- David Edmundson


On June 11, 2014, 10:09 p.m., Sebastian Kügler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118678/
> -----------------------------------------------------------
> 
> (Updated June 11, 2014, 10:09 p.m.)
> 
> 
> Review request for Plasma, Chusslove Illich and John Layt.
> 
> 
> Repository: ki18n
> 
> 
> Description
> -------
> 
> Allow querying for translations of a specific domain
> 
> In the new translations KCM, we want to list available languages for the
> workspace. This might, or might not be the same application domain as
> the one set (current translation is different from installed
> translations). In order to list the installed translations, we need to
> specify that domain, independently from the one set in
> KLocalizedString's global static.
> 
> With this patch, I can successfully list installed languages in the new KCM.
> 
> 
> I'm not super-familiar with how this stuff works, there might be a better way, 
> in which case I'm sure you guys will enlighten me. :)
> 
> 
> Diffs
> -----
> 
>   src/kcatalog.cpp 7711e9b261fc30d8faa355af9014d320275463a5 
>   src/klocalizedstring.h 1a9fce8abcafcc8be0a2601c9062c33509dd403e 
>   src/klocalizedstring.cpp e12d6dfa9c147ffb127f462dc5db236be0d2ff75 
> 
> Diff: https://git.reviewboard.kde.org/r/118678/diff/
> 
> 
> Testing
> -------
> 
> Tested new translations KCM, languages show up.
> 
> 
> Thanks,
> 
> Sebastian Kügler
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140611/8545c175/attachment.html>


More information about the Plasma-devel mailing list