You can talk for a long time about the advantages of Django, but alas, everyone who has ever entered the admin panel of a Russian-speaking project could observe a big and unpleasant problem. The problem of childbirth, declination and numbers in languages ​​other than English is not clear to English-speaking developers, and, alas, despite the numerous number of tickets, support for anything outside of verbose_name and verbose_name_plural does not appear, and the administrative interface continues to be full of “Add picture” and etc. that the conciliator is very unpleasant. But there is a solution:
Immediately make a reservation, the decision was made on the basis of the following installations.
1. It should not modify the source code for Django.
Because dragging patches behind them makes the project unfold, and for those who use a trunk, the patch may well turn out to be inapplicable after the next update. (However, a patch is planned, but will be made after the interface stabilizes)
2. It should be as simple as possible for implementation in existing and new projects.
3. Should not break the work of already written code
4. It should just work :)
Currently only trunk 1.2 is supported, but if I really need, I can add an option for 1.1
At the same time, I can honestly say that the resulting code is scary,
but it works . And I do not advise anyone to write as this module is written. (This truth is not only my fault, but also the authors Dzhangi :))
Installation
0. hg clone
django-ruadmin.googlecode.com/hg django-ruadmin
In the repository there is a ready working project in which you can see how ruadmin works.
1. Shut down several django admin templates by placing the contents of django-ruadmin / verbose_test / templates in TEMPLATE_DIRS in a directory
2. Place the pyadmin module where Python can find it.
3. In the model file add the following import.
from pyadmin import verbose_name_cases, verbose_name_field_cases
4. In the code of your models, replace the assignment of a verbose_name line to create an instance of verbose_name_cases
')
verbose_name = verbose_name_cases(u"", (u"", u"", u""), gender = 0, edit = u"", delete = u"", add = u"")
verbose_name_plural = verbose_name.plural
The first parameter indicates the singular form in the nominative case, the second parameter indicates the tuple of their 3 plural forms, the optional parameter gender — gender (0 — female, 1 — male) and the three cases of using the words edit, delete, and add. Regarding the last 3 parameters, I have a question for habra users who know languages, namely, whether 3 cases should be divided, because for the Russian language one parameter can be used - accusative case, but I have doubts that such a division into types of actions can and useful somewhere.
5. When specifying verbose_name model fields, use the following code.
name = models.CharField(max_length = 512, blank = False, verbose_name = verbose_name_field_cases(u'', sort = u""))
6. Put patched pytils from django-ruadmin / verbose_test where the python can find it. If this module is already in use, you can replace it without fear *
Result

1. In the lists of elements of the inscription "0 of 16 checks selected" turns into "0 out of 16 checks selected.
2. Buttons, as well as the inscriptions “Add check”, “Delete check”, etc. turn into “add check” etc.
3. Messages when added from "Test" test "was added" becomes "Test" test "was added"
4. When using the model's fields for sorting, “By Name” turns into “By Name”
* A small addition about pytils.
The only change in the module is the addition of a tag that can correctly tilt the lines “N from M items”. Where this tag live I am not sure, and I will be glad to any comments.