Bug 9216: make columns.def file translatable

The SQL column headers is stored into the columns.def file.
This file is not managed by the translation script.

This patch makes possible the headers translation.
Note: The translation xml tags were added to avoid all lines being put
on a single line.

Test plan:
1/ update your po file
cd misc/translate;
perl translate -f columns update LANG # Replace by another language here
2/ translate header columns (search "columns.def" in your po file).
3/ install the translated columns.def
perl translate -f columns install LANG # Replace by another language here
4/ go on the report module > create a new report > next > next
5/ change the language
on the 3rd step, you should see the column header translated.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no koha-qa errors

[on es-ES about a third of the strings translated!! :-) ]

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and fixes a long standing translation
problem.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Jonathan Druart 2013-10-29 15:03:41 +01:00 committed by Galen Charlton
parent cc34a816a1
commit bece83f8ed
3 changed files with 161 additions and 157 deletions

View File

@ -834,23 +834,27 @@ sub get_sql {
}
sub _get_column_defs {
my ($cgi) = @_;
my %columns;
my $columns_def_file = "columns.def";
my $htdocs = C4::Context->config('intrahtdocs');
my $section='intranet';
my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage($htdocs, $columns_def_file, $section,$cgi);
my ($cgi) = @_;
my %columns;
my $columns_def_file = "columns.def";
my $htdocs = C4::Context->config('intrahtdocs');
my $section = 'intranet';
my $full_path_to_columns_def_file="$htdocs/$theme/$lang/$columns_def_file";
open (COLUMNS,$full_path_to_columns_def_file);
while (my $input = <COLUMNS>){
chomp $input;
my @row =split(/\t/,$input);
$columns{$row[0]}= $row[1];
}
# We need the theme and the lang
# Since columns.def is not in the modules directory, we cannot sent it for the $tmpl var
my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage($htdocs, 'about.tt', $section, $cgi);
close COLUMNS;
return \%columns;
my $full_path_to_columns_def_file="$htdocs/$theme/$lang/$columns_def_file";
open (my $fh, $full_path_to_columns_def_file);
while ( my $input = <$fh> ){
chomp $input;
if ( $input =~ m|<field name="(.*)">(.*)</field>| ) {
my ( $field, $translation ) = ( $1, $2 );
$columns{$field} = $translation;
}
}
close $fh;
return \%columns;
}
=head2 build_authorised_value_list($authorised_value)

View File

@ -1,141 +1,141 @@
borrowers.borrowernumber Borrower number
borrowers.title Salutation
borrowers.surname Surname
borrowers.firstname First name
borrowers.dateofbirth Date of birth
borrowers.initials Initials
borrowers.othernames Other name
borrowers.sex Gender
borrowers.relationship Relationship
borrowers.guarantorid Guarantor borrower number
borrowers.streetnumber Street number
borrowers.streettype Street type
borrowers.address Address
borrowers.address2 Address 2
borrowers.city City
borrowers.state State
borrowers.zipcode Zip/postal code
borrowers.country Country
borrowers.phone Primary phone
borrowers.phonepro Secondary phone
borrowers.mobile Other phone
borrowers.email Primary email
borrowers.emailpro Secondary email
borrowers.fax Fax
borrowers.B_streetnumber Alternate address: Street number
borrowers.B_streettype Alternate address: Street type
borrowers.B_address Alternate address: Address
borrowers.B_address2 Alternate address: Address 2
borrowers.B_city Alternate address: City
borrowers.B_state Alternate address: State
borrowers.B_zipcode Alternate address: Zip/postal code
borrowers.B_country Alternate address: Country
borrowers.B_phone Alternate address: Phone
borrowers.B_email Alternate address: Email
borrowers.contactnote Alternate contact: Note
borrowers.altcontactfirstname Alternate contact: Last name
borrowers.altcontactsurname Alternate contact: First name
borrowers.altcontactaddress1 Alternate contact: Address
borrowers.altcontactaddress2 Alternate contact: Address 2
borrowers.altcontactaddress3 Alternate contact: City
borrowers.contactname Alternate contact: Surname
borrowers.contactfirstname Alternate contact: First name
borrowers.contacttitle Alternate contact: Title
borrowers.altcontactstate Alternate contact: State
borrowers.altcontactzipcode Alternate contact: Zip/postal code
borrowers.altcontactcountry Alternate contact: Country
borrowers.altcontactphone Alternate contact: Phone
borrowers.cardnumber Card number
borrowers.branchcode Home library
borrowers.categorycode Category
borrowers.sort1 Sort 1
borrowers.sort2 Sort 2
borrowers.dateenrolled Registration date
borrowers.dateexpiry Expiry date
borrowers.opacnote OPAC note
borrowers.borrowernotes Circulation note
borrowers.userid Username
borrowers.password Password
borrowers.flags System permissions
borrowers.gonenoaddress Gone no address flag
borrowers.lost Lost card flag
borrowers.debarred Restricted [until] flag
borrowers.debarredcomment Comment
borrowers.smsalertnumber Mobile phone number
borrowers.privacy Privacy settings
items.itemnumber Item number (internal)
items.biblionumber Biblio number (internal)
items.biblioitemnumber Biblioitem number (internal)
items.barcode Barcode
items.dateaccessioned Date acquired
items.booksellerid Source of acquisition
items.homebranch Permanent library
items.price Price
items.replacementprice Replacement price
items.replacementpricedate Price effective from
items.datelastborrowed Date last checked out
items.datelastseen Date last seen
items.stack Shelving control number
items.onloan Due date
items.cn_source Source of classification / shelving scheme
items.cn_sort Koha normalized classification for sorting
items.notforloan Not for loan
items.itemlost Lost status
items.withdrawn Withdrawn status
items.itemcallnumber Call number
items.issues Total checkouts
items.renewals Total renewals
items.reserves Total holds
items.restricted Use restrictions
items.itemnotes Public note
items.holdingbranch Current library
items.paidfor
items.timestamp Timestamp
items.location Shelving location
items.ccode Collection code
items.itype Koha itemtype
items.stocknumber Inventory number
items.damaged Damaged status
items.materials Materials specified
items.uri Uniform Resource Identifier
items.more_subfields_xml Additional subfields (XML)
items.enumchron Serial enumeraton/chronology
items.copynumber Copy number
statistics.datetime Statistics date and time
statistics.branch Library
statistics.proccode Type of procedure
statistics.value Value
statistics.type Type
statistics.other
statistics.usercode User code
statistics.itemnumber Item number
statistics.itemtype Itemtype
statistics.borrowernumber Borrower number
biblio.frameworkcode Framework code
biblio.author Author
biblio.datecreated Creation date
biblio.timestamp Modification date
biblioitems.biblioitemnumber Biblioitem number
biblioitems.biblionumber Biblio number
biblioitems.volume Volume number
biblioitems.number Number
biblioitems.classification Classification
biblioitems.itemtype Biblio-level item type
biblioitems.isbn ISBN
biblioitems.issn ISSN
biblioitems.dewey Dewey/classification
biblioitems.subclass Sub classification
biblioitems.publicationyear Publication date
biblioitems.publishercode Publisher
biblioitems.volumedate Volume date
biblioitems.volumedesc Volume information
biblioitems.timestamp Timestamp
biblioitems.illus Illustrator
biblioitems.pages Number of pages
biblioitems.notes Notes
biblioitems.size Size
biblioitems.place Place of publication
biblioitems.lccn LCCN
biblioitems.marcxml MARC blob
biblioitems.url URL
biblioitems.title Title
<field name="borrowers.borrowernumber">Borrower number</field>
<field name="borrowers.title">Salutation</field>
<field name="borrowers.surname">Surname</field>
<field name="borrowers.firstname">First name</field>
<field name="borrowers.dateofbirth">Date of birth</field>
<field name="borrowers.initials">Initials</field>
<field name="borrowers.othernames">Other name</field>
<field name="borrowers.sex">Gender</field>
<field name="borrowers.relationship">Relationship</field>
<field name="borrowers.guarantorid">Guarantor borrower number</field>
<field name="borrowers.streetnumber">Street number</field>
<field name="borrowers.streettype">Street type</field>
<field name="borrowers.address">Address</field>
<field name="borrowers.address2">Address 2</field>
<field name="borrowers.city">City</field>
<field name="borrowers.state">State</field>
<field name="borrowers.zipcode">Zip/postal code</field>
<field name="borrowers.country">Country</field>
<field name="borrowers.phone">Primary phone</field>
<field name="borrowers.phonepro">Secondary phone</field>
<field name="borrowers.mobile">Other phone</field>
<field name="borrowers.email">Primary email</field>
<field name="borrowers.emailpro">Secondary email</field>
<field name="borrowers.fax">Fax</field>
<field name="borrowers.B_streetnumber">Alternate address: Street number</field>
<field name="borrowers.B_streettype">Alternate address: Street type</field>
<field name="borrowers.B_address">Alternate address: Address</field>
<field name="borrowers.B_address2">Alternate address: Address 2</field>
<field name="borrowers.B_city">Alternate address: City</field>
<field name="borrowers.B_state">Alternate address: State</field>
<field name="borrowers.B_zipcode">Alternate address: Zip/postal code</field>
<field name="borrowers.B_country">Alternate address: Country</field>
<field name="borrowers.B_phone">Alternate address: Phone</field>
<field name="borrowers.B_email">Alternate address: Email</field>
<field name="borrowers.contactnote">Alternate contact: Note</field>
<field name="borrowers.altcontactfirstname">Alternate contact: Last name</field>
<field name="borrowers.altcontactsurname">Alternate contact: First name</field>
<field name="borrowers.altcontactaddress1">Alternate contact: Address</field>
<field name="borrowers.altcontactaddress2">Alternate contact: Address 2</field>
<field name="borrowers.altcontactaddress3">Alternate contact: City</field>
<field name="borrowers.contactname">Alternate contact: Surname</field>
<field name="borrowers.contactfirstname">Alternate contact: First name</field>
<field name="borrowers.contacttitle">Alternate contact: Title</field>
<field name="borrowers.altcontactstate">Alternate contact: State</field>
<field name="borrowers.altcontactzipcode">Alternate contact: Zip/postal code</field>
<field name="borrowers.altcontactcountry">Alternate contact: Country</field>
<field name="borrowers.altcontactphone">Alternate contact: Phone</field>
<field name="borrowers.cardnumber">Card number</field>
<field name="borrowers.branchcode">Home library</field>
<field name="borrowers.categorycode">Category</field>
<field name="borrowers.sort1">Sort 1</field>
<field name="borrowers.sort2">Sort 2</field>
<field name="borrowers.dateenrolled">Registration date</field>
<field name="borrowers.dateexpiry">Expiry date</field>
<field name="borrowers.opacnote">OPAC note</field>
<field name="borrowers.borrowernotes">Circulation note</field>
<field name="borrowers.userid">Username</field>
<field name="borrowers.password">Password</field>
<field name="borrowers.flags">System permissions</field>
<field name="borrowers.gonenoaddress">Gone no address flag</field>
<field name="borrowers.lost">Lost card flag</field>
<field name="borrowers.debarred">Restricted [until] flag</field>
<field name="borrowers.debarredcomment">Comment</field>
<field name="borrowers.smsalertnumber">Mobile phone number</field>
<field name="borrowers.privacy">Privacy settings</field>
<field name="items.itemnumber">Item number (internal)</field>
<field name="items.biblionumber">Biblio number (internal)</field>
<field name="items.biblioitemnumber">Biblioitem number (internal)</field>
<field name="items.barcode">Barcode</field>
<field name="items.dateaccessioned">Date acquired</field>
<field name="items.booksellerid">Source of acquisition</field>
<field name="items.homebranch">Permanent library</field>
<field name="items.price">Price</field>
<field name="items.replacementprice">Replacement price</field>
<field name="items.replacementpricedate">Price effective from</field>
<field name="items.datelastborrowed">Date last checked out</field>
<field name="items.datelastseen">Date last seen</field>
<field name="items.stack">Shelving control number</field>
<field name="items.onloan">Due date</field>
<field name="items.cn_source">Source of classification / shelving scheme</field>
<field name="items.cn_sort">Koha normalized classification for sorting</field>
<field name="items.notforloan">Not for loan</field>
<field name="items.itemlost">Lost status</field>
<field name="items.withdrawn">Withdrawn status</field>
<field name="items.itemcallnumber">Call number</field>
<field name="items.issues">Total checkouts</field>
<field name="items.renewals">Total renewals</field>
<field name="items.reserves">Total holds</field>
<field name="items.restricted">Use restrictions</field>
<field name="items.itemnotes">Public note</field>
<field name="items.holdingbranch">Current library</field>
<field name="items.paidfor</field>
<field name="items.timestamp">Timestamp</field>
<field name="items.location">Shelving location</field>
<field name="items.ccode">Collection code</field>
<field name="items.itype">Koha itemtype</field>
<field name="items.stocknumber">Inventory number</field>
<field name="items.damaged">Damaged status</field>
<field name="items.materials">Materials specified</field>
<field name="items.uri">Uniform Resource Identifier</field>
<field name="items.more_subfields_xml">Additional subfields (XML)</field>
<field name="items.enumchron">Serial enumeraton/chronology</field>
<field name="items.copynumber">Copy number</field>
<field name="statistics.datetime">Statistics date and time</field>
<field name="statistics.branch">Library</field>
<field name="statistics.proccode">Type of procedure</field>
<field name="statistics.value">Value</field>
<field name="statistics.type">Type</field>
<field name="statistics.other</field>
<field name="statistics.usercode">User code</field>
<field name="statistics.itemnumber">Item number</field>
<field name="statistics.itemtype">Itemtype</field>
<field name="statistics.borrowernumber">Borrower number</field>
<field name="biblio.frameworkcode">Framework code</field>
<field name="biblio.author">Author</field>
<field name="biblio.datecreated">Creation date</field>
<field name="biblio.timestamp">Modification date</field>
<field name="biblioitems.biblioitemnumber">Biblioitem number</field>
<field name="biblioitems.biblionumber">Biblio number</field>
<field name="biblioitems.volume">Volume number</field>
<field name="biblioitems.number">Number</field>
<field name="biblioitems.classification">Classification</field>
<field name="biblioitems.itemtype">Biblio-level item type</field>
<field name="biblioitems.isbn">ISBN</field>
<field name="biblioitems.issn">ISSN</field>
<field name="biblioitems.dewey">Dewey/classification</field>
<field name="biblioitems.subclass">Sub classification</field>
<field name="biblioitems.publicationyear">Publication date</field>
<field name="biblioitems.publishercode">Publisher</field>
<field name="biblioitems.volumedate">Volume date</field>
<field name="biblioitems.volumedesc">Volume information</field>
<field name="biblioitems.timestamp">Timestamp</field>
<field name="biblioitems.illus">Illustrator</field>
<field name="biblioitems.pages">Number of pages</field>
<field name="biblioitems.notes">Notes</field>
<field name="biblioitems.size">Size</field>
<field name="biblioitems.place">Place of publication</field>
<field name="biblioitems.lccn">LCCN</field>
<field name="biblioitems.marcxml">MARC blob</field>
<field name="biblioitems.url">URL</field>
<field name="biblioitems.title">Title</field>

View File

@ -242,7 +242,7 @@ usage_error('You must at least specify input and string list filenames.')
if !$in_dir || !defined $str_file;
# Type match defaults to *.tt plus *.inc if not specified
$type = "tt|inc|xsl|xml" if !defined($type);
$type = "tt|inc|xsl|xml|def" if !defined($type);
# Check the inputs for being directories
usage_error("$in_dir: Input must be a directory.\n"