Bugzilla – Attachment 30517 Details for
Bug 12535
PROG/CCSR Deprecation: Make opac translation theme independent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12535 - PROG/CCSR Deprecation: Make opac translation theme independent
PASSED-QA-Bug-12535---PROGCCSR-Deprecation-Make-op.patch (text/plain), 4.48 KB, created by
Katrin Fischer
on 2014-08-03 14:42:48 UTC
(
hide
)
Description:
[PASSED QA] Bug 12535 - PROG/CCSR Deprecation: Make opac translation theme independent
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-08-03 14:42:48 UTC
Size:
4.48 KB
patch
obsolete
>From c45e3cc9ac3a04bcb7edf040fe3e17320a48c630 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Sun, 6 Jul 2014 22:11:14 -0300 >Subject: [PATCH] [PASSED QA] Bug 12535 - PROG/CCSR Deprecation: Make opac > translation theme independent > >This patch makes opac translation files theme independent >A side effect is that current prog translation file is >renamed. > >But the renaming is not added, that gives a patch of ~60M! > >Current list of languages are now obtained from pref files. > >To test: >1) Apply the patch > >2) For your preferred language, rename opac prog file >from 'xx-YY-i-opac-t-prog-v-3006000.po' to 'xx-YY-opac-prog.po' > >3) Update that language, there must be no errors >cd misc/translation >./translate update xx-YY [-v] >Check updated po files > >4) Install any language, there must be no errors >./translate install xx-YY >Check prog theme for that language > >5) Create translation files. Remove a language or create new lang files >./translate create zz-WW >ls -l po/zz-WW*po >check there are 3 files (and *~) for opac > >6) Check updated pod for LangInstaler.pm and translate script > >When PROG/CCSR themes are removed, I'll add a Bug to remove >corresponding files. > >Perhaps RM could add a followup to rename all files, >cd misc/translator/po >for old in $(ls *opac-t*); do > new=$(echo $old | sed 's/-i-opac-t-prog-v-3006000/-opac-prog/'); > git mv $old $new; >done > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Works as described, no problems found. >--- > misc/translator/LangInstaller.pm | 29 ++++++++++++----------------- > misc/translator/translate | 4 ++-- > 2 files changed, 14 insertions(+), 19 deletions(-) > >diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm >index b89aaa8..695a8ec 100644 >--- a/misc/translator/LangInstaller.pm >+++ b/misc/translator/LangInstaller.pm >@@ -84,8 +84,8 @@ sub new { > > # Get all available language codes > opendir $fh, $self->{path_po}; >- my @langs = map { ($_) =~ /(.*)-i-opac/ } >- grep { $_ =~ /.*-opac-t-prog/ } readdir($fh); >+ my @langs = map { ($_) =~ /(.*)-pref/ } >+ grep { $_ =~ /.*-pref/ } readdir($fh); > closedir $fh; > $self->{langs} = \@langs; > >@@ -93,11 +93,6 @@ sub new { > my $opachtdocs = $context->config('opachtdocs'); > $self->{interface} = [ > { >- name => 'OPAC prog', >- dir => "$opachtdocs/prog", >- suffix => '-i-opac-t-prog-v-3006000.po', >- }, >- { > name => 'Intranet prog UI', > dir => $context->config('intrahtdocs') . '/prog', > suffix => '-i-staff-t-prog-v-3006000.po', >@@ -109,13 +104,13 @@ sub new { > }, > ]; > >- # Alternate opac themes >- opendir $fh, $context->config('opachtdocs'); >- for ( grep { not /^\.|\.\.|prog|lib$/ } readdir($fh) ) { >+ # OPAC themes >+ opendir my $dh, $context->config('opachtdocs'); >+ for my $theme ( grep { not /^\.|lib/ } readdir($dh) ) { > push @{$self->{interface}}, { >- name => "OPAC $_", >- dir => "$opachtdocs/$_", >- suffix => "-opac-$_.po", >+ name => "OPAC $theme", >+ dir => "$opachtdocs/$theme", >+ suffix => "-opac-$theme.po", > }; > } > >@@ -514,9 +509,9 @@ sub install { > sub get_all_langs { > my $self = shift; > opendir( my $dh, $self->{path_po} ); >- my @files = grep { $_ =~ /-i-opac-t-prog-v-3006000.po$/ } >+ my @files = grep { $_ =~ /-pref.po$/ } > readdir $dh; >- @files = map { $_ =~ s/-i-opac-t-prog-v-3006000.po$//; $_ } @files; >+ @files = map { $_ =~ s/-pref.po$//; $_ } @files; > } > > >@@ -595,10 +590,10 @@ intranet templates, and (3) from preferences. > > =over > >-=item F<lang>-opac.po >+=item F<lang>-opac-{theme}.po > > Contains extracted text from english (en) OPAC templates found in >-<KOHA_ROOT>/koha-tmpl/opac-tmpl/prog/en/ directory. >+<KOHA_ROOT>/koha-tmpl/opac-tmpl/{theme}/en/ directory. > > =item F<lang>-intranet.po > >diff --git a/misc/translator/translate b/misc/translator/translate >index da41a97..63e4177 100755 >--- a/misc/translator/translate >+++ b/misc/translator/translate >@@ -106,10 +106,10 @@ version of templates and preferences are used as references. > > =over > >-=item F<lang>-opac.po >+=item F<lang>-opac-{theme}.po > > Contains extracted text from english (en) OPAC templates found in >-<KOHA_ROOT>/koha-tmpl/opac-tmpl/prog/en/ directory. >+<KOHA_ROOT>/koha-tmpl/opac-tmpl/{theme}/en/ directory. > > =item F<lang>-intranet.po > >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12535
:
29534
|
30084
| 30517