0

I am creating my Django website and using django_components in the project. Now I'm thinking about creating a multilingual site: I created the necessary translate tags, added an i18n loader, created a locale folder in the root of the project. Now I am running the following command:

$> python manage.py makemessages --locale=en

Today, this command is working correctly. But yesterday, when I was doing it, an error about the inability to read the file dropped out /component/my_widget/my_widget.html.py. Initially, there was no such file at all, there was only my_widget.html and my_widget.py , but this file was created when executing the command. Inside this file there were different sets of letters X and B of different lengths, and in structure it resembled tags from a template my_widget.html . The most interesting thing is that in this file I did not use the translate tag at all.

Next is an example of this strange .html.py file:

BBBB BBBBBB

XXXX XXXXXX XXXXXXX XXXXX XX XXXXXXX XXXXXX XX XXX XX XXXX XXX XXX XXXX XXXXXXXXXXXXXXX XXX
BB BBBBBBBBBBBBBBBBB BB BBBBBBBBBBBB

    XXXX XXXX XX XXXX XXXXXXX XXX
    XX XXXXXXXXXXXXXXXXXXXXX XXXXXXXX
        XXXX XXXXXXXXXXXXXXXXXX

            XXXX XXXXXX XXX XXXXXXXXXX XXXX XXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XXXX X XXXXXXXXXXXXX XXXX XXX
            XXXX XXXXXXXXXXXXXXXXXXXXXXXXX
                BB BBBBBBBBBBBBBBBBBBBBBBBBBBBB
                    XXXX XXXXXX XXXXXXXXXXXXX
                BBBB
                    XXXX XXXXXBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBX XXXXXXXXXXXX
                BBBBB
            XXXXXX

            XXXX XXXXXXXXXXXXXXXXXXXXXXX
                XXXX XXXX XXX XXXXXXXXXX XXXX XXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XXXX X XXXXXXXXXXXXXXX XXX
                XX XXXXXXXXXXXXXXXXXXXXXXX
                    BB BBBBBBBBBBBBBBBBBBBBBBBBBBBB
                        
                    BBBB
                        XXXXXXXXXXXXX
                    BBBBB
                XXXX
                XXXX XXXXXX XXXXXXX XXXXXXXXXX XXX
                XX XXXXXXXXXXXXXXXXXXXXXXXXX
                    XXXX XXXXXX XXXXXXXXXXXXX XXXXXXXXXX XXX
                    XXXXXXX 
                    XXXX XXXXXX XXXX XXXXXX XXXXXX XX XXXX XXX XX XXX
                    BB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB B B
                        XXXXX XXXXXXXXXXXXXXXXXXXXXXX
                    BBBBB
                    XXXX XXXXXX XXXXXX XXXXXX XXXXXX XX XXXX XXX XX XXX
                    BB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB B B
                        XXXXX XXXXXXXXXXXXXXXXXXXXXXX
                    BBBBB
                    XXXX XXXXXX XXXXXX XXXXXX XXXXXX XX XXXX XXX XX XXX
                    BB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB B B
                        XXXXX XXXXXXXXXXXXXXXXXXXXXXX
                    BBBBB
                XXX
            XXXXXX
        XXXXXX
    XXXX
BBBBB

I also used a basic template templates/base/base.html to use extend in my applications. There was translate tag in this file. When executing the command, a file was also created templates/base/base.html.py with similar gibberish.

After performing the described actions and receiving an error, the locale folder remained empty. After several attempts, I left work, and continued today. But this time there was no error and no matter how hard I try, I can't reproduce it. I understand that the problem seems to have solved itself. But I really want to know what it was and why there was such a problem, as well as why the makemessages command generates *.html.py files? I will be grateful for any help.

0 Answers0