| Name | Venkatagiri Vatlam |
|---|---|
| Email Address | vatlam@yahoo.co.in |
| Avatar | |
| Posts | 3 |
-
- 2010-07-05 10:24:58
- r
- Board >> Django >> Python Programming
- e
--- Last Edited by Venkatagiri Vatlam at 2010-07-05 12:41:56 ---
-
- 2010-06-01 06:19:07
- How to override object history in django?
- Board >> Django >> Templates
- I need to display django's object history in multiple languages.
Here is the code snippet:
<table id="change-history">
<thead>
<tr>
<th scope="col">{% trans 'Date/time' %}</th>
<th scope="col">{% trans 'User' %}</th>
<th scope="col">{% trans 'Action' %}</th>
</tr>
</thead>
<tbody>
{% for action in action_list %}
<tr>
<th scope="row">{{ action.action_time|date:_("DATETIME_FORMAT") }}</th>
<td>{{action.user.username}}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td>
<td>{{action.change_message}} </td>
</tr>
{% endfor %}
</tbody>
</table>
In the above code "action.change_message" is displayed partly in Hindi (i18n in Hindi) and partly in English.
change_message property is a column and mapped to a database table.
action.change_message output is coming as follows:
1) remarks को बदला गया हैं
2) amount को बदला गया हैं
3) is_Fraud को बदला गया हैं
4) pub को बदला गया हैं
I want to display remarks, amount, is_Fraud and pub also in Hindi.
Immediate help in this would be greatly appreciated. Please let me know if you need
further inputs from me. Thank You.
Eagerly waiting for reply....
-
- 2010-04-07 06:17:10
- settings.py configuration for internationalization (i18n)
- Board >> Django >> Python Programming
- Hi All,
I have recently started using django for one of our applications. I am experiencing issues in implementing internationalization using django.
In my settings.py, I have set the following:
(attached is my complete settings.py file)
1) USE_I18N = True
2) LANGUAGE_COOKIE_NAME = 'django_language'
3) LANGUAGES = (
('en', _('English')),
('ja', _('Japanese')),
('hi', _('Hindi'))
)
4) MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware'
)
Now my requirement is, using single settings.py file, I need to support my application for multiple languages
i.e., when I change the locale in the browser (ex: hi_IN, ja_JP), it should display the content in the selected language.
If I am manually changing LANGUAGE_CODE = 'hi' in settings.py, application is working fine.
But I want to avoid, this manual changes in the settings.py file.
Please let me know if I am missing any configuration settings in settings.py file.
Any help in this regard would be greatly appreciated as my deadline is close by.
Thank You.
Venkatagiri Vatlam
--- Last Edited by girivatlam at 2010-07-05 10:10:36 ---
--- Last Edited by girivatlam at 2010-07-05 10:26:16 ---


