Skip to content

Commit

Permalink
adding LANGUAGE= to make it work from cli
Browse files Browse the repository at this point in the history
somehow env variable LANGUAGE interfers with gettext when running from
commandline; setting it to null fixes it
  • Loading branch information
azatoth committed Dec 5, 2014
1 parent 73add93 commit b6571b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sv.po
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: test 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-11 02:57+0200\n"
"POT-Creation-Date: 2014-12-05 11:59+0100\n"
"PO-Revision-Date: 2011-08-11 02:58+0200\n"
"Last-Translator: Carl Fürstenberg <azatoth@azaboxen.carl>\n"
"Language-Team: Swedish\n"
Expand All @@ -18,28 +18,28 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: test.php:12
#: test.php:13
#, php-format
msgctxt "body"
msgid "One heart\n"
msgid_plural "%d hearts\n"
msgstr[0] "Ett hjärta\n"
msgstr[1] "%d hjärtan\n"

#: test.php:13
#: test.php:14
#, php-format
msgctxt "place"
msgid "One heart\n"
msgid_plural "%d hearts\n"
msgstr[0] "Ett centrum\n"
msgstr[1] "%d centrum\n"

#: test.php:15
#: test.php:16
msgctxt "door"
msgid "Open\n"
msgstr "Öppna\n"

#: test.php:16
#: test.php:17
msgctxt "book"
msgid "Open\n"
msgstr "Slå upp\n"
1 change: 1 addition & 0 deletions test.php
Expand Up @@ -2,6 +2,7 @@
include_once("pgettext.php");
$domain = 'messages';
$directory = dirname(__FILE__);
putenv("LANGUAGE=");
$locale ="sv_SE.utf8";
setlocale( LC_MESSAGES, $locale);
bindtextdomain($domain, $directory);
Expand Down

0 comments on commit b6571b8

Please sign in to comment.