[Tails-l10n] Deadline 2018-06-29 [Tails-dev] Please test pre…

Nachricht löschen

Nachricht beantworten
Autor: u
Datum:  
To: The Tails public development discussion list, Tails localization discussion, tails-l10n-pt-br, tails it
CC: Sandro Knauß
Alte Treads: Re: [Tails-dev] Please test pre-commit hook for po files
Betreff: [Tails-l10n] Deadline 2018-06-29 [Tails-dev] Please test pre-commit hook for po files
Fellow translators and developers,

three weeks ago I've asked on your lists to test a Git hook we've
implemented. We've improved this hook and created a script to make your
po files comply with this hook. Before we merge this and enable it by
default please test this. Deadline Friday 23:59 Berlin time, June 29th 2018.

Git hook for PO files
=====================

(Assuming tails.git is called `tails` as a remote.)
In order to enable the git hook (& assuming you have none enabled yet):

    git checkout -t tails/translation_platform_hooks
    git submodule update --init
    cd .git/hooks
    ln -s ../../bin/pre-commit-translation pre-commit


The hook will only run when you try to commit a PO file, not when
working on other files.

Expected format
===============

Now, running it as it, will likely result in errors, because the hook
assumes a certain format of PO files and its headers:

- PO files are supposed to be wrapped at 79 chars per line, this is
POedit's default.
- empty Project-Id-Version
- Last-Translator: Tails translators <tails-l10n@???>
- Language-Team: Tails translators <tails-l10n@???>

This is because we want to avoid merge conflicts when automatically
merging files on and from the translation platform.

Your name is still in the Git commit, so there is no need to worry about
attribution.

Make your files comply: unify PO headers
========================================

In order to make all files in your language comply you can run our
script in the same branch, where $LANG is your language code, for
example portuguese:

        LANG=pt
    git checkout -t origin/translation_platform_hooks
        ./wiki/src/contribute/l10n_tricks/unify_po-headers.sh $LANG


Now, look at the `git diff`.
Commit all modified files locally.

Then try to edit a PO file like you usually do and see if you can
commit. If you can't:
- try to understand the error message,
- fix it or report back here if it's impossible or you do not understand
the error.

I've also asked for a merge into tails/master of PO files in all
languages cleaned with this unification script but this did not yet
happen. When it will, I'll let you know.

In the future, you could decide to run the unify_po-headers script every
time you want to commit PO files and it'll take care of reformatting
your files.

Cheers!
u.