Bug 9018 - Po file for ccsr theme missing on translate.koha-community.org
Summary: Po file for ccsr theme missing on translate.koha-community.org
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: D Ruth Holloway
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-07 12:13 UTC by Katrin Fischer
Modified: 2014-12-07 20:02 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Italian transaltion of opac-ccsr.po (23.91 KB, text/plain)
2012-11-21 11:36 UTC, Zeno Tajoli
Details
zipped patch with ccsr.po for all languages (265.27 KB, application/x-gzip)
2012-11-23 10:04 UTC, Paul Poulain
Details
Bug 9018 Italian translation of ccsr.po (DISCLAIMER: apply AFTER gz archive) (24.40 KB, patch)
2012-11-23 10:07 UTC, Paul Poulain
Details | Diff | Splinter Review
zipped patch with ccsr.po for all languages (2nd version) (181.66 KB, application/x-gzip)
2012-11-23 10:18 UTC, Paul Poulain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2012-11-07 12:13:58 UTC
I tried updating the German po files for testing and found that the 'perl translate update de-DE' command gives some error message in the end:

  Update templates 'OPAC ccsr'
    From: /home/katrin/kohacloneG/koha-tmpl/opac-tmpl/ccsr/en/
    To  : /home/katrin/kohacloneG/misc/translator/po/de-DE-opac-ccsr.po
Warning: Can't determine original templates' charset, defaulting to UTF-8
Warning: Charset Out defaulting to UTF-8
msgmerge: Öffnen der Datei »/home/katrin/kohacloneG/misc/translator/po/de-DE-opac-ccsr.po« zum Lesen fehlgeschlagen: Datei oder Verzeichnis nicht gefunden
Update FAILED.

Rough translation: File can not be opened for reading...

There are also no files for the ccsr theme in Pootle - so if you can't generate the file yourself and there is no file to be used on Pootle, the new theme is currently not translatable. This makes this kind of a bigger problem.

I was using the German 3.10 po files downloaded from Pootle and the 3.10.x branch from git.
Comment 1 Jared Camins-Esakov 2012-11-07 12:23:32 UTC
The underlying problem in this bug is actually that the ccsr file is missing from the Pootle download.
Comment 2 Katrin Fischer 2012-11-07 12:26:36 UTC
I confirm, I tried 'perl translate create de-DE' now and that seems to do the trick for creating the file.

Adding the new theme to Pootle is still something we should do, but I am downgrading the severity.
Comment 3 Frédéric Demians 2012-11-07 12:33:55 UTC
Uploading new .po files for CCSR theme? Is it really something we want? It will continue the expansion of Koha Git repository.
Comment 4 Jared Camins-Esakov 2012-11-07 12:37:02 UTC
Frédéric,

Isn't it required for translations?
Comment 5 Katrin Fischer 2012-11-07 12:37:40 UTC
I worry less about the size of the repositories for a developer and more about a library who wants to intall the new theme and will run into problems. I think we should at least enable translating the ccsr file on Pootle. Then it could be discussed if those files will also be included in the pull request or not.

I am not sure I am happy with having a separate file, because it will require people to translate the same terms twice. In strings the 2 OPAC files are probably very very similar.

Would it be possible to maybe have only one opac po file for both themes?
Comment 6 Frédéric Demians 2012-11-07 12:48:52 UTC
> Isn't it required for translations?

If it is, as it seems to be, we could patch the translation script to
fail silently, and gracefully, if there isn't CCSR .po file.
Comment 7 Frédéric Demians 2012-11-07 12:51:08 UTC
> I worry less about the size of the repositories for a developer and
> more about a library who wants to intall the new theme and will run
> into problems. I think we should at least enable translating the ccsr
> file on Pootle. Then it could be discussed if those files will also be
> included in the pull request or not.

I was thinking leaving that job to Ruth...

> Would it be possible to maybe have only one opac po file for both
> themes?

Possible but no easy. It requires diving into translation machinery,
which is not that clean.
Comment 8 Katrin Fischer 2012-11-07 12:54:19 UTC
Hi Frederic, 

I understand. But we should keep an eye on the problem, maybe get it solved for 3.10.1. 

For now it would be good to add some documentation what a library that wants to use a translated CCSR theme can do that. 

Maybe the script could fail more gracefully, but still give a hint that for using a translated CCSR theme a separate po file is needed that can be created by running 'translate create'?
Comment 9 Zeno Tajoli 2012-11-21 11:35:03 UTC
In my opinion for 3.10.0 we need to create 'empty' xx-XX-opac-ccsr.po files.
In fact now it is impossible to install a new language if you use tarball or git.

At least in tarball we need the 'empty' xx-XX-opac-ccsr.po files.
For git a README is enough.

In my opinion we can use this problem to create a new git tree wtih only .po files.

In the develop of 3.12.x we can delete the .po file and place only a README in /misc/translator/po.

We we create tarball and package we can union the two git trees.
For git users only a README in the dir.

I attach the italian traslation it-IT-opac-ccsr.po to this bug
Comment 10 Zeno Tajoli 2012-11-21 11:36:24 UTC Comment hidden (obsolete)
Comment 11 Paul Poulain 2012-11-22 10:29:15 UTC
I've suggested to frederic another option: 
foreach LANG {
* cp LANG-i-opac-t-prog-v-3006000.po LANG-opac-ccsr.po
* ./translate update LANG
}

90% of the ccsr will be translated (it's 108 strings long, and there are less than 10 fuzzy/to translate)

the only problem with this option is that the resulting .po contains a lot of "old strings comments" in the file : when a string "disappear", the .po just put a #~ on it (and moves it at the end of the file). So if it appear again, it will be translated "magically".
Usually it's useful. But in this case it's a problem, as 95% of the file will contain comments. for fr-FR =
 * full size = 223 395b
 * after manually removing all the #~ = 25 008b
Comment 12 Paul Poulain 2012-11-22 16:10:54 UTC
Ruth, adding you to this bug, as you'll be the next translation manager
Comment 13 Paul Poulain 2012-11-23 09:59:52 UTC
Before releasing 3.10.0, I wrote the following small script, to generate pre-filled ccsr.po:

#!/bin/perl

use File::Copy;

opendir(my $dh, 'po/');
@fichiers = grep { /(.*)-i-opac-t-prog-v-3006000\.po/ } readdir($dh);
foreach my $file (@fichiers) {
    $file =~ s/-i-opac-t-prog-v-3006000\.po//;
    print "==> $file\n";
    copy("po/".$file."-i-opac-t-prog-v-3006000\.po","po/".$file."-opac-ccsr.po");
   system("./tmpl_process3.pl update -i /home/paul/koha.dev/koha-community/koha-tmpl/opac-tmpl/ccsr/en/ -r -s po/$file-opac-ccsr.po");
}

+
perl -i -ne 'print if ! /^#\~/' po/*.po
perl -i -00 -pe '' po/*.po

to remove blank/old&irrelevant lines

So, I've generated all ccsr translation files, that are 90% translated for languages that are 100% translated.

The patch is a little bit large (Ruth, your first task as TM will will probably to work on how translation are stored in our git repository... see http://wiki.koha-community.org/wiki/Git_Splitting_and_Shrinking
Comment 14 Paul Poulain 2012-11-23 10:04:43 UTC Comment hidden (obsolete)
Comment 15 Paul Poulain 2012-11-23 10:07:06 UTC
Created attachment 13642 [details] [review]
Bug 9018 Italian translation of ccsr.po (DISCLAIMER: apply AFTER gz archive)
Comment 16 Paul Poulain 2012-11-23 10:07:44 UTC
Comment on attachment 13573 [details]
Italian transaltion of opac-ccsr.po

Zeno, I obsolete this file, because i've uploaded the equivalent patch to this bug (and it will be in 3.10.0)
Comment 17 Zeno Tajoli 2012-11-23 10:12:11 UTC
No problem, I undestand that a patch is better.
Thank you for your work.
Comment 18 Paul Poulain 2012-11-23 10:18:41 UTC
Created attachment 13643 [details]
zipped patch with ccsr.po for all languages (2nd version)

I discovered that zh-Hans-CN-opac-ccsr.po was badly broken, and very very very large.
So I removed it and created an empty .po for this language.
Comment 19 Katrin Fischer 2014-03-13 09:25:12 UTC
I think CCSR OPAC translation is done on pootle now, so closing this.