Hi,
I just commited two patches that implement JavaScript translation based
on my proposal to Django. I added translations to the date and time
pickers in the admin and added the necessary tags and references to the
admin app.
If you want to create an empty translation file for JavaScript, you
j
Hi,
after thinking a bit more and reading the comments on the thread, I
think I have a useful proposal for this stuff:
- we define a view function that sends out a JavaScript file based on
.mo/.po files. This view uses the same routines that are used by django
itself. To build the message files,
>I much prefer this idea to the proposals involving XMLHttpRequest. We
>can include the language definitions dictionary file with code like
>this:
Had a look at my posting with the sample implementation? It's exactly
that what I do - delivering a dictionary with a few helper (that
surprisingly lo
On 28 Nov 2005, at 19:48, Eugene Lazutkin wrote:
Typical way to do it in js is to provide a language file separately
from the
code. The language file in most cases defines a single dictionary
object.
The code doesn't use text directly but uses a dictionary to fetch
proper
strings. Such d
On 11/28/05, hugo <[EMAIL PROTECTED]> wrote:
> http://media.rfc1437.de/testi18n-sr.html
> this gives you a test page that uses the 'sr' (serbian) catalog.
> Because they have interesting pluraliziation rules. And because I got
> pluralization working (actually it's dead simple, as the C-expression
>Comments? Volunteers for writing the string interpolation function
>(preferably using python named parameter syntax) or the
>plural-form-to-javacript-compiler? :-)
Ok, looks like I mostly talk to myself ;-)
http://media.rfc1437.de/testi18n-sr.html
this gives you a test page that uses the 'sr'
>4) write gettext in JavaScript. This could be done by converting the
>existing django message files to dynamic javascript
Ok, to get a feel for my current favorite way to do it, I hacked up a
very crude version that currently doesn't handle any pluralization that
diverts from the one used in eng
>I never saw b) done using algorithms. I would assume it is possible but
>probably it should be written from scratch.
But proper pluralization would be a requirement. Improper pluralization
is a pain - and gettext already handles it quite nicely, so we should
try to get a solution that gives us t
Inline.
"hugo" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
>
> 2) offline generating javascript files for each language by running
> them through the template engine (and using translation tags). This has
> the benefit that javascript files can still be in the media server, but
>
On 11/28/05 18:25, hugo wrote:
My first instinct in this sort of case is to find out what others are doing,
i.e. Dojo folks, RoR, TG, etc.
That's what I did. Zilch. Nada. Zero. Nothing. Seems nobody ever cared
about a proper solution to JavaScript and i18n. What they do are hacks,
if they do s
>My first instinct in this sort of case is to find out what others are doing,
>i.e. Dojo folks, RoR, TG, etc.
That's what I did. Zilch. Nada. Zero. Nothing. Seems nobody ever cared
about a proper solution to JavaScript and i18n. What they do are hacks,
if they do something at all. Some of those h
>Another idea would be to translate the strings in the templates and
>pass the translated strings to the JavaScript. This would make the
>JavaScript not as "unobtrusive," but it's a compromise.
But with dynamically generated content it will be rather weird - your
code will be sprinkled with strin
Hi,
>We have the problem that some strings are in the JavaScript code for
>the admin. That way those strings are not translateable for us with the
>current situation.
>
>There are several ideas on how to solve this:
I actually forgot one:
5) JavaScript uses XHR to fetch stringdata from Django.
On 11/28/05, hugo <[EMAIL PROTECTED]> wrote:
There are several ideas on how to solve this:All of which seem like they would apply beyond Django, no?My first instinct in this sort of case is to find out what others are doing, i.e. Dojo folks, RoR, TG, etc.
--david
On 11/28/05, hugo <[EMAIL PROTECTED]> wrote:
> We have the problem that some strings are in the JavaScript code for
> the admin. That way those strings are not translateable for us with the
> current situation.
Another idea would be to translate the strings in the templates and
pass the translate
Hi,
since this is a more developer oriented content, I post it to
django-developers instead of django-i18n. This is ticket #945.
We have the problem that some strings are in the JavaScript code for
the admin. That way those strings are not translateable for us with the
current situation.
There
16 matches
Mail list logo