Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-06-08 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Clara
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  ngettext,catalog,i18n,internationalization,|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Clara):

 * needs_better_patch:  0 => 1

Comment:

 We found the tag to execute selenium test --selenium in documentation now,
 so that was not the issue.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ff8407127-57ed7016-e9d4-487b-a1a9-e059ca28b050-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-06-08 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Clara
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  ngettext,catalog,i18n,internationalization,|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Clara):

 * needs_better_patch:  1 => 0

Comment:

 Patch improved in https://github.com/django/django/pull/18249
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ff814d749-b7be79ac-841e-4ad1-90e1-ee2e37317223-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-06-08 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Clara
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  ngettext,catalog,i18n,internationalization,|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Clara):

 * owner:  Piotr Kawula => Clara

Comment:

 Getting the ticket to fix the test problem.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ff8092bb7-d5914f3f-c18d-4a1e-878d-bbd267b2bfae-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-03-16 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Piotr
 |  Kawula
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  ngettext,catalog,i18n,internationalization,|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

 * has_patch:  0 => 1
 * needs_better_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e4804d7d7-7443a992-1bdd-4b67-ad73-c42e140a12b0-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-03-11 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Piotr
 |  Kawula
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  ngettext,catalog,i18n,internationalization,|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * stage:  Unreviewed => Accepted
 * type:  Uncategorized => Bug

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e2db20ff6-7fd6d5d7-c307-4f4e-b53c-51ecb697bfb8-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-03-11 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Piotr
 |  Kawula
 Type:  Uncategorized|   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  ngettext,catalog,i18n,internationalization,|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Natalia Bidart):

 Tentatively accepting.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e2db1cf9d-b789e431-0ff2-4b35-9dda-cc3fafd90e8c-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-03-08 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Piotr
 |  Kawula
 Type:  Uncategorized|   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  ngettext,catalog,i18n,internationalization,|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * cc: Claude Paroz (added)

Comment:

 Thank you Piotr for your report.

 Claude, would you have an opinion about this report? Thank you!
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e20bb06dc-dbc8f7ca-c317-4048-8be5-a6ca25277ed7-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-03-07 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Piotr
 |  Kawula
 Type:  Uncategorized|   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  ngettext,catalog,i18n,internationalization,|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Piotr Kawula:

Old description:

> When the translation engine provide an invalid plural rule the
> `pluralidx` function can return invalid index which will cause the
> `ngettext` to return value that does not exist - `undefined`.
> Same result can occur when the `newcatalog` contains invalid values, for
> example:
>
> {{{
> const newcatalog = {
>   '%s something': [],
>   ...
> }
> }}}
>
> And in `ngettext` we have:
> {{{
> django.ngettext = function(singular, plural, count) {
>  const value = django.catalog[singular];
>  if (typeof value === 'undefined') {
> return (count == 1) ? singular : plural;
>   } else {
> return value.constructor === Array ? value[django.pluralidx(count)] :
> value;
>   }
> };
> }}}
>
> Which in case of empty array go for `value[django.pluralidx(count)] `
> which is undefined.
>

> I think we want the `ngettext` function to return string always, if it
> does not find proper value in catalog, should default to the provided
> values.

New description:

 When the translation engine provide an invalid plural rule the `pluralidx`
 function can return invalid index which will cause the `ngettext` to
 return value that does not exist - `undefined`.
 Same result can occur when the `newcatalog` contains invalid values, for
 example:

 {{{
 const newcatalog = {
   '%s something': [],
   ...
 }
 }}}

 And in `ngettext` we have:
 {{{
 django.ngettext = function(singular, plural, count) {
  const value = django.catalog[singular];
  if (typeof value === 'undefined') {
 return (count == 1) ? singular : plural;
   } else {
 return value.constructor === Array ? value[django.pluralidx(count)] :
 value;
   }
 };
 }}}

 Which in case of empty array go for `value[django.pluralidx(count)] `
 which is undefined.


 I think we want the `ngettext` function to return string always, if it
 does not find proper value in catalog, should default to the provided
 values.

 It affects the previous versions too.

--
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e1803998b-fe4328be-a762-4c93-aaf9-d4b592921159-00%40eu-central-1.amazonses.com.