msgstr "" "Please enter the correct% (username) s and password. Both fields are uppercase" "Is case sensitive."
I don't want to modify the po file directly as django will be updated in the future.
For example, when I want to change your password to "Not correct your password" when you enter the wrong password
Which file should I put the code in?
Answer # 1
If you put a locale file in your project as follows and write a translation corresponding to the English text you want to replace, you can overwrite the standard text.
project_root └locale └─ja └─LC_MESSAGES django.mo django.po djangojs.mo djangojs.po
That's the example question.
msgid "" msgid "" "Project-Id-Version: django \ n" "Report-Msgid-Bugs-To: \ n" "POT-Creation-Date: 2019-12-02 16: 49 + 0100 \ n" "PO-Revision-Date: 2019-12-02 16: 41 + 0000 \ n" "Last-Translator: example
\ n" "Language-Team: Japanese (http://www.transifex.com/django/django/language/" "ja /) \ n" "MIME-Version: 1.0 \ n" "Content-Type: text/plain;charset = UTF-8 \ n" "Content-Transfer-Encoding: 8bit \ n" "Language: en \ n" "Plural-Forms: nplurals = 1;plural = 0;\ n" msgid "" "Please enter a correct% (username) s and password. Note that both fields may" "be case-sensitive." msgid "" "Your password is incorrect"
The English text of msgid can be found by searching for the corresponding Japanese text in the Django source code.
In order to reflect the contents of the above file, it is necessary not only to place the file but also to rewrite and compile the configuration file. Please refer here for those procedures.
[Python] Add Django locale file to change Japanese message-Qiita
- python - i want to change the ip address that the django app gets by default from remote_addr to http_x_forwarded_for in middlew
- python 3x - change row name/column name of csv file
- i want to dynamically change the value of a variable in python and execute it
- python - object is not displayed in html in django queryset
- python - about image deletion in django
- [python] [tkinter] i want to change the acquisition contents of the second and subsequent menu lists by selecting the previous p
- i want to change the default version of python
- python - does pixel information change when cv2imwrite processing is performed?
- python - django image folder reasons to create static and madia folders separately
- name error in underscore in python django
- python - i want to use asyncio with django custom commands
- about batch change of file name using python
- python - django i want to filter the data associated with a foreign key and display it in a template
- python - vscode: i can't debug django apps
- macos (osx) - change password in mac terminal
- python - i want to change the csv file name every time i loop with the for in syntax and save it in the specified folder
- python 3x - i want to change the background color of the specified line in python3 tkinter treeview
- python - how to count url clicks in django and record them in the db
- python - how to install django using requirementstxt and pip in virtual environment
- python - when i set the uuid field in django, i get field'object_id' expected a number but got '78a0767cb607488087a73f17565bb
- python : page not found 404 -Django
- How to disable auto indentation in VS Code python
- python : How do I do model-based form validation in Django?
- How do I pass a variable from template to function? Python
- python : How to make a transition to another page on clicking on a form button in Django
- python : Error during template rendering. Django
- python : Django + tls certificate
- OrderAddView is missing a QuerySet. Python Django
- python : Django POST cannot get key
- python : Add file upload form output to DetailView class