msgstr ""
# Searching > Results Display
-msgid "searching.pref#XSLTDetailsDisplay# Show item details pages on the OPAC"
+msgid "searching.pref#XSLTDetailsDisplay# Show item details pages in the staff client"
msgstr ""
# Searching > Results Display
msgstr ""
# Searching > Results Display
-msgid "searching.pref#XSLTResultsDisplay# Show biblio records on result page"
+msgid "searching.pref#XSLTResultsDisplay# Show biblio records on result page in the staff client"
msgstr ""
# Searching > Results Display
#!/usr/bin/perl
-package PrefPo;
-
-
-sub new {
- my ($class, $lang) = @_;
-
- my $self = { lang => $lang };
- my $context = C4::Context->new();
- $self->{path_en} = $context->config('intrahtdocs') .
- '/prog/en/modules/admin/preferences';
- $self->{path_lang} = $context->config('intrahtdocs') .
- "/prog/$lang/modules/admin/preferences";
- $self->{po} = {};
-
- bless $self, $class;
-}
-
-
package Tokenizer;
use strict;
sub get_trans_text {
my ($self, $id) = @_;
- my $po = $self->{po}->{'"'.$id.'"'};
+ my $po = $self->{po}->{$id};
return unless $po;
return Locale::PO->dequote($po->msgstr);
}
$self->{file} = $file;
#print Dump($pref), "\n";
while ( my ($tab, $tab_content) = each %$pref ) {
- print "TAB: $tab\n";
if ( ref($tab_content) eq 'ARRAY' ) {
$self->add_prefs( $tab, $tab_content );
next;
sub update {
my $self = shift;
- # Get po from current .pref files
+ print "Update '", $self->{lang}, "' preferences .po file from 'en' .pref files\n";
+ # Get po from current 'en' .pref files
$self->get_po_from_prefs();
my $po_current = $self->{po};
print "Koha directories hierarchy for ", $self->{lang}, " must be created first\n";
exit;
}
- $self->{po} = Locale::PO->load_file_ashash( $self->po_filename );
+
+ # Update the language .po file with last modified 'en' preferences
+ # and load it.
+ $self->update();
chdir( $self->{path_en} );
for my $file ( <*.pref> ) {