coldfix / udiskie

Automounter for removable media
MIT License
866 stars 53 forks source link

How can I make my own translation? #204

Closed stefano-mecocci closed 4 years ago

stefano-mecocci commented 4 years ago

Hi, I have just discovered this program and it works perfectly. Just one thing, how can I add a translation? In this case Italian

And, how can I enable it?

coldfix commented 4 years ago

Hi,

thanks for wanting to help improve udiskie!

Just one thing, how can I add a translation? In this case Italian

Go to the lang/ subfolder in the repository, and execute msginit (with the correct locale set). Alternatively, copy the lang/udiskie.pot file to lang/it_IT.po, and edit it to fill in the translations. For more documentation see section 6 Creating a New PO File of the GNU gettext documentation.

python setup.py build will then take care of compiling it into a binary format that can be loaded at runtime. If you provide a pull-request with the file, it will be included in the next version.

And, how can I enable it?

Make sure that your locale is set correctly (can be done via environment variables per application), see Setting the POSIX Locale. If you want to test your translations, this guide might be of help, ~but I haven't tried it yet.~ Actually, seems to work:

LANG=it_IT.utf-8 LANGUAGE=$(pwd)/build/locale/it_IT:it_IT udiskie

Best, and many thanks, Thomas