Bug 34247

Summary: Improve translation of notice character count
Product: Koha Reporter: Owen Leonard <oleonard>
Component: I18N/L10NAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, f.demians, fridolin.somers
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:
Attachments: Bug 34247: Improve translation of notice character count
Bug 34247: Improve translation of notice character count
Bug 34247: Improve translation of notice character count

Description Owen Leonard 2023-07-10 16:19:58 UTC
When entering content in an SMS message notice there is a character count to count down how many characters you have left. This looks ugly in the .po file:

#: koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:589
#, c-format
msgid "%s %s %s 0 %s/160 characters"
msgstr "%s %s %s 0 %s/160 caractères"

After my proposed change:

#: koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:591
#: koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:593
#, perl-brace-format
msgid "{content_length} / 160 characters"
msgstr "{content_length} / 160 caractères"
Comment 1 Owen Leonard 2023-07-10 16:57:34 UTC
Created attachment 153288 [details] [review]
Bug 34247: Improve translation of notice character count

This patch restructures the template markup around the part of the
notice edit screen where the system tracks how many characters have been
entered in an SMS message. The change is intended to make translation
easier.

To test, apply the patch and run the translation script to update the
.po files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files:

- In fr-FR-staff-prog.po there should not be a line with the string "160
  characters"
- In fr-FR-messages.po the string should have been picked up like this:

  msgid "{content_length} / 160 characters"
  msgstr ""

- Add a translation to fr-FR-messages.pl and install the updated
  translation:

  perl misc/translator/translate install fr-FR

- Switch to the update language in the staff interface and go to Tools ->
  Notices. Edit any notice and expand the "SMS" block. (you may be asked
  to enable SMSSendDriver).
- Confirm that the "X/160 characters" text updates correctly as you
  enter content into the textarea. Confirm that the same is true when
  you switch to your updated translation.
Comment 2 Caroline Cyr La Rose 2023-08-07 15:27:18 UTC
Created attachment 154307 [details] [review]
Bug 34247: Improve translation of notice character count

This patch restructures the template markup around the part of the
notice edit screen where the system tracks how many characters have been
entered in an SMS message. The change is intended to make translation
easier.

To test, apply the patch and run the translation script to update the
.po files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files:

- In fr-FR-staff-prog.po there should not be a line with the string "160
  characters"
- In fr-FR-messages.po the string should have been picked up like this:

  msgid "{content_length} / 160 characters"
  msgstr ""

- Add a translation to fr-FR-messages.pl and install the updated
  translation:

  perl misc/translator/translate install fr-FR

- Switch to the update language in the staff interface and go to Tools ->
  Notices. Edit any notice and expand the "SMS" block. (you may be asked
  to enable SMSSendDriver).
- Confirm that the "X/160 characters" text updates correctly as you
  enter content into the textarea. Confirm that the same is true when
  you switch to your updated translation.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Jonathan Druart 2023-09-01 09:15:26 UTC
Created attachment 155075 [details] [review]
Bug 34247: Improve translation of notice character count

This patch restructures the template markup around the part of the
notice edit screen where the system tracks how many characters have been
entered in an SMS message. The change is intended to make translation
easier.

To test, apply the patch and run the translation script to update the
.po files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files:

- In fr-FR-staff-prog.po there should not be a line with the string "160
  characters"
- In fr-FR-messages.po the string should have been picked up like this:

  msgid "{content_length} / 160 characters"
  msgstr ""

- Add a translation to fr-FR-messages.pl and install the updated
  translation:

  perl misc/translator/translate install fr-FR

- Switch to the update language in the staff interface and go to Tools ->
  Notices. Edit any notice and expand the "SMS" block. (you may be asked
  to enable SMSSendDriver).
- Confirm that the "X/160 characters" text updates correctly as you
  enter content into the textarea. Confirm that the same is true when
  you switch to your updated translation.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-09-01 14:44:46 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-09-08 05:59:02 UTC
Not backported to 23.05.x