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 csv file name every time i loop with the for in syntax and save it in the specified folder
- python - i am creating a breakout game i want to change the angle when the ball bounces off the paddle, but i can't also, the ba
- c # - i want to change some characters with html color in the message displayed character by character in unity!
- i want to change the storage location of python (terminal, macos)
- python - i want to change the save destination for each loop using chromedriver
- python - i want to save the default data if the column is null in django
- python - the list of dbs registered with django is not displayed
- python - determine if there is a django object and transition to the screen
- python - i want to change the score of dict into grade
- python - django i want to get multiple child tables in a for loop of a parent table
- python 3x - i want to display the message acquired by websockets with for
- python - i want to display db other than'default'of django with genericdetailview
- python - [mac] i can't reinstall postgresql on django
- python - upload files with django
- python 3x - replace does not change
- python - i want to resolve the error message
- python - i don't know how to get pk when using formview in django
- python - django formset value method
- python - i get an argument must be int or float error in django
- python - django multiple form display (no model)
- python - how to enable selection by value when selecting a selection format column
- python - if you create multiple signup screens with django, you want to change the redirect destination in case of an error
- python - psycopg2 cannot be read by pycharm
- only part of the data is recognized when learning python
- python - i want to convert the characters obtained from the txt file to numbers
- python - [django] gte works with filter in queryset, but lt doesn't work and i can't get the specified range of data
- python - i can't find some url paths after deploying django