Visitar URL original
gettext: deprecate selecting plural form by fractional numbers (part 2) · Issue #88434 · python/cpython · GitHub
Skip to content

gettext: deprecate selecting plural form by fractional numbers (part 2) #88434

Closed

Description

@serhiy-storchaka
BPO 44268
Nosy @serhiy-storchaka, @pablogsal

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-05-30.09:44:10.301>
labels = ['type-feature', 'library', '3.10', '3.11']
title = 'gettext: deprecate selecting plural form by fractional numbers (part 2)'
updated_at = <Date 2021-05-30.19:03:22.590>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2021-05-30.19:03:22.590>
actor = 'pablogsal'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-05-30.09:44:10.301>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 44268
keywords = []
message_count = 2.0
messages = ['394762', '394776']
nosy_count = 2.0
nosy_names = ['serhiy.storchaka', 'pablogsal']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue44268'
versions = ['Python 3.10', 'Python 3.11']

Linked PRs

Activity

  1. serhiy-storchaka commented on May 30, 2021

    @serhiy-storchaka
    MemberAuthor

    Non-integer numbers in GNUTranslations.ngettext() are deprecated since 3.7 (see bpo-28692 for rationale). But I forget to add deprecation warning for default implementation (which just tests n == 1) and forget to add the "deprecated" directive in the module documentation. So currently

        gettext("Elapsed: %s second", "Elapsed: %s seconds", 1.25)

    will emit a warning if there is a translation for these strings, and no warnings if it is not translated yet, or translation file is not found, or null translation is used.

    It is now time to convert warnings to errors, but it would be error-prone since many developers do not have translations yet when write a code or use no translation (and fallback to hard-coded English).

    The safest way is to add deprecation warnings also for default and fallback implementation before turning all of them into errors. Pablo, can we add these warnings in 3.10?

  2. added
    3.11only security fixes
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on May 30, 2021
  3. pablogsal commented on May 30, 2021

    @pablogsal
    Member

    Pablo, can we add these warnings in 3.10?

    Thanks for checking! Yeah, I think it makes sense to go ahead adding these warnings to 3.10 . Please, add me as a reviewer to the backport PR to 3.10.

  4. transferred this issue fromon Apr 10, 2022
  5. serhiy-storchaka commented on Oct 8, 2023

    @serhiy-storchaka
    MemberAuthor

    While working on this issue I have found that stacklevel for the existing deprecation warning does is not always correct and that the code where new warnings will be added is not tested at all. So I opened a separate issue #110519 for this because these changes are worth to be backported.

  6. added 2 commits that reference this issue on Oct 9, 2023
  7. moved this from In Progress to Done in Gettext issueson Oct 14, 2023
  8. added a commit that references this issue on Feb 11, 2024
  9. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.10 (EOL)end of life3.11only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions