From Fedora Project Wiki

m (Add Category)
m (SOP Formatting)
Line 1: Line 1:
= Translations - SOP =
{{header|infra}}
{{shortcut|ISOP:TRANSLATE|ISOP:TX}}


{{ Admon/note | This is still not official/standarized, at least until this notice is removed.}}
{{ Admon/note | This is still not official/standarized, at least until this notice is removed.}}
[[L10N| Translators]]  contribute to a multitude of ever-changing projects and repositories, and need a central place/tool to give them a high-level view of their work.  We provide Transifex and Damned Lies on http://translate.fedoraproject.org/ to serve that purpose.


== Contact Information ==
== Contact Information ==
Line 17: Line 20:
[[L10N| Translators]]  contribute to a multitude of ever-changing projects and repositories, and need a central place/tool to give them a high-level view of their work. To make things worse, in Fedora we support >1 types of Version Control Systems (VCSs). The tools we provide to make the work of the Fedora Localization Project (FLP) easier include:
[[L10N| Translators]]  contribute to a multitude of ever-changing projects and repositories, and need a central place/tool to give them a high-level view of their work. To make things worse, in Fedora we support >1 types of Version Control Systems (VCSs). The tools we provide to make the work of the Fedora Localization Project (FLP) easier include:


1. An instance of GNOME's '''Damned Lies''', deployed at http://translate.fedoraproject.org/, which provides translation statistics (pull) for all the modules the FLP is interested in. Our templates differ significantly from upstream, but we try not to alter python files downstream (we prefer to submit patches upstream), although some python files do have some very small changes.
# An instance of GNOME's '''Damned Lies''', deployed at http://translate.fedoraproject.org/, which provides translation statistics (pull) for all the modules the FLP is interested in. Our templates differ significantly from upstream, but we try not to alter python files downstream (we prefer to submit patches upstream), although some python files do have some very small changes.
1. An instance of '''Transifex''' ([https://fedorahosted.org/transifex/ source] , deployed at https://translate.fedoraproject.org/submit/, which provides a submission interface (push) for translators (members of the 'cvsl10n' group).
# An instance of '''Transifex''' ([https://fedorahosted.org/transifex/ source] , deployed at https://translate.fedoraproject.org/submit/, which provides a submission interface (push) for translators (members of the 'cvsl10n' group).


== Damned Lies ==
== Damned Lies ==
Line 28: Line 31:
=== Add a module to DL ===
=== Add a module to DL ===


1. Check anonymous checkout
<ol>
<li> Check anonymous checkout
<pre>cd temp
<pre>cd temp
git clone http://...
git clone http://...
</pre>
</pre>
1. Check out (or update) flpweb:
</li><li> Check out (or update) flpweb:
<pre>export CVSROOT=:ext:FEDORA_USERNAME@cvs.fedoraproject.org:/cvs/l10n
<pre>export CVSROOT=:ext:FEDORA_USERNAME@cvs.fedoraproject.org:/cvs/l10n
cvs co web
cvs co web
Line 42: Line 46:
cvs up -C
cvs up -C
</pre>
</pre>
1. Add relevant entries to [http://cvs.fedoraproject.org/viewcvs/web/flpweb/people.xml.in?root=l10n&view=markup people.xml.in] , [http://cvs.fedoraproject.org/viewcvs/web/flpweb/fedora-modules.xml.in?root=l10n&view=markup fedora-modules.xml.in] , [http://cvs.fedoraproject.org/viewcvs/web/flpweb/releases.xml.in?root=l10n&view=markup releases.xml.in] ).
<li> Add relevant entries to [http://cvs.fedoraproject.org/viewcvs/web/flpweb/people.xml.in?root=l10n&view=markup people.xml.in] , [http://cvs.fedoraproject.org/viewcvs/web/flpweb/fedora-modules.xml.in?root=l10n&view=markup fedora-modules.xml.in] , [http://cvs.fedoraproject.org/viewcvs/web/flpweb/releases.xml.in?root=l10n&view=markup releases.xml.in] ).
1. Test changes:
</li><li> Test changes:
<pre>make
<pre>make
python update-stats.py <modulename>
python update-stats.py <modulename>
</pre>
</pre>
{{Admon/caution | Open up browser at http://flpweb.localhost/module/MODULENAME and make sure stats show up OK.}}
{{Admon/caution | Open up browser at http://flpweb.localhost/module/MODULENAME and make sure stats show up OK.}}
1. Update translations
</li><li> Update translations
<pre>cd po
<pre>cd po
ls *po | cut -f1 -d'.' | xargs -I'{}' intltool-update -d '{}'
ls *po | cut -f1 -d'.' | xargs -I'{}' intltool-update -d '{}'
cd ..
cd ..
</pre>
</pre>
1. Commit, mark as LIVE:
</li><li> Commit, mark as LIVE:
<pre>cvs commit -m 'Added module foo. Tested, marking as LIVE'
<pre>cvs commit -m 'Added module foo. Tested, marking as LIVE'
cvs tag -F LIVE
cvs tag -F LIVE
</pre>
</pre>
1. Let people know: Send an email to [mailto:fedora-trans-list@redhat.com fedora-trans-list]  and let translators know, or ask the maintainer to do it (better).
</li><li> Let people know: Send an email to [mailto:fedora-trans-list@redhat.com fedora-trans-list]  and let translators know, or ask the maintainer to do it (better).
</li></ol>


== Transifex: Setup submissions (eponymous checkout/in) ==
== Transifex: Setup submissions (eponymous checkout/in) ==
Line 66: Line 71:
{{ Admon/note | If the repository is on Fedora Hosted Projects, then have a group administrator add the "transif" user to their FAS group.}}
{{ Admon/note | If the repository is on Fedora Hosted Projects, then have a group administrator add the "transif" user to their FAS group.}}


1. SSH to the puppet server
<ol>
<li> SSH to the puppet server
<pre>ssh bastion.fedoraproject.org
<pre>ssh bastion.fedoraproject.org
ssh puppet1
ssh puppet1
</pre>
</pre>
1. Create an SSH key and add it to the private CVS repository:
</li><li> Create an SSH key and add it to the private CVS repository:
<pre>N='MODULENAME'; ssh-keygen -t dsa -C transifex-$N -f id_dsa-$N
<pre>N='MODULENAME'; ssh-keygen -t dsa -C transifex-$N -f id_dsa-$N
</pre>
</pre>
1. Add the SSH key filename to configs/web/applications/transifex-ssh-add.sh.
</li><li> Add the SSH key filename to configs/web/applications/transifex-ssh-add.sh.
1. Send the public key of the key to the module owner and ask him to create a user on his VCS with this public key. If they can, they may restrict the user's access only to certain files (eg. in the po/ subdirectory). Continue to the next step when you receive an affirmative reply.
</li><li> Send the public key of the key to the module owner and ask him to create a user on his VCS with this public key. If they can, they may restrict the user's access only to certain files (eg. in the po/ subdirectory). Continue to the next step when you receive an affirmative reply.
</li></ol>


=== Part 2: Check access ===
=== Part 2: Check access ===
1. SSH again as last step.
<ol>
1. Check eponymous checkout:
<li> SSH again as last step.
</li><li> Check eponymous checkout:
<pre>ssh app3
<pre>ssh app3
sudo -H -u transifex -s
sudo -H -u transifex -s
Line 87: Line 95:
git checkout BRANCHNAME
git checkout BRANCHNAME
</pre>
</pre>
1. Check eponoymous checkin:
</li><li> Check eponoymous checkin:
<pre>cd MODULENAME/po
<pre>cd MODULENAME/po
git commit -m 'Testing Transifex instance on Fedora with a very minor change. Please ignore.'
git commit -m 'Testing Transifex instance on Fedora with a very minor change. Please ignore.'
git push
git push
</pre>
</pre>
</li></ol>


=== Part 3: Add to transifex ===
=== Part 3: Add to transifex ===
1. Navigate to https://translate.fedoraproject.org/submit/repo/add and add the repo.
<ol>
1. Navigate to https://translate.fedoraproject.org/submit/module/add and add the module as disabled. ({{Template:Caution}} Sometimes the repo isn't added and the server needs restart!?)
<li> Navigate to https://translate.fedoraproject.org/submit/repo/add and add the repo.
</li><li> Navigate to https://translate.fedoraproject.org/submit/module/add and add the module as disabled. ({{Template:Caution}} Sometimes the repo isn't added and the server needs restart!?)
* If the branch name doesn't exist in the list:
* If the branch name doesn't exist in the list:
<pre>tg-admin shell
<pre>tg-admin shell
Line 104: Line 114:
m.addBranch()
m.addBranch()
</pre>
</pre>
1. Open up the console and check that the module checks out correctly:
</li><li> Open up the console and check that the module checks out correctly:
<pre>tg-admin shell
<pre>tg-admin shell
m=Module.selectBy(name='yumex')[0]  
m=Module.selectBy(name='yumex')[0]  
Line 111: Line 121:
m.disabled = False
m.disabled = False
</pre>
</pre>
1. Login to the web front-end and commit a file. https://translate.fedoraproject.org/submit/module/MODULENAME
</li><li> Login to the web front-end and commit a file. https://translate.fedoraproject.org/submit/module/MODULENAME
</li></ol>


=== Part 4: Let people know ===
=== Part 4: Let people know ===


1. Send an email to the module maintainer and let him know
# Send an email to the module maintainer and let him know
1. [mailto:fedora-trans-list@redhat.com?subject=New%20module%20added%20in%20Transifex:%20MODULENAME Send an email]  to [mailto:fedora-trans-list@redhat.com fedora-trans-list]  and let translators know, or ask the maintainer to do it (better).
# [mailto:fedora-trans-list@redhat.com?subject=New%20module%20added%20in%20Transifex:%20MODULENAME Send an email]  to [mailto:fedora-trans-list@redhat.com fedora-trans-list]  and let translators know, or ask the maintainer to do it (better).




Line 164: Line 175:


[[Category:Infrastructure SOPs]]
[[Category:Infrastructure SOPs]]
[[Category:Localization]]

Revision as of 03:59, 18 February 2009

Shortcuts:
ISOP:TRANSLATE
ISOP:TX
Note.png
This is still not official/standarized, at least until this notice is removed.

Translators contribute to a multitude of ever-changing projects and repositories, and need a central place/tool to give them a high-level view of their work. We provide Transifex and Damned Lies on http://translate.fedoraproject.org/ to serve that purpose.

Contact Information

Owner:: Fedora Infrastructure Team, Fedora Translation Team

Contact:: DimitrisGlezos, MikeMcGrath, RickyZhou, #fedora-admin, sysadmin-web group

Servers:: app1, app2 (stats), app3, app4 (transifex)

Purpose:: Provides translators front-ends to translation statistics (damned-lies) and submissions (Transifex) to various VCSs

Description

Translators contribute to a multitude of ever-changing projects and repositories, and need a central place/tool to give them a high-level view of their work. To make things worse, in Fedora we support >1 types of Version Control Systems (VCSs). The tools we provide to make the work of the Fedora Localization Project (FLP) easier include:

  1. An instance of GNOME's Damned Lies, deployed at http://translate.fedoraproject.org/, which provides translation statistics (pull) for all the modules the FLP is interested in. Our templates differ significantly from upstream, but we try not to alter python files downstream (we prefer to submit patches upstream), although some python files do have some very small changes.
  2. An instance of Transifex (source , deployed at https://translate.fedoraproject.org/submit/, which provides a submission interface (push) for translators (members of the 'cvsl10n' group).

Damned Lies

  • Relevant contacts: DimitrisGlezos, DiegoZacarao.
  • Important files are some xml.in files in /cvs/l10n/web/flpweb/.
  • See also: L10N/ResourceMaintainers .

Add a module to DL

  1. Check anonymous checkout
    cd temp
    git clone http://...
    
  2. Check out (or update) flpweb:
    export CVSROOT=:ext:FEDORA_USERNAME@cvs.fedoraproject.org:/cvs/l10n
    cvs co web
    cd web/flpweb
    <!--# OR just update:
    -->
    cd web/flpweb
    cvs -n up
    cvs up -C
    
  3. Add relevant entries to people.xml.in , fedora-modules.xml.in , releases.xml.in ).
  4. Test changes:
    make
    python update-stats.py <modulename>
    
    Stop (medium size).png
    Open up browser at http://flpweb.localhost/module/MODULENAME and make sure stats show up OK.
  5. Update translations
    cd po
    ls *po | cut -f1 -d'.' | xargs -I'{}' intltool-update -d '{}'
    cd ..
    
  6. Commit, mark as LIVE:
    cvs commit -m 'Added module foo. Tested, marking as LIVE'
    cvs tag -F LIVE
    
  7. Let people know: Send an email to fedora-trans-list and let translators know, or ask the maintainer to do it (better).

Transifex: Setup submissions (eponymous checkout/in)

  • Relevant contacts: DimitrisGlezos, MikeMcGrath, RickyZhou.

Part 1: Setup the keys

Note.png
If the repository is on Fedora Hosted Projects, then have a group administrator add the "transif" user to their FAS group.
  1. SSH to the puppet server
    ssh bastion.fedoraproject.org
    ssh puppet1
    
  2. Create an SSH key and add it to the private CVS repository:
    N='MODULENAME'; ssh-keygen -t dsa -C transifex-$N -f id_dsa-$N
    
  3. Add the SSH key filename to configs/web/applications/transifex-ssh-add.sh.
  4. Send the public key of the key to the module owner and ask him to create a user on his VCS with this public key. If they can, they may restrict the user's access only to certain files (eg. in the po/ subdirectory). Continue to the next step when you receive an affirmative reply.

Part 2: Check access

  1. SSH again as last step.
  2. Check eponymous checkout:
    ssh app3
    sudo -H -u transifex -s
    export SSH_AUTH_SOCK=/var/lib/transifex/ssh-agent-sock-transifex
    ssh-add ~/.ssh/id_dsa-REPONAME
    cd temp
    git clone git+ssh://...
    git checkout BRANCHNAME
    
  3. Check eponoymous checkin:
    cd MODULENAME/po
    git commit -m 'Testing Transifex instance on Fedora with a very minor change. Please ignore.'
    git push
    

Part 3: Add to transifex

  1. Navigate to https://translate.fedoraproject.org/submit/repo/add and add the repo.
  2. Navigate to https://translate.fedoraproject.org/submit/module/add and add the module as disabled. (Warning.png Sometimes the repo isn't added and the server needs restart!?)
    • If the branch name doesn't exist in the list:
    tg-admin shell
    m=Module.selectBy(name='yumex')[0] 
    m.name
    m.branches
    b=Branch(name='yumex-2.0')
    m.addBranch()
    
  3. Open up the console and check that the module checks out correctly:
    tg-admin shell
    m=Module.selectBy(name='yumex')[0] 
    m.name
    m.checkout()
    m.disabled = False
    
  4. Login to the web front-end and commit a file. https://translate.fedoraproject.org/submit/module/MODULENAME

Part 4: Let people know

  1. Send an email to the module maintainer and let him know
  2. Send an email to fedora-trans-list and let translators know, or ask the maintainer to do it (better).


Troubleshooting and Resolution

Module statistics in DL show various errors and warnings

Most likely the module provides a POT file instead of having i18n support through intltool, which can build the POT on the fly, list available languages in po/LINGUAS etc. This is usually normal, although it could be considered a good opportunity to remind developers to use intltool. :)

Module statistics in DL are inexistent or weird

Someone added a module without checking its correctness with python update-stats.py <modulename>. XML files need editing.

Start/stop transifex service

You will need the transifex SSH key passphrase for this.

# If ssh-agent isn't already running:
sudo -u transifex /srv/tg/transifex/ssh-add.sh
ssh app{3,4}

sudo supervisorctl start transifex

sudo supervisorctl stop transifex

sudo supervisorctl restart transifex

Update only a few modules

#!/bin/bash

export MODULES='module1 module2'
export BACKUPDIR=/var/tmp/l10n-data/scratchdir/temp/

mkdir -p $BACKUPDIR
cd /srv/web/translation/

for m in $MODULES
do
mv /var/tmp/l10n-data/scratchdir/{cvs,svn,hg,git}/$m.* $BACKUPDIR
python update-stats.py $m /var/log/fedora-l10n/update-stats.<code>date +\%F</code>.log
done