Summary: | malformed syspref.po file | ||
---|---|---|---|
Product: | Koha | Reporter: | Paul Poulain <paul.poulain> |
Component: | I18N/L10N | Assignee: | Frédéric Demians <f.demians> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | bgkriegel, f.demians, ztajoli |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed patch
[SIGNED-OFF] Bug 10214 Add header to syspref po files [PASSED QA] Bug 10214 Add header to syspref po files |
Description
Paul Poulain
2013-05-07 16:22:01 UTC
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 |