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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-06-22 12:35:34 +00:00 committed by Tomas Cohen Arazi
parent ce8c78c6ba
commit 84df32f16d
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -588,10 +588,11 @@
[% IF letter.message_transport_type == 'sms' %]
<span class="sms_counter" id="sms_counter_[% lang | html %]">
[% IF letter.content && letter.content.length > 0 %]
[% letter.content.length | html %]
[% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %]
[% ELSE %]
0
[% END %]/160 characters</span>
[% tx("{content_length} / 160 characters", {content_length = 0} ) %]
[% END %]
</span>
[% END %]
<table>
<tr>