The ln-LN-pref.po file (in misc/translator/po/, generated by ./translate install|update ln-LN is malformed. It lacks the .po header that is in other i18n files: # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2013-05-07 08:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" Without this header, a tool like transifex complains (and refuses to upload the file). Adding it fixes the problem
The header is useful also for a GUI tool like Poedit
Le 07/05/2013 18:42, Bernardo Gonzalez Kriegel a écrit :> > I use to download syspref.po, add the header and then upload to pootle. > We may check how is created/updated. > The .po files are generated by misc/translator/translate script. Digging a little, I've found that the culprit is probably in LangInstaller.pm, sub save_po { my $self = shift; # Write .po entries into a file put in Koha standard po directory Locale::PO->save_file_fromhash( $self->po_filename, $self->{po} ); say "Saved in file: ", $self->po_filename if $self->{verbose}; Other .po are generated by tmpl_process3.pl AFAIK (but i'm not a translation process specialist, I may be wrong)
Can anyone post the missing header here as a comment? I will take a look at how to add it directly from the translation script.
Created attachment 18132 [details] [review] Proposed patch With this patch, header is created when creating a new syspref .po file for a new language (translate create), and is added if it doesn't already exist when updating an existing language (translate update). To test: (1) Create a new language syspref file: ./translate create -p xx-XX Check that there is an header (2) Update an existing syspref file without header: ./translate update fr-FR Check that fr-FR-pref.po has a header (3) Update an existing syspref file with header: Modify fr-FR-pref.po. Add an email, or whatever. ./translate update fr-FR Check that fr-FR-pref.po has a header with the manual modification
This patch applies on master and 3.12 branch
Created attachment 18133 [details] [review] [SIGNED-OFF] Bug 10214 Add header to syspref po files With this patch, header is created when creating a new syspref .po file for a new language (translate create), and is added if it doesn't already exist when updating an existing language (translate update). To test: (1) Create a new language syspref file: ./translate create -p xx-XX Check that there is an header (2) Update an existing syspref file without header: ./translate update fr-FR Check that fr-FR-pref.po has a header (3) Update an existing syspref file with header: Modify fr-FR-pref.po. Add an email, or whatever. ./translate update fr-FR Check that fr-FR-pref.po has a header with the manual modification Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described. No errors.
Created attachment 18142 [details] [review] [PASSED QA] Bug 10214 Add header to syspref po files With this patch, header is created when creating a new syspref .po file for a new language (translate create), and is added if it doesn't already exist when updating an existing language (translate update). To test: (1) Create a new language syspref file: ./translate create -p xx-XX Check that there is an header (2) Update an existing syspref file without header: ./translate update fr-FR Check that fr-FR-pref.po has a header (3) Update an existing syspref file with header: Modify fr-FR-pref.po. Add an email, or whatever. ./translate update fr-FR Check that fr-FR-pref.po has a header with the manual modification Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described. No errors. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass. Also tested that updated pref files can still be installed correctly.
This patch has been pushed to master and 3.12.x.
Pushed to 3.10.x, will be in 3.10.7 This solves translation files issues, I think is good for 3.10