Skip to content

Instantly share code, notes, and snippets.

@ozten
Created April 20, 2012 20:11
Show Gist options
  • Select an option

  • Save ozten/2431494 to your computer and use it in GitHub Desktop.

Select an option

Save ozten/2431494 to your computer and use it in GitHub Desktop.
/* examples/foo.js */
var msg = _('hello world!'),
msg2 = gettext('goodby cruel world');
/* from command line */
xgettext -L Perl --keyword=_ --output-dir=examples/ --from-code=utf-8 --output=client.pot `find examples/ -name '*.js' | grep -v 'gettext.js'`
/* examples/client.po */
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-04-18 23:17-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: examples/foo.js:1
msgid "hello world!"
msgstr ""
#: examples/foo.js:2
msgid "goodby cruel world"
msgstr ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment