Hi,
Thanks everyone.
I found the solution.
The translation strings should be specified in
"djangojs.po" not "django.po".



On 4月5日, 下午11時12分, Vasil Vangelovski <vvangelov...@gmail.com> wrote:
> Can you be more precise about what part doesn't work? Did you include
> the javascript translation catalog in you HTML template with a
> <script> tag? Can you see any js errors in firebug?
>
> On Mon, Apr 5, 2010 at 4:13 PM, Steven Nien <steven.n...@gmail.com> wrote:
> > I want to implementi18nin the javascript,
> > but things just don't work
>
> > here is my file tree:
>
> > /home/myproject
>
> > /home/myproject/app
>
> > /home/static_media/test.js
> > test.js:
> > document.write(gettext('test_message_here'));
>
> > Following is my procedure:
>
> > 1. cd /home/myproject/app
> > 2. mkdir locale
> > 3. django-admin.py makemessages -d djangojs -l en
> > 4. cd locale/en/LC_MESSAGES
> > 5. vi django.po (as following)
> >    msgid "test_message_here"
> >    msgstr "This is test message"
> > 6. cd /home/myproject/app
> > 7. django-admin.py compilemessages
> > 8. cd /home/myproject
> > 9. vi urls.py (as following)
>
> > js_info_dict = {
> >    'packages': ('app',),
> > }
>
> > urlpatterns = patterns('',
> >    (r'^i18n/', include('django.conf.urls.i18n')),
> >    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
> > js_info_dict),
> > )
>
> > Is it wrong in the procedure above?
> > Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
>

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

Reply via email to