How to convert language code to locale name in Django?
For example:
zh-cn to zh_CNzh-Hans to zh_Hansfrom django.utils.translation import to_locale
from django.conf import settings
print to_locale(settings.LANGUAGE_CODE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With