[aur-dev] [PATCH] Dedupe translatable strings
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/html/pkgdel.php | 2 +- web/html/pkgdisown.php | 2 +- web/html/pkgflag.php | 2 +- web/html/pkgmerge.php | 2 +- web/template/comaintainers_form.php | 2 +- web/template/pkgreq_close_form.php | 2 +- web/template/pkgreq_form.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php index c522e25..21a2677 100644 --- a/web/html/pkgdel.php +++ b/web/html/pkgdel.php @@ -12,7 +12,7 @@ html_header(__("Package Deletion")); if (has_credential(CRED_PKGBASE_DELETE)): ?> <div class="box"> - <h2><?= __('Delete Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Delete Package') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to delete the package base %s%s%s and the following packages from the AUR: ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/html/pkgdisown.php b/web/html/pkgdisown.php index 7ca6e6a..d76d830 100644 --- a/web/html/pkgdisown.php +++ b/web/html/pkgdisown.php @@ -15,7 +15,7 @@ $comaintainers = pkgbase_get_comaintainers($base_id); if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?> <div class="box"> - <h2><?= __('Disown Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Disown Package') ?>: <? htmlspecialchars($pkgbase_name)) ?></h2> <p> <?= __('Use this form to disown the package base %s%s%s which includes the following packages: ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/html/pkgflag.php b/web/html/pkgflag.php index e6e7c64..597dcb8 100644 --- a/web/html/pkgflag.php +++ b/web/html/pkgflag.php @@ -43,7 +43,7 @@ html_header(__("Flag Package Out-Of-Date")); if (has_credential(CRED_PKGBASE_FLAG)): ?> <div class="box"> - <h2><?= __('Flag Package Out-Of-Date: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Flag Package Out-Of-Date') ?>: <? htmlspecialchars($pkgbase_name)) ?></h2> <p> <?= __('Use this form to flag the package base %s%s%s and the following packages out-of-date: ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/html/pkgmerge.php b/web/html/pkgmerge.php index 3511390..5a14fb5 100644 --- a/web/html/pkgmerge.php +++ b/web/html/pkgmerge.php @@ -12,7 +12,7 @@ html_header(__("Package Merging")); if (has_credential(CRED_PKGBASE_DELETE)): ?> <div class="box"> - <h2><?= __('Merge Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Merge Package') ?>: <? htmlspecialchars($pkgbase_name)) ?></h2> <p> <?= __('Use this form to merge the package base %s%s%s into another package. ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/template/comaintainers_form.php b/web/template/comaintainers_form.php index 050f255..024364d 100644 --- a/web/template/comaintainers_form.php +++ b/web/template/comaintainers_form.php @@ -1,5 +1,5 @@ <div class="box"> - <h2><?= __('Manage Co-maintainers: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Manage Co-maintainers') ?>: <? htmlspecialchars($pkgbase_name)) ?></h2> <p> <?= __('Use this form to add co-maintainers for %s%s%s (one user name per line):', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/template/pkgreq_close_form.php b/web/template/pkgreq_close_form.php index 00efafe..128d094 100644 --- a/web/template/pkgreq_close_form.php +++ b/web/template/pkgreq_close_form.php @@ -1,5 +1,5 @@ <div class="box"> - <h2><?= __('Close Request: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Close Request' ?>: <? htmlspecialchars($pkgbase_name)) ?></h2> <p> <?= __('Use this form to close the request for package base %s%s%s.', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/template/pkgreq_form.php b/web/template/pkgreq_form.php index 6cf8588..55042af 100644 --- a/web/template/pkgreq_form.php +++ b/web/template/pkgreq_form.php @@ -1,5 +1,5 @@ <div class="box"> - <h2><?= __('Submit Request: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Submit Request') ?>: <? htmlspecialchars($pkgbase_name)) ?></h2> <p> <?= __('Use this form to file a request against package base %s%s%s which includes the following packages:', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> -- 2.6.2
On 11/25/2015 02:36 AM, Lukas Fleischer wrote:
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/html/pkgdel.php | 2 +- web/html/pkgdisown.php | 2 +- web/html/pkgflag.php | 2 +- web/html/pkgmerge.php | 2 +- web/template/comaintainers_form.php | 2 +- web/template/pkgreq_close_form.php | 2 +- web/template/pkgreq_form.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php index c522e25..21a2677 100644 --- a/web/html/pkgdel.php +++ b/web/html/pkgdel.php @@ -12,7 +12,7 @@ html_header(__("Package Deletion"));
if (has_credential(CRED_PKGBASE_DELETE)): ?> <div class="box"> - <h2><?= __('Delete Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Delete Package') ?>: <? htmlspecialchars($pkgbase_name) ?></h2>
It looks like you forgot to remove most of the closing parentheses, except this first one. -- Eli Schwartz
Hello. I don't know if it's the right place to express my opinion, but I can't find another place to do so. Strings should not be splitted like that, according to GNOME's guidelines [1] and KDE's guidlines [2], it's a bad practise to do that (even if it's just for removing a colon). 1: https://wiki.gnome.org/TranslationProject/DevGuidelines/Never%20split%20sent... 2: https://techbase.kde.org/Development/Tutorials/Localization/i18n_Mistakes#Pi... Regards, Safa
On 25/11, Safa Alfulaij wrote:
Hello. I don't know if it's the right place to express my opinion, but I can't find another place to do so. Strings should not be splitted like that, according to GNOME's guidelines [1] and KDE's guidlines [2], it's a bad practise to do that (even if it's just for removing a colon).
Those links talk about splitting sentences, which is not what is being done here. The colon isn't part of a sentence, it's just a separator, so is thus pretty irrelevant. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/
2015-11-25 21:29 GMT+03:00 Johannes Löthberg <johannes@kyriasis.com>:
Those links talk about splitting sentences, which is not what is being done here. The colon isn't part of a sentence, it's just a separator, so is thus pretty irrelevant.
Sentences or strings refers to the same thing. It's not necessary to treat the translator as an end-user that shouldn't be aware/take care of placeholders or accelerators. And doing that would combine the strings with the same content as a single string, which might be impossible to translate because the context differs. Regards, Safa
On Wed, 25 Nov 2015 at 16:54:59, Eli Schwartz wrote:
[...] It looks like you forgot to remove most of the closing parentheses, except this first one. [...]
Good catch, will amend that. Thanks!
On 25/11, Safa Alfulaij wrote:
2015-11-25 21:29 GMT+03:00 Johannes Löthberg <johannes@kyriasis.com>:
Those links talk about splitting sentences, which is not what is being done here. The colon isn't part of a sentence, it's just a separator, so is thus pretty irrelevant.
Sentences or strings refers to the same thing.
No, it doesn't. Splitting sentences literally refers to taking a full sentence and then having parts of it be translated separately, which, again, is not the case here.
which might be impossible to translate because the context differs.
*If* that was the case here it would obviously be wrong to change it, yes, but it's the same context. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/
On Wed, 25 Nov 2015 at 20:52:57, Safa Alfulaij wrote:
2015-11-25 21:29 GMT+03:00 Johannes Löthberg <johannes@kyriasis.com>:
Those links talk about splitting sentences, which is not what is being done here. The colon isn't part of a sentence, it's just a separator, so is thus pretty irrelevant.
Sentences or strings refers to the same thing. It's not necessary to treat the translator as an end-user that shouldn't be aware/take care of placeholders or accelerators. And doing that would combine the strings with the same content as a single string, which might be impossible to translate because the context differs. [...]
I disagree. For example, the titles of our web pages are AUR (en) -- Home AUR (en) -- Packages AUR (en) -- Register [...] but there is absolutely no point in changing the strings from "Home", "Packages" and "Register" to "%s (%s) -- Home", "%s (%s) -- Packages" and "%s (%s) -- Register". In fact, this would be quite confusing for translators. The same applies here: We do not split any translatable strings but remove the separator and the package base name from the strings, thereby reducing the workload of translators. There is no context lost here. I even checked all translations before submitting this patch: None of them seems to change the ": %s" suffix to something else.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/html/pkgdel.php | 2 +- web/html/pkgdisown.php | 2 +- web/html/pkgflag.php | 2 +- web/html/pkgmerge.php | 2 +- web/template/comaintainers_form.php | 2 +- web/template/pkgreq_close_form.php | 2 +- web/template/pkgreq_form.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php index c522e25..21a2677 100644 --- a/web/html/pkgdel.php +++ b/web/html/pkgdel.php @@ -12,7 +12,7 @@ html_header(__("Package Deletion")); if (has_credential(CRED_PKGBASE_DELETE)): ?> <div class="box"> - <h2><?= __('Delete Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Delete Package') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to delete the package base %s%s%s and the following packages from the AUR: ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/html/pkgdisown.php b/web/html/pkgdisown.php index 7ca6e6a..f24a2d6 100644 --- a/web/html/pkgdisown.php +++ b/web/html/pkgdisown.php @@ -15,7 +15,7 @@ $comaintainers = pkgbase_get_comaintainers($base_id); if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?> <div class="box"> - <h2><?= __('Disown Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Disown Package') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to disown the package base %s%s%s which includes the following packages: ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/html/pkgflag.php b/web/html/pkgflag.php index e6e7c64..f50c208 100644 --- a/web/html/pkgflag.php +++ b/web/html/pkgflag.php @@ -43,7 +43,7 @@ html_header(__("Flag Package Out-Of-Date")); if (has_credential(CRED_PKGBASE_FLAG)): ?> <div class="box"> - <h2><?= __('Flag Package Out-Of-Date: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Flag Package Out-Of-Date') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to flag the package base %s%s%s and the following packages out-of-date: ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/html/pkgmerge.php b/web/html/pkgmerge.php index 3511390..c0ce655 100644 --- a/web/html/pkgmerge.php +++ b/web/html/pkgmerge.php @@ -12,7 +12,7 @@ html_header(__("Package Merging")); if (has_credential(CRED_PKGBASE_DELETE)): ?> <div class="box"> - <h2><?= __('Merge Package: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Merge Package') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to merge the package base %s%s%s into another package. ', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/template/comaintainers_form.php b/web/template/comaintainers_form.php index 050f255..70a7464 100644 --- a/web/template/comaintainers_form.php +++ b/web/template/comaintainers_form.php @@ -1,5 +1,5 @@ <div class="box"> - <h2><?= __('Manage Co-maintainers: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Manage Co-maintainers') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to add co-maintainers for %s%s%s (one user name per line):', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/template/pkgreq_close_form.php b/web/template/pkgreq_close_form.php index 00efafe..2b63d29 100644 --- a/web/template/pkgreq_close_form.php +++ b/web/template/pkgreq_close_form.php @@ -1,5 +1,5 @@ <div class="box"> - <h2><?= __('Close Request: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Close Request' ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to close the request for package base %s%s%s.', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> diff --git a/web/template/pkgreq_form.php b/web/template/pkgreq_form.php index 6cf8588..5bd2bfe 100644 --- a/web/template/pkgreq_form.php +++ b/web/template/pkgreq_form.php @@ -1,5 +1,5 @@ <div class="box"> - <h2><?= __('Submit Request: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <h2><?= __('Submit Request') ?>: <? htmlspecialchars($pkgbase_name) ?></h2> <p> <?= __('Use this form to file a request against package base %s%s%s which includes the following packages:', '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> -- 2.6.2
On 25/11/15 21:45, Lukas Fleischer wrote:
On Wed, 25 Nov 2015 at 20:52:57, Safa Alfulaij wrote:
Sentences or strings refers to the same thing. It's not necessary to treat the translator as an end-user that shouldn't be aware/take care of placeholders or accelerators. And doing that would combine the strings with the same content as a single string, which might be impossible to translate because the context differs. [...] I disagree. For example, the titles of our web pages are
AUR (en) -- Home AUR (en) -- Packages AUR (en) -- Register [...]
but there is absolutely no point in changing the strings from "Home", "Packages" and "Register" to "%s (%s) -- Home", "%s (%s) -- Packages" and "%s (%s) -- Register". In fact, this would be quite confusing for translators. The same applies here: We do not split any translatable strings but remove the separator and the package base name from the strings, thereby reducing the workload of translators. There is no context lost here. I can imagine there's some language where the right translation for "Delete Package: Foo" is something akin to"Foo package deletion", or "Deletion of Foo". Which is no longer possible.
I even checked all translations before submitting this patch: None of them seems to change the ": %s" suffix to something else. Good. But how to know such translation won't be desirable in a few months? What for instance about someone translating this sentence to a LTR language?
participants (5)
-
Eli Schwartz
-
Johannes Löthberg
-
Linas
-
Lukas Fleischer
-
Safa Alfulaij