Bug 8633

Summary: Translate script hardcoded to prog template
Product: Koha Reporter: Jared Camins-Esakov <jcamins>
Component: I18N/L10NAssignee: Frédéric Demians <f.demians>
Status: CLOSED FIXED QA Contact: Mason James <mtj>
Severity: normal    
Priority: P5 - low CC: chris, f.demians, mtj, paul.poulain
Version: 3.10   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9018
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 8633 Manage OPAC alternate templates
Bug 8633 Manage OPAC alternate templates

Description Jared Camins-Esakov 2012-08-13 18:30:59 UTC
misc/translator/translate is hardcoded to translate only prog, when in fact it should be translating any themes included in Koha.
Comment 1 Frédéric Demians 2012-08-14 08:14:16 UTC
From my perspective, the Koha theme concept is deprecated. It has been proved by experience that specific theme is un-maintenable. To be confirmed by others.
Comment 2 Chris Cormack 2012-08-14 08:16:30 UTC
(In reply to comment #1)
> From my perspective, the Koha theme concept is deprecated. It has been
> proved by experience that specific theme is un-maintenable. To be confirmed
> by others.

I disagree, it has been proven the way people tried to do it in the past was unmaintanable. The new mobile theme patches are much much more maintainable, as they only contain the 2 or 3 actually changed files.
Comment 3 Frédéric Demians 2012-09-19 12:17:07 UTC
> misc/translator/translate is hardcoded to translate only prog, when in
> fact it should be translating any themes included in Koha.

For each template, we would have to create 2 .po files, one per
interface, OPAC or professional. Does it make sense to generate .po
files for intranet template other than 'prog'? Why would we want to
include a second template for intranet interface?
Comment 4 Jared Camins-Esakov 2012-09-19 12:25:05 UTC
(In reply to comment #3)
> > misc/translator/translate is hardcoded to translate only prog, when in
> > fact it should be translating any themes included in Koha.
> 
> For each template, we would have to create 2 .po files, one per
> interface, OPAC or professional. Does it make sense to generate .po
> files for intranet template other than 'prog'? Why would we want to
> include a second template for intranet interface?

I can't really think of any reason we would want to, to be honest.

The change I made to translate the ccsr theme was to add:

+        ccsr => {
+            dir    => $context->config('opachtdocs') . '/ccsr',
+            suffix => '-i-opac-t-ccsr-v-3006000.po',
+        },

in the $self->{interface} definition in new. I am not sure if that is the best way, which is why I defer to you.
Comment 5 Frédéric Demians 2012-09-19 13:37:51 UTC Comment hidden (obsolete)
Comment 6 Jared Camins-Esakov 2012-09-27 13:38:02 UTC
Created attachment 12556 [details] [review]
Bug 8633 Manage OPAC alternate templates

Modify /misc/translator/translate script in order to manage properly alternate
OPAC templates.

To test it with new 'ccsr' template:

- Create the .po file:

  ./translate create fr-FR

  Result: existing .po files are not modified. A new fr-FR-opac-ccsr.po file is
  available.

- Install all templates :

  ./translate install fr-FR

  Result: A new koha-tmpl/opac-tmpl/ccsr/fr-FR directory contains translated
  templates.

- Update .po files:

  ./translate update fr-FR

  Result: fr-FR .po files are update, include fr-FR-opac-ccsr.po

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Comment 7 Mason James 2012-10-04 01:44:52 UTC
> To test it with new 'ccsr' template:
> 
>   Result: fr-FR .po files are update, include fr-FR-opac-ccsr.po
> 
> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

confirmed working by me, passing QA...

mason@xen1:~/g/head$ koha-qa.pl -c 1

testing 1 commit(s) (applied to commit 6c18204)
 * fd5bae3 Bug 8633 Manage OPAC alternate templates
      misc/translator/LangInstaller.pm

* misc/translator/LangInstaller.pm                                         OK
Comment 8 Paul Poulain 2012-10-08 15:53:55 UTC
QA comment: just a question before pushing = why do you have kept the -v-3006000 in prog template, and removed it from ccsr ? could be a little bit confusing, don't you think ?

I don't know why we need keep the -v-3006000 in the translation name, and maybe removing it would require a much larger patch, to rename all existing translations, just asking to be sure we haven't missed anything !
Comment 9 Frédéric Demians 2012-10-08 17:28:44 UTC
> QA comment: just a question before pushing = why do you have kept the
> -v-3006000 in prog template, and removed it from ccsr ? could be a
> little bit confusing, don't you think ?  I don't know why we need keep
> the -v-3006000 in the translation name, and maybe removing it would
> require a much larger patch, to rename all existing translations, just
> asking to be sure we haven't missed anything !

The -v-3006000 part of the name is useless. We already don't have it for
preferences .po files. I avoided to add it to the new ccsr .po files. We
could easily suppress this in opac/staff files. But this has to be done
also on Koha Pootle translation server. I think we should plan this with
the extraction of all .po files from code Git repository.
Comment 10 Paul Poulain 2012-10-11 09:16:31 UTC
(In reply to comment #9)

> The -v-3006000 part of the name is useless.

OK, removing it will be for another patch.

patch pushed !

(no need to push this to 3.8, there's no cssr theme)
Comment 11 Chris Cormack 2013-04-22 08:30:07 UTC
Released in 3.10.0