Unable to find a locale path to store translations for file __init__.py

前端 未结 3 1151
终归单人心
终归单人心 2021-02-03 16:45

I\'m trying to translate a Django app. I created some strings with {% trans %} in my templates. However, when I execute the following command in my app folder, I re

3条回答
  •  不知归路
    2021-02-03 17:04

    Actually you can configure where the locale folder is. In your settings.py add:

    LOCALE_PATHS = (
        PROJECT_ROOT + '/website/locale', )
    

    Then create a folder for each of the languages you want to translate:

    mkdir -p website/locale/de
    

提交回复
热议问题