Hi Uri. 

On Tuesday, 3 December 2019 04:27:03 UTC+1, Uri wrote:
>
> I want to use YEAR_FORMAT in the template the same why I'm 
> using DATE_FORMAT and MONTH_DAY_FORMAT:
>

> And to be able to customize YEAR_FORMAT for specific locales if it needs 
> to be customized. But not to define it if it's equal to the default value 
> which I defined
>

Right, with you. (Sorry, it takes a while to get clear sometimes.) 

Does Custom Format Files do it?
>

Yes — all except the default right? — IIUC You can define whatever formats 
you want in format.py files, and that'll all work how you want 
*BUT* (unless all your languages were in the same family, en-us, en-gb say, 
which are both en) it doesn't "fallback" the default locale, 
so you can't set a default. 

With two locales I guess it'd be OK, but with 40... 

*So here's my question then (all)*: With translations we fallback to the 
default locale. Should it be the case that 
django.utils.formats.iter_format_modules()
also fallbacks to the default locale? (As it doesn't look like it does 
currently.) (By appending that to the list of modules to search.)

i.e. is this a bug (or new feature) in format localization that we could 
patch, within the existing machinery, rather than adding a setting, or 
needing to go via the global settings file?

(A test case for that new behaviour and a patch, assuming nothing breaks, 
might swing that, pending lack of responses...)

I'm going to try to implement the patch on Speedy Net right now without 
> having to update 14 files. There is a suggestion on Stack Overflow.
>

Yes, in the meantime your patch applied in an AppConfig looks my cleaner. 
:+1: 

Kind Regards,

Carlton

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c503f8e4-66bd-49d0-92f9-c8f2d5e5f6f6%40googlegroups.com.

Reply via email to