Bug 18660

Summary: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc
Product: Koha Reporter: Marc Véron <veron>
Component: I18N/L10NAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: f.demians, fridolin.somers, jonathan.druart, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc
[SIGNED-OFF] Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc
Bug 18660: Translatability: Get rid of template directives [%% in translation for patroncards-errors.inc

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.
Comment 13 Mason James 2017-11-23 21:23:07 UTC
Pushed to 16.05.x, for 16.05.17 release