Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-02-19 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  Emmanuel
 Type:   |  Sandjio
  Cleanup/optimization   |   Status:  closed
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Comment (by Mariusz Felisiak ):

 In [changeset:"e72fdc850a7c7703a5e019de127a4256bc136479" e72fdc8]:
 {{{#!CommitTicketReference repository=""
 revision="e72fdc850a7c7703a5e019de127a4256bc136479"
 [5.0.x] Fixed #35153 -- Added note about locale name notation to
 FORMAT_MODULE_PATH docs.

 Co-authored-by: Paul Hermans 

 Backport of 9bd849c8d5c587209a231af643a17ec2db802ab2 from main
 }}}
-- 
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/0107018dc4edc126-d6cbaf91-a5ba-48be-94be-62faad6566a1-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-02-19 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  Emmanuel
 Type:   |  Sandjio
  Cleanup/optimization   |   Status:  closed
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * resolution:   => fixed
 * status:  assigned => closed

Comment:

 In [changeset:"9bd849c8d5c587209a231af643a17ec2db802ab2" 9bd849c8]:
 {{{#!CommitTicketReference repository=""
 revision="9bd849c8d5c587209a231af643a17ec2db802ab2"
 Fixed #35153 -- Added note about locale name notation to
 FORMAT_MODULE_PATH docs.

 Co-authored-by: Paul Hermans 
 }}}
-- 
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/0107018dc4ed3afd-0b17f190-1f28-4317-bf9b-fde6c17c77f5-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-02-19 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  Emmanuel
 Type:   |  Sandjio
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin

Comment:

 [https://github.com/django/django/pull/17884 PR]
-- 
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/0107018dc4cb2078-8ce7978a-6e2e-4831-a21a-fea983dc4149-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-02-19 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  Emmanuel
 Type:   |  Sandjio
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Emmanuel Sandjio):

 * has_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/0107018dc333a240-caf1ce70-284d-4f7c-a772-74d9fc0ba4c0-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-02-19 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  Emmanuel
 Type:   |  Sandjio
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Emmanuel Sandjio):

 * owner:  Paul Hermans => Emmanuel Sandjio

-- 
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/0107018dc250b330-7ae3c928-c12a-4c31-86f7-61820023f150-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-31 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  Paul
 Type:   |  Hermans
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * owner:  nobody => Paul Hermans
 * status:  new => assigned

Comment:

 Take your time.
-- 
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/0107018d62f14940-86053855-43a3-4509-8d49-8239fe895c5e-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-31 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
--+
 Reporter:  Paul Hermans  |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  5.0
 Severity:  Normal|   Resolution:
 Keywords:  FORMAT_MODULE_PATH| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+
Changes (by Mariusz Felisiak):

 * status:  closed => new
 * resolution:  invalid =>
 * stage:  Unreviewed => Accepted

-- 
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/0107018d62f0cc6a-e791ef93-c023-4af0-ba44-a86435b37f0e-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-31 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Comment (by Paul Hermans):

 I think that is perfectmaybe a link to the definitions you pointed out
 to me.   I haven't ever done a patch before so have to figure out what
 that takes.  Happy to do it, but it might take a little time.
-- 
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/0107018d61ae419c-ca4c97e4-6a4a-406b-a01b-af39d5a7bfe3-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-30 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
 Reporter:  Paul Hermans |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  Version:  5.0
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  FORMAT_MODULE_PATH   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * type:  Bug => Cleanup/optimization

Comment:

 Paul, What do you think about adding the following sentence to the
 [https://docs.djangoproject.com/en/stable/ref/settings/#format-module-path
 FORMAT_MODULE_PATH docs]?
 {{{
 The name of the directory containing the format definitions is expected to
 be named using ‚Äčlocale name notation, for example `de`, `pt_BR`, `en_US`,
 etc. "
 }}}

 Would you like to prepare a patch?
-- 
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/0107018d5af2d97b-84a2e93b-8391-4a26-80b5-83ba30dadd9b-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-30 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
+--
 Reporter:  Paul Hermans|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Documentation   |  Version:  5.0
 Severity:  Normal  |   Resolution:  invalid
 Keywords:  FORMAT_MODULE_PATH  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Comment (by Paul Hermans):

 Thanks for the reply, and agree that in the locations you mentioned it is
 stated.

 I think that my opinion that the docs are not helpful in this regard is
 because of a few things
 1) I am very new to Django so I have not fought with this issue before.
 2) I was under the impression (wrongly) that specifying the format of the
 date/time had nothing to do with Translation - not because it doesn't make
 sense, but simply because i wasn't actually trying to translate anything,
 just control the format(s) of date/times.

 You are correct that it is mentioned in the docs where you pointed, but as
 an inexperienced user it would have been hugely helpful if the section on
 creating custom formats which suggests using FORMAT_MODULE_PATH in the
 first place at least made a mention of the importance of the name of that
 folder, and that it adheres to standard formats for Locale names as
 specified in the places you already pointed to.

 Not a major thing, but it might save people who are not yet experts a lot
 of grief trying to simply format a date/time.

 I appreciate your feedback either way.
-- 
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/0107018d5a4c2d84-bbf7d4a8-70b2-4cc1-aecd-964c540ed2cb-00%40eu-central-1.amazonses.com.


Re: [Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-29 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
+--
 Reporter:  Paul Hermans|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Documentation   |  Version:  5.0
 Severity:  Normal  |   Resolution:  invalid
 Keywords:  FORMAT_MODULE_PATH  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid

Comment:

 Thanks for the ticket, however this is already
 [https://docs.djangoproject.com/en/stable/topics/i18n/translation/#how-
 django-discovers-translations documented]:

 > ''"In all cases the name of the directory containing the translation is
 expected to be named using
 [https://docs.djangoproject.com/en/stable/topics/i18n/#term-locale-name
 locale name] notation. E.g. de, pt_BR, es_AR, etc. "''
-- 
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/0107018d58ab3d83-a522856f-0cec-4122-a882-48dbe969aa1d-00%40eu-central-1.amazonses.com.


[Django] #35153: FORMAT_MODULE_PATH not acting as I expected.

2024-01-29 Thread Django
#35153: FORMAT_MODULE_PATH not acting as I expected.
-+-
   Reporter:  Paul   |  Owner:  nobody
  Hermans|
   Type:  Bug| Status:  new
  Component: |Version:  5.0
  Documentation  |
   Severity:  Normal |   Keywords:  FORMAT_MODULE_PATH
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+-
 I am not certain this is a bug, but may be more of a confusion of a new
 user (me). Here is what I found:

 In my **settings**:

 {{{
 LANGUAGE_CODE='en-us'
 TIME_ZONE = 'America/New_York'
 FORMAT_MODULE_PATH = [
 "student_track.formats",
 ]
 USE_L10N=True
 USE_I18N = True
 USE_TZ = True
 USE_THOUSAND_SEPARATOR = True
 }}}

 then in my student_track app:
 I had this file:
 {{{
 /formats/en_us/formats.py
 }}}
 but this failed to load (no error message). Eventually I figured out to
 change the file path to this (Note the Upper Case for the country):
 {{{
 /formats/en_US/formats.py
 }}}

 In my **formats.py** i still have:
 {{{
 DATE_FORMAT = "M. d, Y"
 TIME_FORMAT = "h:i a"

 DATETIME_FORMAT = "M. d Y h:i a"
 # DATETIME_FORMAT = f"{DATE_FORMAT} {TIME_FORMAT}"


 DATE_INPUT_FORMATS = [
 '%m/%d/%Y', '%m/%d/%y', '%Y-%m-%d',  # '2006-10-25', '10/25/2006',
 '10/25/06'
 '%b %d %Y', '%b %d, %Y',  # 'Oct 25 2006', 'Oct 25, 2006'
 '%d %b %Y', '%d %b, %Y',  # '25 Oct 2006', '25 Oct, 2006'
 '%B %d %Y', '%B %d, %Y',  # 'October 25 2006', 'October 25, 2006'
 '%d %B %Y', '%d %B, %Y',  # '25 October 2006', '25 October, 2006'
 ]
 }}}

 **Template** I now have:
 {{{
 {{ record.actual_date }} 
 }}}
 and all is working well.

 Where I think the issue is that the folder name did not match the language
 I specified in the settings file and I didn't understand that from the
 documentation.
 When I stepped through the code, it seems that this change occurs in the
 **django.utils.formats.py** file when iter_format_modules() is called:

 {{{
 def iter_format_modules(lang, format_module_path=None):
 """Find format modules."""
 if not check_for_language(lang):
 return

 if format_module_path is None:
 format_module_path = settings.FORMAT_MODULE_PATH

 format_locations = []
 if format_module_path:
 if isinstance(format_module_path, str):
 format_module_path = [format_module_path]
 for path in format_module_path:
 format_locations.append(path + ".%s")
 format_locations.append("django.conf.locale.%s")
 locale = to_locale(lang)
 locales = [locale]
 if "_" in locale:
 locales.append(locale.split("_")[0])
 for location in format_locations:
 for loc in locales:
 try:
 yield import_module("%s.formats" % (location % loc))
 except ImportError:
 pass
 }}}

 In my case, this failed with an ImportError, and when I looked into its
 details, it seems that this line:
 {{{
 locale = to_locale(lang)
 }}}

 converted had my language specified in settings (en-us) to "en_US".

 I don't exactly know why, but it seems intentional. Assuming this is
 behaving as expected, then it seems that the documentation should be
 updated to indicate how this works.

 I am so new to Django that I am hesitant to propose the actual text that
 should change, but would be happy to try/help if this seems like the
 reasonable solution.
-- 
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/0107018d582d0f3b-7a1ded2c-4dcd-44e6-a60b-b1e14051662f-00%40eu-central-1.amazonses.com.