I need to translate ask-related-questin string:No questions like this have been found. but it's not in django.po .how can i translate that?

asked 25 Jul '11, 06:04

sheshkovsky's gravatar image

sheshkovsky
31113
accept rate: 0%

edited 26 Jul '11, 11:00

rickross's gravatar image

rickross ♦♦
12.5k2914972

that link is dead

(12 May, 09:22) Pleun Rijkers

I have successfully used GetText for translation of JavaScript files in three projects.

Of course GetText natively doesn't support JavaScript and JavaScript also doesn't support GetText. My solution has been the following.

In JavaScript I surround translatable strings with gettext("your text here"). Then I have a script that pulls the strings out of JavaScript files and creates a C file, because C is supported by gettext. Then I use xgettext on the generated C files and on any other files in my project to produce POT and PO files. After translating PO files, I have to get the translations back to JavaScript...

I parse the JavaScript files again, remembering the list of translatable strings, then for every locale: Using a language with GetText support (in my case PHP) I translate all the strings and output JavaScript file.

If you aren't dealing with a JavaScript-intensive web-app, you should think twice before having page content created by JavaScript in the first place.

link

answered 25 Jul '11, 23:48

Welsch's gravatar image

Welsch
(suspended)
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×38
×14

Asked: 25 Jul '11, 06:04

Seen: 506 times

Last updated: 12 May, 09:22

powered by OSQA