Django

Code

Ticket #3594 (closed: worksforme)

Opened 1 year ago

Last modified 6 months ago

Translation problem in javascript

Reported by: karsu Assigned to: msaelices
Component: Internationalization Version: SVN
Keywords: Cc:
Triage Stage: Accepted Has patch: 1
Needs documentation: 0 Needs tests: 1
Patch needs improvement: 0

Description

I have changed default language code in settings file to my own language. If I change language with "/i18n/setlang/" url everything works fine except javascript translation. Javascript translation problem exist only with english language. If i try to change language to english all javascript words is translated to default language (what is specified in settings file).

Attachments

javascript_translation.patch (1.1 kB) - added by Timo on 05/04/07 05:12:20.
Finally I fixed this for my own use.

Change History

02/27/07 12:08:59 changed by Gary Wilson <gary.wilson@gmail.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

03/12/07 04:18:27 changed by mtredinnick

Needs confirmation that it's happening (and ideally even a small test app). Help requested in this django-i18n thread.

05/04/07 05:12:20 changed by Timo

  • attachment javascript_translation.patch added.

Finally I fixed this for my own use.

06/27/07 02:12:14 changed by anonymous

  • has_patch set to 1.
  • needs_tests set to 1.

06/27/07 02:12:32 changed by anonymous

  • needs_better_patch set to 1.
  • needs_tests deleted.

06/27/07 02:12:52 changed by anonymous

  • needs_better_patch deleted.
  • needs_tests set to 1.

09/14/07 05:06:13 changed by mtredinnick

In case anybody is looking at this, I am not happy with the patch here so far. It isn't correct to remove the fallback such as is being done there. We should be doing "preferred locale", then "default locale" (as set in settings) and then "en". So default_locale has to be mentioned somewhere, I would have thought.

09/15/07 08:36:31 changed by msaelices

  • owner changed from nobody to msaelices.
  • status changed from new to assigned.

I'll try to fixed that and add tests

09/15/07 18:44:03 changed by msaelices

  • needs_tests deleted.

I added test, but is attached in other ticket #5496. The reason is it was needed a new directory for testing django views.

09/18/07 14:24:48 changed by msaelices

  • stage changed from Accepted to Ready for checkin.

In changeset [6370] there are many tests, including tests for jsi18n views. I think this ticket is now ready for commit.

09/18/07 19:17:03 changed by russellm

  • needs_tests set to 1.
  • stage changed from Ready for checkin to Accepted.

It's not ready for checkin until there is a test. The current tests pass; either we are missing a test, or the change isn't required.

12/01/07 12:09:55 changed by msaelices

  • status changed from assigned to closed.
  • resolution set to worksforme.

There are no needs of this patch. It's work for me. I created exactly the same testing environment ticket author.

I do:

  • Created a project with settings.LANGUAGE_CODE to spanish 'es-es'
  • A /media/js/translate.js with a call to gettext.
  • A base.html template with include django jsi18n views and translate.js js file. Also contains a language selector.
  • Several locale/xx/LC_MESSAGES/djangojs.po with spanish, english and francais translations.

Default language is spanish, and first time I view web, all is in spanish. Then, if I change to english, all javascripts msgid are translated successfully to English.

I close this ticket because it works for me. Afterall, there is some tests of javascript translations that checks the generated javascript catalog.


Add/Change #3594 (Translation problem in javascript)




Change Properties
Action