[Koha-bugs] [Bug 30733] New: Simplify translatable strings

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed May 11 18:20:36 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30733

            Bug ID: 30733
           Summary: Simplify translatable strings
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: I18N/L10N
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: victor at tuxayo.net
        QA Contact: testopia at bugs.koha-community.org
                CC: frederic at tamil.fr

A.K.A "We must be nicer with translators 2" (follow-up of bug 29602)

It's the same simple idea that worked well without issues: Add <span> in
templates to not have anymore translatable strings like
%sEnter a new purchase suggestion%s %sPurchase suggestions%s ›
%s%s%sKoha online%s catalog


git is a great help to review this patch. Don't use the bugzilla diff view.
Apply the patch and use:
git show --color-words=.
Now you will see just the added <span>
You can search for <span> and go one by one to check that the opening and
closing tags match and that there is no typo.
Then the same with </span>
I already did that though, so you might want to spare pressing the "n" (next)
key 1300 times (684 x 2)


---

This patch has been made by searching in the translation platform for "%s" and
inspecting the 2300 strings containing it to find those that are terrible to
translate: those with tons of %s which are a concatenation of independent
strings. Mainly the IFs in template produce these abominations.
bug 29602 focused on CASE statement. This is an attempt for all the rest.
Except for CSV templates and page <title> tags because <span> can't be used
there. Some less terrible strings have been skipped due to lack of time.

---

I tried to think about right to left languages in cases like <span>Confirm
deletion of subfield [%- tagsubfield | html -%]</span> I included the variable
tagsubfield in the <span> so there will be a %s in the translatable string
which should allow to invert the order when translating to be RTL.

And also I included semicolons in the <span> when the context allows for a
translated version with the semicolon on the left to make sense. If the context
has a related thing just after on the same line (on the right) to the string,
then I didn't include the semicolon to leave it "pointing" at the right thing.
Even though that's wrong, but we can't swap the phrases.

caveat: I don't have any experience in translating RTL in Koha so I'm not sure
if these things help.
And I just noticed we have an RTL CSS that might actually swap stuff. If that's
the case, the fact that I left the semicolon outside the <span> might not be an
issue because it should end up swapped right?


---

There are a few fixes like
<span>Payment</span>[% ELSE %]<span>Transaction</span>[% END %] type: </label>
↓
<span>Payment type</span>[% ELSE %]<span>Transaction type</span>[% END %] type:
</label>
because having "type" separated removes the context and it locks the word order
as same as English. Which makes this string not possible to correctly translate
in French, Spanish and Esperanto for example.

---

There is a double <span>, it looks like:
<span><span>Author(s)
This is expected. There was already one <span> spanning (ha ha) a few lines and
I needed another one just for the string on this line.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list