Re: Generating catalog from js file



Le vendredi 27 mai 2011 à 07:01 +0200, Pau Iranzo a écrit :
> Hi all,
> 
> I'm learning a bit of javascript programming for gnome-shell creating
> some extensions. I have dowloaded the extension known as
> weather-applet:
> https://github.com/simon04/gnome-shell-extension-weather
> 
> On the code there are a few strings that can be translated. So I tried
> to use poedit in order to generate the catalog and start translating
> those strings.
> 
> The problem is that poedit, even gettext directly are no able to
> recognise the javascript language.
> 
> ___
> pau@linux-5225:~/.local/share/gnome-shell/extensions> cd weather
> \@venemo.net/
> pau@linux-5225:~/.local/share/gnome-shell/extensions/weather venemo net> ls
> extension.js  locale  metadata.json  stylesheet.css
> pau@linux-5225:~/.local/share/gnome-shell/extensions/weather venemo net> xgettext -f extension.js 
> xgettext: avís: l’extensió «» del fitxer «/*» no és coneguda; es
> provarà amb el llenguatge «C»
> xgettext: error en obrir «/*» per a llegir: El fitxer o directori no
> existeix
> ____
> 
> How can I extract the strings to translate and generate a pot/po file
> from a js file?

Hi Pau,

Your xgettext call is not correct. -f is not intended to define files to
extract strings from, but a file which might contain a list of paths to
consider for extraction. Please read 'man xgettext' again.

But you are also right: there is no pure xgettext javascript parser.
Even if most of the time the default C parser will do it fine (or the
Perl one in certain cases), this is an issue where I think we need
someone to step up and write a dedicated parser.

Claude
-- 
www.2xlibre.net



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]