i18n doesn't work at production environment on heroku

前端 未结 7 1511
陌清茗
陌清茗 2021-01-05 02:30

I have seen more than one hundred posts about i18n issues and no solution seems to solve my problem.

I have an app running with Django 1.3.1 and it works Fine at my

7条回答
  •  Happy的楠姐
    2021-01-05 02:56

    In some cases, directories with a "-" or "_" within the name are not correctly addressed. I solved the issue customizing the url to be be a 2-chars code. This can be done creating an alias:

    from django.conf import global_settings, locale
    EXTRA_LANG_INFO = {
        'pt': {
            'fallback': ['pt-br'],
        },
    }
    LANG_INFO = dict(locale.LANG_INFO, **EXTRA_LANG_INFO)
    locale.LANG_INFO = LANG_INFO
    

提交回复
热议问题