Bug 9018

Summary: Po file for ccsr theme missing on translate.koha-community.org
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: D Ruth Holloway <ruth>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: f.demians, magnus, paul.poulain, ruth, veron, ztajoli
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8633
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
zipped patch with ccsr.po for all languages
Bug 9018 Italian translation of ccsr.po (DISCLAIMER: apply AFTER gz archive)
zipped patch with ccsr.po for all languages (2nd version)

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.