Oct 142014

With a decent approximation, it is now well over 30 years that I use keyboard.

And there have been oh so many times I’ve cursed the difficulty to reproduce accented characters on US keyboards, forcing the user to find alternative ways like to write the accented vowel followed by an apostrophe (for example, a’ instead of à)… not correct, but still understandable.

Until today when my colleague SerKill (yes, that is his nickname) revealed to me the existence of US International Keyboard layout.

If you configure your laptop to use it (on a Mac, it is System Preferences – Keyboard – Input Sources…), when you want to make an accented vowel letter you simply press first the accent and then the letter.

The accent key you have to press depends if you want to have acute or grave accented vowel as shown in the keyboard layout below:

It is true that you never stop learning…

Thanks, SerKill!

Mar 252013

Continuing on my seafile experiments, I’ve found that they’ve done a pretty good job in offering local language support and this includes italian.

Well, sort of.

I mean, the tranlsation is nice and mostly well done… but sometimes you see part of the UI in… cyrillic???

After my first WTF reaction 🙂 I started checking how to fix this and I got good hints from Seafile as well. I ended up improving the italian language support they offer, and they promise to integrate my efforts in next version (good!).

In case you’re interested in modifying some part of an existing language support in Seafile web UI, what you need to have on your server machine is the following (commands refers to Ubuntu 12.04 LTS):

  • Python 2.7 (if you don’t have it, give a “apt-get install python-2.7” to get it)
  • Django extension to Python (if you don’t have it, give a “apt-get install python-django” to get it)
  • gettext command (if you don’t have it, give a “apt-get install gettext” to get it)

Then, modify the file <seafile_install_directory>/seahub/locale/<your_language_country_code>/LC_MESSAGES/django.po

Replace <your_language_country_code> with the language code your interested in, for example it for Italian.

Change/correct/replace/add the strings you’re missing.

The file logic is based on the string in English, followed by the one in the local language, for example:

#: forms.py:56 templates/snippets/repo_create_js.html:28
msgid "Name can't be empty"
msgstr "Il nome non può essere vuoto"

Once you’re done with your django.po file, copy the existing django.mo file (language file compiled) in the same directory to some other safe place and from <seafile_install_directory>/seahub/ directory type the command:

./i18n.sh compile-all

This should generate a new django.mo file with the modifications you have made.

As a bonus, if you just want to get rid of cyrillic you can copy these two files into <seafile_install_directory>/seahub/locale/<your_language_country_code>/LC_MESSAGES/ in your installation and restart the servers (seafile and seahub).