Re: [aur-dev] Fix for some plural strings

2014-07-21 Thread Sebastian Wilzbach
Hi, 

How about

view all (1 comment)
view all (n comments)



On July 21, 2014 9:03:52 AM CEST, Lukas Fleischer archli...@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
 
 


Re: [aur-dev] Fix for some plural strings

2014-07-21 Thread Achilleas Pipinellis
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 archli...@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)


Re: [aur-dev] Fix for some plural strings

2014-07-21 Thread Lukas Fleischer
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
 


[aur-dev] Fix for some plural strings

2014-07-17 Thread Safa Alfulaij
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
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index f07580b..b46bd14 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -255,25 +255,25 @@ if ($uid):
 * limitations are exceeded.
 */
if (strlen($pi['pkgname'])  64) {
-   $error = __(Error - Package name cannot be 
greater than %d characters, 64);
+   $error = _n(Error - Package name cannot be 
greater than %d character, Error - Package name cannot be greater than %d 
characters, 64);
break;
}
if (strlen($pi['url'])  255) {
-   $error = __(Error - Package URL cannot be 
greater than %d characters, 255);
+   $error = _n(Error - Package URL cannot be 
greater than %d character, Error - Package URL cannot be greater than %d 
characters, 255);
break;
}
if (strlen($pi['pkgdesc'])  255) {
-   $error = __(Error - Package description cannot 
be greater than %d characters, 255);
+   $error = __(Error - Package description cannot 
be greater than %d character, Error - Package description cannot be greater 
than %d characters, 255);
break;
}
foreach ($pi['license'] as $lic) {
if (strlen($lic  64)) {
-   $error = __(Error - Package license 
cannot be greater than %d characters, 64);
+   $error = __(Error - Package license 
cannot be greater than %d character, Error - Package license cannot be 
greater than %d characters, 64);
break;
}
}
if (strlen($pkginfo[$key]['full-version'])  32) {
-   $error = __(Error - Package version cannot be 
greater than %d characters, 32);
+   $error = __(Error - Package version cannot be 
greater than %d character, Error - Package version cannot be greater than %d 
characters, 32);
break;
}
 
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 73d01a5..d869bbb 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -119,8 +119,8 @@ function 
process_account_form($TYPE,$A,$U=,$T=,$S=,$E=,
 
if (!$error  !valid_username($U)) {
$error = __(The username is invalid.) . ul\n
-   .li . __(It must be between %s and %s characters 
long,
-   USERNAME_MIN_LEN,  USERNAME_MAX_LEN )
+.li . __(It must be between %s and %s long,
+_n('%s','%s',USERNAME_MIN_LEN),  _n('%s character','%s 
characters',USERNAME_MAX_LEN))
. /li
. li . __(Start and end with a letter or number) 
. /li
. li . __(Can contain only one period, underscore 
or hyphen.)
@@ -131,7 +131,7 @@ function 
process_account_form($TYPE,$A,$U=,$T=,$S=,$E=,
$error = __(Password fields do not match.);
}
if (!$error  $P != ''  !good_passwd($P))
-   $error = __(Your password must be at least %s 
characters.,PASSWD_MIN_LEN);
+$error = _n(Your password must be at least %s 
character.,Your password must be at least %s characters.,PASSWD_MIN_LEN);
 
if (!$error  !valid_email($E)) {
$error = __(The email address is invalid.);
diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index 20521a0..9c02daf 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -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=?= _n('View all %s 
comment', 'View all %s comments', $count) ??= __('All comments', $count) 
?/a
/h3
 /div
 ?php endif; ?


Re: [aur-dev] Fix for some plural strings

2014-07-17 Thread Lukas Fleischer
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