Skip to content

Bi-directionnal synchronization for Kano translation files

License

Notifications You must be signed in to change notification settings

mandre/kano-i18n-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kano-i18n-sync

Scripts to allow bi-directional synchronization between Kano Linux and the Zanata translation service. Upload strings to the translation server and pull latest translated files from it into your Kano distribution.

We've created Zanata translation projects for the following apps:

Setup

The scripts depend on zanata-python-client to communicate with the Zanata server and polib to work with translation files. It also needs paramiko to connect to the Kano computer via SSH and pyyaml to read yaml files. To install these packages on Fedora, run:

sudo dnf install python3-zanata-client python3-polib python3-paramiko python3-pyyaml

Create yourself an account on Zanata if you haven't done so, generate your API key, and copy the content of zanata.ini that you need to place in a new file named $HOME/.config/zanata.ini

Enable SSH access to Kano

Now you need to prepare your Kano computer so that the scripts can connect to it. To turn on the SSH server on the Kano box, go to the Advanced setting and enable SSH. From the computer that is going to run the scripts, add a kano host to your $HOME/.ssh/config file, for instance:

Host kano
  Hostname 192.168.1.15
  User your_username

Finally, copy your keys to the Kano computer:

ssh-copy-id kano

Verify you're able to connect to your Kano computer with:

ssh kano

Prepare Kano

Sudo access

Copy the sudoers.conf file to Kano:

scp sudoers.conf kano:

Once logged it to Kano via SSH:

sudo chown root.root sudoers.conf
sudo mv sudoers.conf /etc/sudoers.d/kano-i18n-sync_conf

Install dependencies

On Kano:

sudo apt-get update
sudo apt-get install *-i18n-orig zip

You may also want to install localized versions of some applications:

sudo apt-get install chromium-browser-l10n libreoffice-l10n-fr

Change locale on Kano

On Kano:

sudo dpkg-reconfigure locales

Usage

Upload updated translation templates upon new Kano release (for maintainers only)

The sync_pot.py script connects to the Kano computer to retrieve the latest translation templates then takes care of creating the project and new versions on Zanata, before uploading the template files to it.

It is intended for the admins for the translation projects on Zanata and should be run each time Kano release a new version of their distribution.

The script does not take options, simply invoke it with:

./sync_pot.py

Pull latest translations from Zanata and update Kano

The pull_translations.py script does more or less the opposite. It pulls the latest translated content from Zanata and copies it to the Kano computer in a format that Kano understands.

This is intended for Kano users and can be run any time to update translations to their latest version.

You need to pass it a locale name that is valid on the Zanata server, for instance:

./pull_translations.py --lang fr

About

Bi-directionnal synchronization for Kano translation files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages