Django

Code

Ticket #7030 (closed: fixed)

Opened 8 months ago

Last modified 7 months ago

Allow non-ASCII characters in input for translation for multiple Javascript files

Reported by: anonymous Assigned to: nobody
Milestone: Component: Internationalization
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation:
Needs tests: Patch needs improvement:

Description

make-messages.py doesn't work well for input file containing UTF-8 strings to translate when you have multiple javascript files to translate

cd project_dir
copy test.js to template directory
# run make_messages
# python /opt/django-0.97_pre7403/django/bin/make-messages.py -a -d djangojs
processing language fr

everything is fine

Problem occures when you have multiple JS file to translate:

copy test2.js to template directory
# run make_messages
# python /opt/django-0.97_pre7403/django/bin/make-messages.py -a -d djangojs
processing language fr
errors happened while running xgettext on test2.js
pl:2: warning: The following msgid contains non-ASCII characters.
               This will cause problems to translators who use a character encoding
               different from yours. Consider using a pure ASCII msgid instead.
               déjeuner
pl:2: invalid multibyte sequence
pl:2: invalid multibyte sequence
pl:2: invalid multibyte sequence
pl:2: invalid multibyte sequence

with patched version :

# python /opt/django-0.97_pre7403/django/bin/make-messages.py.patched -a -d djangojs
processing language fr 

Attachments

test.js (53 bytes) - added by anonymous on 04/16/08 06:14:24.
Javascript file #1 for testing purpose
test2.js (52 bytes) - added by anonymous on 04/16/08 06:14:51.
Javascript file #2 for testing purpose
make-message.patch (1.7 kB) - added by anonymous on 04/16/08 06:16:09.
make-messages.py patch to deal with JS files as .html files (no use of omit-header) and stripping header if .pot file exists

Change History

04/16/08 06:14:24 changed by anonymous

  • attachment test.js added.

Javascript file #1 for testing purpose

04/16/08 06:14:51 changed by anonymous

  • attachment test2.js added.

Javascript file #2 for testing purpose

04/16/08 06:16:09 changed by anonymous

  • attachment make-message.patch added.

make-messages.py patch to deal with JS files as .html files (no use of omit-header) and stripping header if .pot file exists

04/26/08 08:25:31 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [7473]) Fixed #7030 -- Handle extraction of UTF-8 messages from Javascript files.

This leads to more duplicated code in make-messages.py, but this is just a holdover for the immediate problem until we merge make-messages into management/.


Add/Change #7030 (Allow non-ASCII characters in input for translation for multiple Javascript files)




Change Properties
Action