[aur-dev] Fix for some plural strings
This is a patch to fix some strings that are not in plural. Hope you can add some comments to "It must be between %s and %s characters long" string parts so that the translator can understand whats going on. Also I didn't check if the var. is a number or a string. Patch attached. Regards, Safa
Hello Safa, On Thu, 17 Jul 2014 at 15:08:18, Safa Alfulaij wrote:
This is a patch to fix some strings that are not in plural. Hope you can add some comments to "It must be between %s and %s characters long" string parts so that the translator can understand whats going on. Also I didn't check if the var. is a number or a string. Patch attached.
First of all, thank you for contributing. However, I don't think it is necessary to pluralize these strings since the arguments are either constants or otherwise guaranteed to be always >1.
Regards, Safa
Best regards, Lukas
Hello Lukas, About the constants no problem leave them as they are, but the rest not. Not all of the languages has one form only after 1, Arabic (for example) has 6 forms, 4 of them is after 1. This is not a good reason for not accepting my patch for these at least :) Note: I mix always between "has" and "have", so I am sorry for my poor language :\ Regards, Safa
On Thu, 17 Jul 2014 at 17:00:26, Safa Alfulaij wrote:
Hello Lukas,
About the constants no problem leave them as they are, but the rest not. Not all of the languages has one form only after 1, Arabic (for example) has 6 forms, 4 of them is after 1. This is not a good reason for not accepting my patch for these at least :)
So the only thing that is left is "View all %s comments" and I am not sure how to pluralize that, "View all 1 comment" sounds very wrong. Suggestions?
Note: I mix always between "has" and "have", so I am sorry for my poor language :\ Regards, Safa
Hi, How about "view all (1 comment)" "view all (n comments)" On July 21, 2014 9:03:52 AM CEST, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Thu, 17 Jul 2014 at 17:00:26, Safa Alfulaij wrote:
Hello Lukas,
About the constants no problem leave them as they are, but the rest not. Not all of the languages has one form only after 1, Arabic (for example) has 6 forms, 4 of them is after 1. This is not a good reason for not accepting my patch for these at least :)
So the only thing that is left is "View all %s comments" and I am not sure how to pluralize that, "View all 1 comment" sounds very wrong. Suggestions?
Note: I mix always between "has" and "have", so I am sorry for my poor language :\ Regards, Safa
On 07/21/2014 10:37 AM, Sebastian Wilzbach wrote:
Hi,
How about
"view all (1 comment)" "view all (n comments)"
On July 21, 2014 9:03:52 AM CEST, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Thu, 17 Jul 2014 at 17:00:26, Safa Alfulaij wrote:
Hello Lukas,
About the constants no problem leave them as they are, but the rest not. Not all of the languages has one form only after 1, Arabic (for example) has 6 forms, 4 of them is after 1. This is not a good reason for not accepting my patch for these at least :)
So the only thing that is left is "View all %s comments" and I am not sure how to pluralize that, "View all 1 comment" sounds very wrong. Suggestions?
Note: I mix always between "has" and "have", so I am sorry for my poor language :\ Regards, Safa
Or drop "all": "View %s comment(s)"
Hello. There is "It must be between %s and %s characters long" and "Your password must be at least %s characters." besides the "View all %n comments". Please, English differs from other languages. If a string don't need to pluralize in English, It will need to pluralize in other languages. About "View all %s comments", There is no problem if you patch it as I sent. There is already an if statement that checks if $count is higher than 10. Hard-coding "View all %s comment" don't give any problems as it won't be used. Regards, Safa
On Mon, 21 Jul 2014 at 11:59:45, Safa Alfulaij wrote:
Hello. There is "It must be between %s and %s characters long" and "Your password must be at least %s characters." besides the "View all %n comments". Please, English differs from other languages. If a string don't need to pluralize in English, It will need to pluralize in other languages.
These are constant as well. You might argue that the constants can be changed by modifying the global configuration but the package submission form will be dropped before the 4.0.0 release anyway, so there is not much point in fixing that now.
About "View all %s comments", There is no problem if you patch it as I sent. There is already an if statement that checks if $count is higher than 10. Hard-coding "View all %s comment" don't give any problems as it won't be used.
It is not a problem when displaying the string but translators might be confused by "View all 1 comment". I currently like Sebastian's suggestion ("View all (%d comments)") best.
Regards, Safa
On 21/07/14 12:16, Lukas Fleischer wrote:
On Mon, 21 Jul 2014 at 11:59:45, Safa Alfulaij wrote:
About "View all %s comments", There is no problem if you patch it as I sent. There is already an if statement that checks if $count is higher than 10. Hard-coding "View all %s comment" don't give any problems as it won't be used.
It is not a problem when displaying the string but translators might be confused by "View all 1 comment". I currently like Sebastian's suggestion ("View all (%d comments)") best.
That last suggestion doesn't read naturally at all. Much simpler and clearer would be: "View all comments (%d)".
The title "View all %s comments" becomes "View all %s comment" when adding plural support (which is needed for other languages that have more than one plural form). Simply remove the comment count from the message and add it in parentheses. Suggested-by: Safa Alfulaij <safa1996alfulaij@gmail.com> Suggested-by: Sebastian Wilzbach <sebi@wilzbach.me> Suggested-by: kachelaqa <kachelaqa@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/template/pkg_comments.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 20521a0..d687cde 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -4,7 +4,7 @@ $count = pkgbase_comments_count($base_id); ?> <div id="news"> <h3> - <a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all %s comments' , $count) ?>"><?= __('Latest Comments') ?></a> + <a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all comments' , $count) ?> (<?= $count ?>)"><?= __('Latest Comments') ?></a> <span class="arrow"></span> </h3> @@ -47,7 +47,7 @@ $count = pkgbase_comments_count($base_id); <?php if ($count > 10 && !isset($_GET['comments'])): ?> <div id="news"> <h3> - <a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all %s comments', $count) ?>"><?= __('All comments', $count) ?></a> + <a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all comments') ?> (<?= $count ?>)"><?= __('All comments', $count) ?></a> </h3> </div> <?php endif; ?> -- 2.0.2
Show the correct number of package base comments in the tool tip message of the "Latest Comments" link. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/template/pkg_comments.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index d687cde..9961554 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -1,5 +1,11 @@ <?php -$base_id = pkgbase_from_pkgid($row['ID']); +if (isset($row['BaseID'])) { + /* On a package details page. */ + $base_id = $row['BaseID']; +} else { + /* On a package base details page. */ + $base_id = $row['ID']; +} $count = pkgbase_comments_count($base_id); ?> <div id="news"> -- 2.0.2
participants (5)
-
Achilleas Pipinellis
-
kachelaqa
-
Lukas Fleischer
-
Safa Alfulaij
-
Sebastian Wilzbach