/kde-pootle

Pootle instance for Malayalam localization of KDE

Primary LanguageHTMLGNU General Public License v3.0GPL-3.0

Pootle Instance For KDE

Trying to integrate KDE translation with Pootle for easy translation.

Translation

The website is run with a software called Pootle for translation.

IMPORTANT : There maybe a Your names (NAME OF TRANSLATORS) and email to Your emails (EMAIL OF TRANSLATORS) string in the file. Add your name and email to it. This value gets displayed in program's About menu. If there already exist a value, add yours after a comma.

The Your names and Your emails strings will only exist in some files. If it exist, do add your name to it !

Example :

  • Your names :
    ശ്യാം കൃഷ്ണന്‍ സി.ആര്‍.,സുബിന്‍ സിബി
    
  • Your emails :
    shyam@example.com,subin@example.com
    

Tools

These tools can be used to help in localization.

Priority List

Consider translating these files :

Choose files based on the activity. Completing a file is important than small work on individual files.

Setup

  • Install pootle

    This repo use pipenv

    export PIPENV_VENV_IN_PROJECT=1
    pipenv install
    
  • Link pootle.conf :

    pootle init
    ln -s $(realpath pootle.conf) ~/.pootle/pootle.conf
    
  • pootle initdb --no-projects

  • Make the translations folder.

    mkdir translations
    mkdir translations/l10n-kf5
    mkdir translations/l10n-kf5/templates/
    ln -s $(realpath translations) .venv/lib/python2.7/site-packages/pootle/translations
    ln -s $(realpath custom_templates) .venv/lib/python2.7/site-packages/pootle/custom_templates
    ln -s $(realpath log) .venv/lib/python2.7/site-packages/pootle/log
    
  • Extra : set up elasticsearch for translation memory

Running

Get into the virtual environment shell and run pootle runserver --insecure

or use the start.sh script to run in background :

nohup bash start.sh > foo.out 2> foo.err < /dev/null &

Use pkill -f pootle to kill the process.

Adding Project To Pootle

KDE's l10n repository is using Subversion. A mirror of it under git is used by us. Do the following process in that repo.

The Mirror git repo

These steps should be done in the mirror git repo

Find the package to add from here. Example : applications, kde-workspace

  • Set the package :

    export REPO_ROOT=$PWD
    export PACKAGE=''
    
  • Get the template files :

    cd $REPO_ROOT/l10n-kf5/templates
    svn checkout svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/templates/messages/$PACKAGE $PACKAGE
    
  • Get the language files :

    export LANG_CODE='ml'
    mkdir $REPO_ROOT/l10n-kf5/$LANG_CODE
    cd $REPO_ROOT/l10n-kf5/$LANG_CODE
    svn checkout svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/$LANG_CODE/messages/$PACKAGE $PACKAGE
    

Pootle

  • Setup a SSH key and add it as deploy key to the mirror git repo

  • Clone the mirror repo to Pootle base directory (this repo base) :

    git clone git@github.com:FOSSersVAST/kde-ml.git translations
    
  • Open Pootle admin and add project

    The following project variables need to be changed :

    • Code : l10n-kf5
    • Full Name : KDE 5 Trunk
    • File types : Gettext PO
    • Path or URL : {POOTLE_TRANSLATION_DIRECTORY}l10n-kf5
    • Path mapping preset : non-GNU style
    • Template name : templates

    The extra options are only in Pootle 2.9

  • Sync Pootle :

    pootle fs add l10n-kf5
    pootle fs fetch l10n-kf5
    pootle fs sync l10n-kf5
    

Mirror git repo

These things should be used on the mirror git repo.

Updating to KDE Upstream

The master branch must be kept up-to-date with KDE upstream.

For trunk localization branch :

export REPO_ROOT=$PWD
export LANG_CODE='ml'

for PACKAGE in $(ls $REPO_ROOT/l10n-kf5/templates); do
  echo $PACKAGE
  cd $REPO_ROOT/l10n-kf5/templates/$PACKAGE && svn update
  cd $REPO_ROOT/l10n-kf5/$LANG_CODE/$PACKAGE && svn update
done

Committing Pootle changes to Mirror git repo

Do these in the server's translations folder

  • Pull updates from KDE upstream :
    git checkout master
    git pull
    
  • Switch to pootle branch, merge upstream changes and sync :
    git checkout pootle
    git merge --no-ff master
    pootle fs sync l10n-kf5
    # Maybe have to do add & fetch
    # pootle fs add l10n-kf5
    # pootle fs fetch l10n-kf5
    # pootle fs sync l10n-kf5
    
    This will pull changes from Pootle to files
  • Update file headers :
    bash update-changed-pos-header.sh
    
  • Commit and push :
    git commit -a -m "Updates $(date)"
    git push origin pootle
    

Merging trunk & stable

Work is done on trunk branch and similar localizations from it are merged to stable. There will be two folders, l10n-kf5 for trunk branch of KDE Framework 5 and stable-kf5 for the stable branch (which we will clone).

  • Pull all changes to trunk
  • In the mirror git repo, checkout a new branch for our temporary work (this branch will be deleted at the end) :
    git checkout -b stable
    mkdir stable-kf5
    
  • Clone the KDE upstream's stable branch :
    cd stable-kf5
    svn co svn+ssh://svn@svn.kde.org/home/kde/branches/stable/l10n-kf5/ml/messages ml
    
    The folder structure will be like :
    * l10n-kf5
      * ml
        * applications
      * templates
    * stable-kf5
      * ml
        * applications
        * kde-workspace
        * ...
    
  • Run the merge-to-stable.sh script

Committing to KDE upstream

  • Get developer access to KDE SVN
  • Checkout PO files :
    svn co svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-kf5/ml/messages
  • Copy files from Mirror git repo to the checked out PO files
  • Add files and commit
    # Add all files
    svn status | grep '?' | sed 's/^.* /svn add /' | bash
    svn commit -m 'Update malayalam localizations'