Opened 6 years ago

Last modified 4 years ago

#29712 closed Cleanup/optimization

Add warning in makemessages command if the localecode with `l` flag is not correct — at Version 4

Reported by: Sanyam Khurana Owned by: David
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Herbert Fortes Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Sanyam Khurana)

Hey Calude,

What about normalizing the directory name to something that would just work.

For example,

No matter, if the developer is doing all these:

python manage.py makemessages -l zh_cn
python manage.py makemessages -l zh_CN
python manage.py makemessages -l ZH_CN
python manage.py makemessages -l ZH-CN

etc.

we, just normalize the directory name to zh_CN and it would work.

I'm still about to read the code of makemessages command and probably if there are any more checks than just this, then we'll have to figure out another way all together.

Change History (3)

comment:1 by David, 6 years ago

Owner: changed from nobody to David
Status: newassigned

comment:2 by Claude Paroz, 6 years ago

Triage Stage: UnreviewedAccepted

We have to be careful in deciding what is a "good" and a "bad" code. However I agree that we can avoid some mistakes, notably the confusion between IETF language tags [1] and ISO/IEC 15897 (Posix) [2] codes generally expected by Django.

[1] https://en.wikipedia.org/wiki/IETF_language_tag
[2] https://en.wikipedia.org/wiki/Locale_(computer_software)

comment:4 by Sanyam Khurana, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top