Amarok scripting: how to get Amarok or KDE current language?

Ian Monroe ian at monroe.nu
Fri Sep 17 22:02:44 CEST 2010


On Thu, Sep 16, 2010 at 11:49 AM, Alexander Potashev
<aspotashev at gmail.com> wrote:
> Hi,
>
> The script Ultimate Lyrics
> (http://kde-apps.org/content/show.php/Ultimate+Lyrics?content=108967)
> has a bug: it does not use proper translations, because it relies upon
> the QLocale.system().name() call, which returns the system locale. It
> always returns "C" for me.
>
> The best solution, I think, would be using the current Amarok
> language. How can it be determined from an Amarok script (written in
> JavaScript)?

QLocale.languageToString(l.language())
returns English
QLocale.system().name()
returns en_US

which makes sense for me. Maybe your system is set at the 'C' language
and KDE is set on something else? So maybe Ultimate Lyrics would work
correctly for people whose system localization is fully functional.

Ian


More information about the Amarok-devel mailing list