#35993: Replace outdated information on gettext f-string support
-------------------------------+------------------------------------
     Reporter:  Athena         |                    Owner:  Athena
         Type:  Bug            |                   Status:  assigned
    Component:  Documentation  |                  Version:  5.1
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  1
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+------------------------------------
Comment (by Ahmed Nassar):

 Hello,

 I've reviewed PR #18910 and identified some critical technical aspects
 regarding gettext f-string support that need to be addressed in the
 documentation:

 1. There's a key misunderstanding about gettext 0.23+ behavior:
    - The change actually prevents f-string extraction, rather than adding
 support
    - This differs from 0.21.1 which extracted f-strings into .po files

 2. Important technical limitations:
    - F-string expressions evaluate before gettext processing occurs
    - Django uses Python's gettext implementation, not system gettext

 I'd be happy to help improve the patch by:
 - Adding clear documentation about these limitations
 - Providing correct usage examples
 - Including proper alternatives using .format() or % formatting
 - Explaining why patterns like _(f"Welcome {staff}") don't work

 Would this approach align with what's needed for this ticket? I can submit
 an updated PR addressing these points.

 Best regards
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35993#comment:6>
Django <https://code.djangoproject.com/>
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070195690e6e14-3a0e58d7-6a52-4160-bd95-0e8c1de57950-000000%40eu-central-1.amazonses.com.

Reply via email to