Bug 18660 - Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc
Summary: Translatability: Get rid of template directives [%% in translation for patron...
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-23 15:09 UTC by Marc Véron
Modified: 2017-09-15 23:00 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc (7.83 KB, patch)
2017-05-23 15:23 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc (8.34 KB, patch)
2017-06-05 21:34 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc (8.46 KB, patch)
2017-08-02 14:33 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc (8.53 KB, patch)
2017-08-02 16:17 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc (8.59 KB, patch)
2017-08-30 19:33 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-05-23 15:09:21 UTC
Translation for koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc contains a lot of (partial) template directives like %%]%s %sLayout: [%%
Comment 1 Marc Véron 2017-05-23 15:23:10 UTC
Created attachment 63658 [details] [review]
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc

Translation for koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
contains a lot of (partial) template directives like:
%%]%s %sLayout: [%%

This patch fixes it

To test:
- Verify that code changes make sense
- Apply patch
- Create a translation (cd misc/translator , then: perl translate create aa-AA
- Verify that in po/aa-AA-staff-prog.po contains no fragments like %%] or [%%
  for patroncards-errors.inc
- Try to get an error: Try a link like
  http://[YOUR SERVER]/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=1&template_id=999&layout_id=999&start_card=1
  ...where template_id and layout_id do not exist
Comment 2 Jonathan Druart 2017-06-05 19:56:25 UTC
Marc,
The block now displays like:

  551 msgid ""
  552 "%s %s %s %s The database returned an error while %ssaving %s %s%sattempting "
  553 "a save operation%s. %s %s The database returned an error while %sdeleting %s "
  554 "%s%s%s%sattempting a delete operation%s. %s %s An unsupported operation was "
  555 "attempted%s on %s %s%s. %s %s An error has occurred. %s %s A non-existent or "
  556 "invalid library code was supplied. Please verify that you have a library "
  557 "set. "

Adding <span> around the strings will avoid the %s and we will get one entry per message.
Comment 3 Marc Véron 2017-06-05 21:10:39 UTC
(In reply to Jonathan Druart from comment #2)
(...)
> 
> Adding <span> around the strings will avoid the %s and we will get one entry
> per message.
Good idea.
Comment 4 Marc Véron 2017-06-05 21:34:53 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2017-07-20 08:18:40 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2017-08-01 15:00:10 UTC
I still see some problematic areas:

#. %1$s:  IF ( element_id ) 
#. %2$s:  card_element 
#. %3$s:  element_id 
#. %4$s:  END 
#: intranet-tmpl/prog/en/includes/patroncards-errors.inc:30
#, c-format
msgid "An unsupported operation was attempted%s on %s %s%s. "
msgstr ""

I notice some lines where there is a placeholder which doesn't belong. I think some simple whitespace problems?

#. %1$s:  END 
#: intranet-tmpl/prog/en/includes/patroncards-errors.inc:28
#, c-format
msgid "The database returned an error while attempting a delete operation%s. "
msgstr ""
Comment 7 Marc Véron 2017-08-02 14:33:11 UTC
Created attachment 65427 [details] [review]
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc

Translation for koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
contains a lot of (partial) template directives like:
%%]%s %sLayout: [%%

This patch fixes it

To test:
- Verify that code changes make sense
- Apply patch
- Create a translation (cd misc/translator , then: perl translate create aa-AA
- Verify that in po/aa-AA-staff-prog.po contains no fragments like %%] or [%%
  for patroncards-errors.inc
- Try to get an error: Try a link like
  http://[YOUR SERVER]/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=1&template_id=999&layout_id=999&start_card=1
  ...where template_id and layout_id do not exist

(Amended for comment #2 2017-06-05 mv)
(Amended for comment #6 2017-08-02 mv)
Comment 8 Owen Leonard 2017-08-02 16:17:37 UTC
Created attachment 65433 [details] [review]
[SIGNED-OFF] Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc

Translation for koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
contains a lot of (partial) template directives like:
%%]%s %sLayout: [%%

This patch fixes it

To test:
- Verify that code changes make sense
- Apply patch
- Create a translation (cd misc/translator , then: perl translate create aa-AA
- Verify that in po/aa-AA-staff-prog.po contains no fragments like %%] or [%%
  for patroncards-errors.inc
- Try to get an error: Try a link like
  http://[YOUR SERVER]/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=1&template_id=999&layout_id=999&start_card=1
  ...where template_id and layout_id do not exist

(Amended for comment #2 2017-06-05 mv)
(Amended for comment #6 2017-08-02 mv)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Jonathan Druart 2017-08-30 19:33:53 UTC
Created attachment 66639 [details] [review]
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc

Translation for koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
contains a lot of (partial) template directives like:
%%]%s %sLayout: [%%

This patch fixes it

To test:
- Verify that code changes make sense
- Apply patch
- Create a translation (cd misc/translator , then: perl translate create aa-AA
- Verify that in po/aa-AA-staff-prog.po contains no fragments like %%] or [%%
  for patroncards-errors.inc
- Try to get an error: Try a link like
  http://[YOUR SERVER]/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=1&template_id=999&layout_id=999&start_card=1
  ...where template_id and layout_id do not exist

(Amended for comment #2 2017-06-05 mv)
(Amended for comment #6 2017-08-02 mv)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2017-08-30 19:59:03 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 11 Fridolin SOMERS 2017-09-12 13:11:22 UTC
Pushed to 17.05.x, will be in 17.05.04.
Comment 12 Katrin Fischer 2017-09-15 23:00:36 UTC
This patch has been pushed to 16.11.x and will be in 16.11.12.