[wp-polyglots] TinyMCE 3.0 translation functionality

Nikolay Bachiyski nbachiyski at developer.bg
Sat Feb 2 18:24:35 GMT 2008


2008/2/2, Francesc Hervada-Sala <francesc at hervada.org>:
> Hi all,
>
> I wonder if it is possible to do it this way:
>
> 1. with xgettext generate a pot file extracting all strings from java source
> files.
> http://www.gnu.org/software/gettext/manual/gettext.html#xgettext-Invocation

The perl tokenizer is the one, which works best for javascript, not
the java one. However it also misses strings sometimes, so it isn't
recommended in larger scale.

We will have to write our own javascript tokenizer.

>
> 2. we could write a Perl script which reads all java source files,
> translates all strings according to a translated po file and generates a
> localised version of each source file.

We should avoid replacing source files, because it can (read:
certainly will) introduce extremely difficult to find and reproduce
bugs.

Happy translating,
Nikolay.

> --------------------------------------------------
> Von: "Nikolay Bachiyski" <nbachiyski at developer.bg>
> Datum: Freitag, 1. Februar 2008 00:31
> An: <wp-polyglots at lists.automattic.com>
> Betreff: Re: [wp-polyglots] TinyMCE 3.0 translation functionality
>
> > 2008/2/1, Andrew Ozz <admin at laptoptips.ca>:
> >> Hi, I'm working on the integration of TinyMCE 3.0 into WordPress 2.5 and
> >>   think that the translation functions for TinyMCE can be improved.
> >>
> >> I've just tried putting all TMCE text strings in one php file and
> >> wrapping them in the _e('') function, so they all appear in the main
> >> .pot file. That works good and makes it a lot easier to translate. It
> >> also will pick up some already translated strings, but may limit the
> >> other settings that can be passed by a language file in TinyMCE.
> >
> > I have a few questions:
> >
> > How will you bring the translated strings back to javascript?
> >
> > The only working way I have found is to somehow differentiate
> > translations, which are for javascript and after that dump them in a
> > javascript array, so that they can be used from the js apps. However,
> > this involves lots of dirty hacks -- pre/suffix to every string and
> > string matching.
> >
> > It would be great if you have a better idea :-)
> >
> > Happy hacking,
> > Nikolay.


More information about the wp-polyglots mailing list