Bug 15304 - Norwegian patron database: translatable strings added to all po files
Summary: Norwegian patron database: translatable strings added to all po files
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Magnus Enger
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-04 06:17 UTC by paxed
Modified: 2017-06-14 22:11 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: String patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 15304 - Remove Norwegian strings from nl-search.tt (8.99 KB, patch)
2015-12-08 20:39 UTC, Magnus Enger
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15304: Remove Norwegian strings from nl-search.tt (9.09 KB, patch)
2015-12-09 02:39 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15304 - Remove Norwegian strings from nl-search.tt (9.12 KB, patch)
2015-12-11 13:07 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 15304 - Remove Norwegian strings from nl-search.tt (9.24 KB, patch)
2015-12-22 12:30 UTC, Magnus Enger
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15304: Remove Norwegian strings from nl-search.tt (9.38 KB, patch)
2015-12-23 14:20 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 15304: Remove Norwegian strings from nl-search.tt (9.46 KB, patch)
2015-12-24 09:04 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2015-12-04 06:17:38 UTC
The strings in nl-search.tt are picked up for translation, but a lot of those are in Norwegian. The file should either be all in English, or excluded from translation.
Comment 1 Magnus Enger 2015-12-04 19:41:58 UTC
Sorry about that! I guess we are talking about strings like "hjemmebibliotek", "opprettet" and "opprettet_av" from lines like these:

[% IF ( p.hjemmebibliotek ) %]<li><span class="label">hjemmebibliotek: </span>[% p.hjemmebibliotek | html_entity %]</li>[% END %]
[% IF ( p.opprettet ) %]<li><span class="label">opprettet: </span>[% p.opprettet | html_entity %]</li>[% END %]
[% IF ( p.opprettet_av ) %]<li><span class="label">opprettet_av: </span>[% p.opprettet_av | html_entity %]</li>[% END %]

The trouble is, those Norwegian strings just echo the field names that we get from the Natonal patron database API. (The XML elements have Norwegian names.) So on the one hand translating those field names does not make a lot of sense, but on the other hand we need to be able to translate the page as such, especially when the day comes that someone revives the "nynorsk" translation. 

So... The ideal would be to be able to exclude just those strings from tranlsation. Since that is not possible, I guess I better translate them into English and make sure I translate them the right way back again.
Comment 2 Magnus Enger 2015-12-08 20:39:56 UTC Comment hidden (obsolete)
Comment 3 Héctor Eduardo Castro Avalos 2015-12-09 02:39:53 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-12-09 08:55:51 UTC
paxed, do you agree with this patch?
Comment 5 paxed 2015-12-10 07:42:44 UTC
If I eyeballed the patch correctly, all the changed lines are in the format:

[% IF ( p.FOO ) %]<li><span class="label">FOO: </span>[% p.FOO | html_entity %]</li>[% END %]


So, guessing it could be accomplished with something like this:

[%BLOCK output_nlsearch_line %]
[% IF ( p.$nlvar ) %]<li><span class="label">[% nlvar %]: </span>[% p.$nlvar | html_entity %]</li>[% END %]
[% END %]

and then called like

[% PROCESS output_nhsearch_line nlvar="hjemmebibliotek" %]
[% PROCESS output_nhsearch_line nlvar="opprettet" %]

etc.

That would prevent the texts from showing for translation up in the first place,
and does look a bit cleaner to my eyes.
But I haven't tested that, so perhaps it's not possible with Template Toolkit.
Comment 6 Jonathan Druart 2015-12-10 09:39:58 UTC
Magnus suggested to add the string to the po and you suggest to remove them, it's not the same approach :)
Comment 7 Magnus Enger 2015-12-10 09:59:01 UTC
In Norway, we have to versions of Norwegian: bokmål and nynorsk. Currently, only a bokmål translation of Koha is maintained, but hopefully the nynorsk translation will be revived in the not too distant future. I think the approach that makes the most sense is the one I have taken: To translate the humanly visible labels into English, so that they can be translated back into both bokmål and nynorsk. Hiding the labels from translation will mean they are stuck in bokmål, and the nynorsk users will be unhappy some time in the future.
Comment 8 Jonathan Druart 2015-12-10 10:40:05 UTC
(In reply to Magnus Enger from comment #7)
> In Norway, we have to versions of Norwegian: bokmål and nynorsk. Currently,
> only a bokmål translation of Koha is maintained, but hopefully the nynorsk
> translation will be revived in the not too distant future.

That's make a lot of sense and I agree with your patch.
But could you please rewrite it to avoid as much as possible new strings in the po files? for instance "Birthdate:" should be "date of birth", so that it will be automatically translated for other languages and translators won't have to translate (unnecessarily) new strings.
Comment 9 Magnus Enger 2015-12-10 12:21:54 UTC
(In reply to Jonathan Druart from comment #8)
> But could you please rewrite it to avoid as much as possible new strings in
> the po files? for instance "Birthdate:" should be "date of birth", so that
> it will be automatically translated for other languages and translators
> won't have to translate (unnecessarily) new strings.

Will do!
Comment 10 Magnus Enger 2015-12-11 13:07:34 UTC Comment hidden (obsolete)
Comment 11 Bernardo Gonzalez Kriegel 2015-12-18 15:34:21 UTC
Hi Magnus, can I make a sugestion?

Many of the new strings are already in other parts of the code,
so translation will not be an issue, but some of them differs but just a space

for example, if you change

<span class="label">Address: </span>[% p.m_adresse1 | html_entity %]
with
<span class="label">Address:</span> [% p.m_adresse1 | html_entity %]

i.e., space after </span>, we will have more matches. If not we get
many new (but similar) strings like this example

  #. SCRIPT
  #: intranet-tmpl/prog/en/includes/cateditor-ui.inc:24
  msgid "Last changed:"
  msgstr "Última actualización:"

 +#: intranet-tmpl/prog/en/modules/members/nl-search.tt:118
 +#, fuzzy, c-format
 +msgid "Last changed: "
 +msgstr "Última actualización:"
 +
Comment 12 Magnus Enger 2015-12-19 22:23:00 UTC
Bernardo: Cool, I'll do a followup as soon as I can!
Comment 13 Magnus Enger 2015-12-22 12:30:53 UTC Comment hidden (obsolete)
Comment 14 Bernardo Gonzalez Kriegel 2015-12-23 14:20:32 UTC Comment hidden (obsolete)
Comment 15 Marcel de Rooy 2015-12-24 09:04:52 UTC
Created attachment 45978 [details] [review]
Bug 15304: Remove Norwegian strings from nl-search.tt

When nl-search.pl gets data from the Norwegian national patron
database, it does so in an XML format that has Norwegian element
names. nl-search.pl displays the data with the Noregian element
names as labels. This means Norwegian words turn up in translations,
which is messy. This patch replaces the Norwegian labels with
English ones.

To test:
- Only Norwegian libraries and vendors get access to search against
  the national patron database, so a proper functional test is not
  possible
- Alternative 1: Just have a look at the nl-search.tt template
  before and after the patch and verify that after the patch the
  Norwegian strings that would be visible to a user are gone
- Alternative 2:
  - Verify that e.g. en-GB-staff-prog.po contains the Norwegian
    string "kjonn"
  - Apply the patch
  - Create new .po files with e.g. "./translate create en-GB"
  - Verify that "kjonn" is now gone from en-GB-staff-prog.po

Version 2: Tweak a couple of labels to be more in line with labels used
elsewhere in Koha, to avoid variants when translating.

Version 3: Replace e.g. "Gender: </span>" with "Gender:</span> " to
avoid similar-except-for-whitespace strings in translation.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
A few new strings, all previous removed.
No koha-qa errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 16 Brendan Gallagher 2015-12-30 23:42:19 UTC
Pushed to master - Knuckles
Comment 17 Julian Maurice 2016-01-04 07:18:42 UTC
Patch pushed to 3.22.x, will be in 3.22.2
Comment 18 Frédéric Demians 2016-01-04 15:05:54 UTC
This patch has been pushed to 3.20.x, will be in 3.20.8.