Bug 34900 - The translation of the string "The " should depend on context
Summary: The translation of the string "The " should depend on context
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
Depends on:
Blocks: 35584
  Show dependency treegraph
 
Reported: 2023-09-23 14:44 UTC by Mathieu Saby
Modified: 2024-01-12 22:21 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.02,23.05.08


Attachments
Bug 34900: Simplify text of about page license information (21.73 KB, patch)
2023-10-30 15:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34900: (follow-up) Correct last entry (1.14 KB, patch)
2023-12-01 13:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34900: Simplify text of about page license information (21.78 KB, patch)
2023-12-03 19:36 UTC, David Nind
Details | Diff | Splinter Review
Bug 34900: (follow-up) Correct last entry (1.19 KB, patch)
2023-12-03 19:36 UTC, David Nind
Details | Diff | Splinter Review
Bug 34900: (follow-up) List alphabetically and tidy ups (21.07 KB, patch)
2023-12-03 19:36 UTC, David Nind
Details | Diff | Splinter Review
Bug 34900: (follow-up) Add version information to more entries (4.56 KB, patch)
2023-12-19 19:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34900: (follow-up) Add version information to more entries (4.61 KB, patch)
2023-12-19 19:10 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34900: Simplify text of about page license information (21.85 KB, patch)
2024-01-04 12:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34900: (follow-up) Correct last entry (1.27 KB, patch)
2024-01-04 12:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34900: (follow-up) List alphabetically and tidy ups (21.15 KB, patch)
2024-01-04 12:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34900: (follow-up) Add version information to more entries (4.69 KB, patch)
2024-01-04 12:41 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 Mathieu Saby 2023-09-23 14:44:00 UTC
The string "The " is present 
- 22 times (in 23.05 version) in koha-tmpl/intranet-tmpl/prog/en/modules/about.tt for different uses :
"The [...] Athens County Public Libraries"  => singular
"The [...] jQuery Validation Plugin"
"The [...] controls for column visiblity in DataTables"  => plural 
etc

- and 1 time in koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt in that string : 
"The [strong]Gone no address[strong] flag is set for this patron."

In Pootle, all these occurences are grouped. This is a nonsense because in many languages "The" must be translated by different articles (ex in french le / la / les) , and for the last example, in french we must translate "the" by "le flag"

Can it be fixed, in Pootle or in Koha's code?
Comment 1 Caroline Cyr La Rose 2023-10-24 13:27:41 UTC
I had noticed it before too, but didn't push it further because it's only in the "about" page (sorry!!).

The "the's" are separated because the nouns following them are links.

For example,
The <a href="http://www.myacpl.org/">Athens County Public Libraries</a>, Ohio, USA (MARC sponsorship, documentation, template maintenance)

so the translation tool cuts it up in
- The
- Athens County Public Libraries
- , Ohio, USA (MARC sponsorship, documentation, template maintenance)

I wonder if adding span tags around the strings would help? I tried on my local installation, and ran gulp po:update --lang fr-CA and it didn't change, but it might just be me not doing it correctly too...
Comment 2 Caroline Cyr La Rose 2023-10-24 13:30:25 UTC
Adding Owen since he worked a lot on translatability recently
Comment 3 Jonathan Druart 2023-10-24 13:40:03 UTC
What Caroline said.

Set the link in a TT variable, then use it in place of the <a> and the string will appear in a single sentence on pootle/weblate:

"The %s Athens County Public Libraries"

There is nothing better we can do.
Comment 4 Caroline Cyr La Rose 2023-10-24 14:01:44 UTC
I looked at how to "set the link in a TT variable" and found https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6988#c2

I will try that
Comment 5 Jonathan Druart 2023-10-24 14:14:31 UTC
This is what I had in mind:

admin/curbside_pickup.tt

 62         [% SET pref_CurbsidePickup_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CurbsidePickup">CurbsidePickup</a>' %]
 63         <div class="dialog message">The [% pref_CurbsidePickup_link | $raw | $KohaSpan %] preference is not enabled, do not forget to enable it to turn the feature on.</div>

Bug 6988 comment 2 is interesting, I never thought about that.
It also depends if you want the link to be translatable. Do you want "Athens County Public Libraries" to be translatable? I don't think it's needed.
Comment 6 Caroline Cyr La Rose 2023-10-24 14:22:02 UTC
(In reply to Jonathan Druart from comment #5)

> It also depends if you want the link to be translatable. Do you want "Athens
> County Public Libraries" to be translatable? I don't think it's needed.

In that case, no, you are right. But other links might need to be. For example

<a href="http://www.gnu.org/licenses/gpl-3.0.html">Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.</a>
Comment 7 Caroline Cyr La Rose 2023-10-24 14:23:35 UTC
Sorry, that might not be a good example because the whole sentence is in the link.

But this example

The <a href="http://datatables.net/extensions/colvis/">controls for column visiblity in DataTables</a> by Allan Jardine is licensed under the BSD 3 and GPL v2 license.
Comment 8 Caroline Cyr La Rose 2023-10-24 14:54:11 UTC
I tried 

<li>
    [%- SET myacpl_link = <a href="http://www.myacpl.org/">Athens County Public Libraries</a> -%]
    The [% myacpl_link | $raw | $KohaSpan %], Ohio, USA (MARC sponsorship, documentation, template maintenance)</li>

And this is what the translation tool returns

#: koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:742
#, c-format
msgid "[%%- SET myacpl_link = "
msgstr ""

#. %1$s:  myacpl_link | $raw | $KohaSpan 
#: koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:743
#, fuzzy, c-format
msgid "-%%] The %s, Ohio, USA (MARC sponsorship, documentation, template maintenance)"
msgstr ", Ohio, USA (MARC, documentation, maintenance des gabarits)"

#: koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:743
#, fuzzy, c-format
msgid "Athens County Public Libraries"
msgstr "Athens County Public Libraries, États-Unis"

Not sure how to remove the first string where it's just the SET or the %%] in the second string.

It's an improvement from before, I guess, even if we still don't really know what "The" refers to, unless we look into the .tt file. At least it's separate from the other "The"'s.

I tried the option from bug 6988

<li>
    </span>The [% '<a href="http://www.myacpl.org/">' %]Athens County Public Libraries[% '</a>' %], Ohio, USA (MARC sponsorship, documentation, template maintenance)</span></li>

and the strings are

#: koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:743
#, fuzzy, c-format
msgid "' %%], Ohio, USA (MARC sponsorship, documentation, template maintenance)"
msgstr ", Ohio, USA (MARC, documentation, maintenance des gabarits)"

#: koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:743
#, fuzzy, c-format
msgid "' %%]Athens County Public Libraries[%% '"
msgstr "Athens County Public Libraries"

#: koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:743
#, fuzzy, c-format
msgid "The [%% '"
msgstr "La "

The "The" is still separate from the noun, but at least it's separate from the other "The"'s too.
Comment 9 Katrin Fischer 2023-10-28 12:55:11 UTC
I think Owen suggested a way to rewrite the about page that would get rid of a lot of the "the". I beliebe while other suggestions might work, this could be the best option.
Comment 10 Owen Leonard 2023-10-30 15:21:36 UTC
Created attachment 158074 [details] [review]
Bug 34900: Simplify text of about page license information

This patch simplifies the language describing third-party libraries and
their licenses so that translation are not so complicated.

The patch also removes information about some assets which are no longer
part of Koha.

The license information now lists only the library name, version (if
possible) and license.

To test, apply the patch and go to the about page in the staff
interface. Open the "Licenses" tab and check the content.
Comment 11 Katrin Fischer 2023-10-30 20:46:33 UTC
This is looking good, but why not change the last on the page too?

Enquire.js
Enquire.js v2.0.1 licensed under the MIT license.
Comment 12 David Nind 2023-11-30 18:33:29 UTC
Added assignee.
Comment 13 Owen Leonard 2023-12-01 13:06:53 UTC
Created attachment 159448 [details] [review]
Bug 34900: (follow-up) Correct last entry
Comment 14 David Nind 2023-12-03 19:36:35 UTC
Created attachment 159501 [details] [review]
Bug 34900: Simplify text of about page license information

This patch simplifies the language describing third-party libraries and
their licenses so that translation are not so complicated.

The patch also removes information about some assets which are no longer
part of Koha.

The license information now lists only the library name, version (if
possible) and license.

To test, apply the patch and go to the about page in the staff
interface. Open the "Licenses" tab and check the content.

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 David Nind 2023-12-03 19:36:38 UTC
Created attachment 159502 [details] [review]
Bug 34900: (follow-up) Correct last entry

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2023-12-03 19:36:41 UTC
Created attachment 159503 [details] [review]
Bug 34900: (follow-up) List alphabetically and tidy ups

Listed in alphabetical order (except for Koha, which is listed
at the start).

Tidy ups and consistency changes:
- end of each entry: remove full stops
- separator between software and license: use a colon
- headings for software/library name: use sentence case
  unless a noun, abbreviation, or the actual software name
- http and https: use https where site uses it
- URLs: update where required
- license names: use consistent full names with title case

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 David Nind 2023-12-03 19:50:37 UTC
I probably got a bit carried away with the follow-up - possibly outside the scope of the bug?

Happy to put in a separate bug!

License names: I used the full name and made consistent (for example: MIT License, instead of MIT or MIT license; GNU General Public License vX, instead of GPL or General public license). I did think about using abbreviations used at https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository or https://opensource.org/licenses/ Hopefully this helps a bit with translation.

Questions for other bugs, if required:
- Should the version of a piece of software be shown? A few do.
- Should we have a short description of what they do, where they are used in Koha?
- Should we change to a bullet list?
- Versions of libraries: many seem quite old or not updated for a while. 
  . Should I create an omnibus bug to update?
  . Should we update all libraries used at the start of a cycle? (The biggies, such as Bootstrap and jQuery, might be more problematic.)
  . Or do we have a "if it isn't broken, don't fix it" approach, unless there are security updates?
Comment 18 Victor Grousset/tuxayo 2023-12-07 20:58:36 UTC
These are very nice improvements, much cleaner :)

After comparing the pages before and after the patches, here is the relevant thing I've found:
There is no more mention of FileSaver library despite it being included in cateditor-ui.inc and lib/datatables/datatables.js

Mistake or good reason?
Comment 19 Victor Grousset/tuxayo 2023-12-07 21:29:55 UTC
Also, no entry for DataTables itself. Is there a reason or should I open a ticket to report it?


Some opinions about:

(In reply to David Nind from comment #17)
> Questions for other bugs, if required:
> - Should the version of a piece of software be shown? A few do.

Might be tough to be reliably maintained. Maybe not actually, it's not often to have library updates and a QA guideline to remind to keep the about page up to date would do.

> - Should we have a short description of what they do, where they are used in
> Koha?

Maybe, if someone wants to volunteer to implement it why not. Or maybe we prefer to spare any new string for translators unless necessary? Or even a few dozen are not a big deal?

> - Should we change to a bullet list?
> - Versions of libraries: many seem quite old or not updated for a while. 
>   . Should I create an omnibus bug to update?

Now that you remention it, it might have enough value as a technical documentation. Both for regular development and when looking at security issues. Oops, I understood that as creating a ticket to add the version for all libraries. Answer to your question comes later down.

>   . Should we update all libraries used at the start of a cycle? (The
> biggies, such as Bootstrap and jQuery, might be more problematic.)

Even the small ones, multiple of them might need to test and tweak a lot of pages. So overall it might be equivalent like if we had another (or multiple more?) Bootstrap, jQuery, datatable.

>   . Or do we have a "if it isn't broken, don't fix it" approach, unless
> there are security updates?

Seems like the current situation due to limited resources. It's seems hard enough at the moment to keep the biggies up to date. Unless there is some spare capacity after catching up for security, compatibility, big bugfixes. Until then it's tough to plan for general updates of the rest. If someone needs a new feature or just has an itch for updating a library it can still happen.
Comment 20 David Nind 2023-12-07 22:02:22 UTC
(In reply to Victor Grousset/tuxayo from comment #18)
> These are very nice improvements, much cleaner :)
> 
> After comparing the pages before and after the patches, here is the relevant
> thing I've found:
> There is no more mention of FileSaver library despite it being included in
> cateditor-ui.inc and lib/datatables/datatables.js
> 
> Mistake or good reason?


After a quick look, that looks like a mistake, so should be added back in.

I've just had a quick look (not comprehensive), and it looks like there are some software licences missing, including:
- DataTables (koha-tmpl/intranet-tmpl/lib/datatables)
- GreyBox (koha-tmpl/intranet-tmpl/lib/greybox)
- Some jQuery plugins - jsTree, rowGroup (doesn't look the same as jquery.dataTables.grouping.js), fnReloadAjax (part of DataTables?), Humanized Messages, jquery.dataTables.columnFilter.js (part of DataTables?), highlight (part of DataTables?), jquery-jeditable (koha-tmpl/intranet-tmpl/lib/jquery/plugins/)
- linters (several) (koha-tmpl/intranet-tmpl/lib/linters)
- sortable (koha-tmpl/intranet-tmpl/lib/linters/sortable)
- vis-timeline and vis-graph2d (koha-tmpl/intranet-tmpl/lib/vis-timeline/)
- media.match.js (koha-tmpl/opac-tmpl/lib/)

Maybe this should be a separate bug to review what is used and add any missing ones?
Comment 21 Victor Grousset/tuxayo 2023-12-15 20:36:45 UTC
> After a quick look, that looks like a mistake, so should be added back in.

ok, thanks for the confirmation, still needs work then.

> I've just had a quick look (not comprehensive), and it looks like
> there are some software licences missing, including:
> [...]
> Maybe this should be a separate bug to review what is used
> and add any missing ones?

Indeed that would be another ticket. There doesn't seem to be an existing one, so here is Bug 35584 feel free to change stuff and add details if needed.
Comment 22 Owen Leonard 2023-12-19 19:09:32 UTC Comment hidden (obsolete)
Comment 23 Owen Leonard 2023-12-19 19:10:05 UTC
Created attachment 160070 [details] [review]
Bug 34900: (follow-up) Add version information to more entries

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 24 Owen Leonard 2023-12-19 19:11:32 UTC
If I read the comments correctly the issue of missing libraries was what caused this to be Failed QA, and now that's in a separate bug. As such I'm putting this back to "Signed off."
Comment 25 David Nind 2023-12-19 19:33:57 UTC
(In reply to Owen Leonard from comment #24)
> If I read the comments correctly the issue of missing libraries was what
> caused this to be Failed QA, and now that's in a separate bug. As such I'm
> putting this back to "Signed off."

That sounds fine to me!
Comment 26 Jonathan Druart 2024-01-04 12:41:15 UTC
Created attachment 160522 [details] [review]
Bug 34900: Simplify text of about page license information

This patch simplifies the language describing third-party libraries and
their licenses so that translation are not so complicated.

The patch also removes information about some assets which are no longer
part of Koha.

The license information now lists only the library name, version (if
possible) and license.

To test, apply the patch and go to the about page in the staff
interface. Open the "Licenses" tab and check the content.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 27 Jonathan Druart 2024-01-04 12:41:18 UTC
Created attachment 160523 [details] [review]
Bug 34900: (follow-up) Correct last entry

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 28 Jonathan Druart 2024-01-04 12:41:21 UTC
Created attachment 160524 [details] [review]
Bug 34900: (follow-up) List alphabetically and tidy ups

Listed in alphabetical order (except for Koha, which is listed
at the start).

Tidy ups and consistency changes:
- end of each entry: remove full stops
- separator between software and license: use a colon
- headings for software/library name: use sentence case
  unless a noun, abbreviation, or the actual software name
- http and https: use https where site uses it
- URLs: update where required
- license names: use consistent full names with title case

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 29 Jonathan Druart 2024-01-04 12:41:24 UTC
Created attachment 160525 [details] [review]
Bug 34900: (follow-up) Add version information to more entries

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 30 Katrin Fischer 2024-01-04 15:53:37 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 31 Fridolin Somers 2024-01-08 14:32:13 UTC
Pushed to 23.11.x for 23.11.02
Comment 32 Lucas Gass 2024-01-12 22:21:08 UTC
Backported to 23.05.x for upcoming 23.05.08