#14450: Simple but powerfull patch to make application name localizable
----------------------------------+-----------------------------------------
 Reporter:  nnseva                |       Owner:  nobody    
   Status:  new                   |   Milestone:            
Component:  django.contrib.admin  |     Version:  1.2       
 Keywords:                        |       Stage:  Unreviewed
Has_patch:  1                     |  
----------------------------------+-----------------------------------------
 The applied patch is used to make application names localizable for admin
 interface and also for other purposes.

 This patch is applied to django v. 1.2.3 (django.VERSION = (1, 2, 3,
 'final', 0))

 It uses a new APP_NAMES variable from the user-provided settings.py which
 should be a dictionary having application label (model._meta.app_label) as
 a key, and application verbose name as a value. If the APP_NAMES is absent
 or doesn't contain a label of the application, the old schema
 (app_label.Title()) is used.

 This way allows to localize application names exactly as other things in
 the project:

 settings.py:
 {{{
 ...
 from django.utils.translation import ugettext_lazy as _
 ...
 INSTALLED_APPS = (
     ...
     'myapp.service',
     ...
 )

 APP_NAMES = {
     'service':_('Service')
 }

 }}}

 Now the "Service" string will appear in the django.po files for the whole
 project, so you can localize application names as you wish.

 This patch is a minimalistic way to make a part of the job made by the
 patch published in the ticket #3591. Reasons why I've published the patch
 is - "simpler means more stable", and "One patch - one job".

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14450>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to