transifex / transifex-old-core

Translation workflow & crowdsourcing for agile teams. Older, open-source codebase of Transifex.com
https://www.transifex.com/
GNU General Public License v2.0
5 stars 5 forks source link

headers of po-files are modified #16

Open Christoph-Miebach opened 12 years ago

Christoph-Miebach commented 12 years ago

po files uploaded to transifex will have a modified header after downloading (for use; did not check the other cases).

Maybe the behaviour is clear when checking the code, but of course I can provide example files.

The header will mostly be overwritten by the header of the pot file. An example line that will be lost:

Updates (C) 2012 Christoph Miebach christoph.miebach@xxxxxx.yy

This is a real issue if you want to use some older files (with a lot of former translators)

Enable editing the header or keeping the header would seem appropriate to me. (The meta information updates are fine, of course, like "Language-Team:)

Christoph-Miebach commented 12 years ago

Original pot: http://svn.videolan.org/dl.php?repname=VideoLAN+Websites&path=%2Fwww.videolan.org%2Flocale%2Fwebsite.pot&rev=7336&peg=7336&

original de.po: http://svn.videolan.org/dl.php?repname=VideoLAN+Websites&path=%2Fwww.videolan.org%2Flocale%2Fde%2FLC_MESSAGES%2Fwebsite.po&rev=7336&peg=7336&

So far, used as a sandbox waiting for "Automatically update source file" : https://www.transifex.net/projects/p/videolan/resource/website/

jkal commented 12 years ago

Hi,

Transifex only keeps a template from the original POT file and, as you described, comments in downloaded language files will be overwritten by those in the source file. This is a design decision and is not easily changed as we don't keep a copy of the translated file.

The only information that is preserved is the copyright lines with the translator names, if they are in a standard format so that they can be parsed by Transifex.

In your translated file, the last 2 copyright lines (starting with the word "Updates") are not recognized by Transifex. Here is the regular expression used to parse the copyright line: https://github.com/transifex/transifex/blob/devel/transifex/resources/formats/pofile.py#L84

Christoph-Miebach commented 12 years ago

The po files i checked use lines like this frequently:

Me my@address.com, 2010-2012.

Me my@address.com, in 2012.

Me my@address.com in 2010.

The 3rd lacks the , so it's harder to fix. This will pick all: ('^# (.*?)[,- ]\d{4}.?$')

AFAIK Comments pointing to the source /path/to/code.h:LLLL always have a : in front of the numbers.