The usage statistics page uses an include file, country-list.inc, which contains a large list of country names. When this include file is processed for translation the entire list shows up as one string: #: koha-tmpl/intranet-tmpl/prog/en/includes/country-list.inc:1 #, c-format msgid "[%% SET countries = [ \"Afghanistan\", \"Albania\", \"Algeria\", \"Andorra\"... This file should be reworked so that each country is a separate string in translations.
Created attachment 157336 [details] [review] Bug 35091: Improve translation of usage statistics country list This patch reworks country-list.inc so that each country name can be wrapped separately in the t() translation function and be processed individually during the translation process. To test, apply the patch and update a translation, e.g. fr-FR: - perl misc/translator/translate update fr-FR - Edit the updated po file for the language you chose, e.g. misc/translator/po/fr-FR-messages.po, and locate strings from country-strings.inc. Each country names should show up as a separate string for translation. - Update the file to fill in translated strings for one or more countries. For example: koha-tmpl/intranet-tmpl/prog/en/includes/country-list.inc:2 msgid "Afghanistan" msgstr "" - Install the updated po file: - perl misc/translator/translate install fr-FR - Enable the translation if necessary under Administration -> System preferences -> language. - Go to Administration -> Share usage statistics and check the "Your country" dropdown. The list should look correct. - Switch to your updated translation and confirm that the country names you translated show up as expected.
Created attachment 157362 [details] [review] Bug 35091: Improve translation of usage statistics country list This patch reworks country-list.inc so that each country name can be wrapped separately in the t() translation function and be processed individually during the translation process. To test, apply the patch and update a translation, e.g. fr-FR: - perl misc/translator/translate update fr-FR - Edit the updated po file for the language you chose, e.g. misc/translator/po/fr-FR-messages.po, and locate strings from country-strings.inc. Each country names should show up as a separate string for translation. - Update the file to fill in translated strings for one or more countries. For example: koha-tmpl/intranet-tmpl/prog/en/includes/country-list.inc:2 msgid "Afghanistan" msgstr "" - Install the updated po file: - perl misc/translator/translate install fr-FR - Enable the translation if necessary under Administration -> System preferences -> language. - Go to Administration -> Share usage statistics and check the "Your country" dropdown. The list should look correct. - Switch to your updated translation and confirm that the country names you translated show up as expected. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Hi Lucas. It looks to me like you've signed this off, but the status hasn't been changed 8-) David
Created attachment 157598 [details] [review] Bug 35091: Improve translation of usage statistics country list This patch reworks country-list.inc so that each country name can be wrapped separately in the t() translation function and be processed individually during the translation process. To test, apply the patch and update a translation, e.g. fr-FR: - perl misc/translator/translate update fr-FR - Edit the updated po file for the language you chose, e.g. misc/translator/po/fr-FR-messages.po, and locate strings from country-strings.inc. Each country names should show up as a separate string for translation. - Update the file to fill in translated strings for one or more countries. For example: koha-tmpl/intranet-tmpl/prog/en/includes/country-list.inc:2 msgid "Afghanistan" msgstr "" - Install the updated po file: - perl misc/translator/translate install fr-FR - Enable the translation if necessary under Administration -> System preferences -> language. - Go to Administration -> Share usage statistics and check the "Your country" dropdown. The list should look correct. - Switch to your updated translation and confirm that the country names you translated show up as expected. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com>
This is a good improvement, but got me thinking, because I quite hated translating all these :) Currently we maintain at least 2 country lists. The other is the authorised value COUNTRY. And both string sets end up in different translation files. I am hoping the suggestion feature on Weblate/Pootle will help here now :)
Hm, OK - not a problem of this patch, but what we are doing here is a bit strange, we should store country codes, not the names that can change when translated: Bug 35213 - Standardize country information sent to Hea
Created attachment 158175 [details] [review] Bug 35091: Improve translation of usage statistics country list This patch reworks country-list.inc so that each country name can be wrapped separately in the t() translation function and be processed individually during the translation process. To test, apply the patch and update a translation, e.g. fr-FR: - perl misc/translator/translate update fr-FR - Edit the updated po file for the language you chose, e.g. misc/translator/po/fr-FR-messages.po, and locate strings from country-strings.inc. Each country names should show up as a separate string for translation. - Update the file to fill in translated strings for one or more countries. For example: koha-tmpl/intranet-tmpl/prog/en/includes/country-list.inc:2 msgid "Afghanistan" msgstr "" - Install the updated po file: - perl misc/translator/translate install fr-FR - Enable the translation if necessary under Administration -> System preferences -> language. - Go to Administration -> Share usage statistics and check the "Your country" dropdown. The list should look correct. - Switch to your updated translation and confirm that the country names you translated show up as expected. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x