Shihira / gnome-extension-quicktoggler

DEPRECATED: Switched to KDE, so goodbye friends. Toggling services, launching apps in one click.
https://extensions.gnome.org/extension/1077/quick-toggler/
40 stars 9 forks source link

Add localization support #6

Closed jonnius closed 7 years ago

jonnius commented 7 years ago

Please add localization support. I would do so, but I don't know how since you outsourced the strings into a glade file... I would like to contribute a German translation.

Shihira commented 7 years ago

Thanks for your support.

Initially I meant to skip the step of creating gettext translation because I thought this extension is just for my personal use. Now that it did gathers some users, which quite surprises me actually, maybe it's time to do some translation.

Nearly(or literally?) all the text that requires translation is in the preference window. The extension popup-menu itself simply has no text except for the filter place-holder text.

I will try to add translation to preference window, while it is still hard to test because I don't have the language environment of another. Changing language of gnome is a headache.

jonnius commented 7 years ago

I am happy to hear that you are going to implement localization support. If you might have problems with the commands from the official tutorial, you can use the function initTranslations() from your convenience.js. Have a look at this example.

jonnius commented 7 years ago

Great to see, you implemented localization support. Would you please provide the translation template file (pot), too?

Shihira commented 7 years ago

@jonnius

I am not sure if this is what you need: https://github.com/Shihira/gnome-extension-quicktoggler/blob/master/quicktoggler%40shihira.github.com/locale/zh_CN/LC_MESSAGES/gnome-extension-quicktoggler.po though it is a filled po instead of a template (and a little bit out-dated because I forgot to add translation after adding some new UI elements). I did not attempt to translate any other places besides the preference window.

Or if that doesn't satisfy, can it be simply generate by executing commands as follows?

cd quicktoggler@shihira.github.com
mkdir -p locale/${LANG/.*/}/LC_MESSAGES
xgettext prefs.glade -o locale/${LANG/.*/}/LC_MESSAGES/gnome-extension-quicktoggler.po

Thank you for you support. And your PR will be welcome.

jonnius commented 7 years ago

The idea of the template (an empty po, called pot) is that you keep it up-to-date and translators may use it start or update a translation. I can create it along with the german translation.

Shihira commented 7 years ago

@jonnius

I see. I will create one in future commits.