gettext

Extracting gettext translations from PHP heredoc syntax?

I'm using PHP's gettext functions for doing localization. I'm using Poedit to do the actual translation, and with its "Update from sources" feature it is really easy to extract all the strings that need to be translated - except from inside heredoc syntax. Poedit is using the xgettext program to generate the .po files from the PHP sourc...

How to set gettext text domain in Poedit?

I need to parse my php files where is used several text-domains. I want to parse just one specific domain (others have been already translated) How to make Poedit to do that? Is it required to compile mo file bounded to some text-domain? If it is, how to do it in Poedit. I am using windows and do not want to install Cigwin with Gettext...

How to create .po files using xgettext on Windows?

I'm following this tutorial about building a multilingual web sites using PHP gettext http://onlamp.com/pub/a/php/2002/06/13/php.html I understand the tutorial until this part: After you have the directories all prepared, it's time to create the actual "pot" file, as it is usually referred to: the messages.po file. To do th...

Php gettext is not displaying the translated text (after generationg the .pot and .mo files with poEdit)!

I followed the folling tutorial: http://mel.melaxis.com/devblog/2005/08/06/localizing-php-web-sites-using-gettext/ about Php gettext extension (I unchecked the comment in the php.ini) The gettext is activated but it doesn't show up the translation (German). Here are the files: C:\wamp\www\php-test\test.php: <?php require_once("local...

Has anyone had issues with parsing CVS-committed gettext .mo files?

I have this issue where my mo parser code fails if I check out a .mo file from CVS ( CVS server is running on an old, old CENTOS box ) - I think CVS somehow corrupts it. If I use poedit and open the corresponding po file, and resave the mo over itself all is well. ...

Php gettext extension works on my local host but its not working on my hosting

I tried php gettext in my localhost and everything worked, but when I uploaded the files to my hosting it said the following: Warning: putenv(): Safe Mode warning: Cannot set environment variable 'LC_ALL' - it's not in the allowed list in /www/zxq.net/w/e/e/weedcl/htdocs/localization.php on line 4 Fatal error: Call to undefined function...

What's the simplest Php alternative to the Php gettext extension which can be supported by all kind of free hosting

I'm using Zymic, its a great hosting but it doesn't support the php gettext extension. I'm planning to buy some hosting in the future, but from now I want the simplest solution in order to replace the function of gettext, in this case I want to display different text (English, Spanish, Chinese, etc...) without modyfing the file too much ...

Mono GetText on .NET 3.5

Hi I have a problem with my app, using gtk# and Mono/.NET 3.5 MonoDevelop (which im using) under Linux shows all strings to translation, but monodevelop on windows - shows nothing. is there a way to make it work or is any another cross-platform solution to add multi-language to it? thanks in advance ...

Using PHP Gettext Extension vs PHP Arrays in Multilingual Websites?

So far the only 2 good things that I've seen about using gettext instead of arrays is that I don't have to create the "greeting" "sub-array" (or whatever its called). And I don't have to create a folder for the "default language". Are there other pros and cos of using gettext and php arrays for multilingual websites? USING GETTEXT: sp...

Django i18n: Common causes for translations not appearing

I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are trans...

Translation in JavaScript like gettext in PHP?

I am using gettext in my PHP code, but i have a big problem. All my Javascript files are not affected by the translation, can somebody tell me an easy way to get the translations in the chosen language into JavaScript as well. ...

how to use gettext in php?

i have a file dk.po and dk.mo ind folder lang in my webdir. how can i use this file? i have try all, but i can't relly get it to work. pls help me. // Lang putenv('LC_ALL=dk'); setlocale(LC_ALL, 'dk'); // Specify location of translation tables bindtextdomain("dk", ROOT .'lang'); // Choose domain textdomain("dk"); Tanks a lot. ...

ResourceBundles outside a jar file

Hello, I'm facing a problem when I need to distribute my java application, created using NetBeans 6.8. I have some translation files made with gettext as class files - made with msgfmt from gettext package with the following script (shell script run under msys - no problems here) PO_FILES=`find . -iname "*_*.po"` rm -f *.class for PO_...

PHP gettext function only returns orignal untranslated string

I'm trying to use gettext add localisation support to my website. I've followed various guides on how to setup gettext and have done the following: I've created the following files and directories in the root of my project dir: test.php locale/ de_DE LC_MESSAGES messages.mo messages.po en_GB LC_MESSAGES ...

How to compile gettext translations in setup.py of a Django app

How can I make sure setup.py compiles projects PO files and include them whenever an sdist is created. This is a Django app and manual process to generate MO files is to run following command in the app's root directory: django-admin compilemessages (This means going one level deeper than setup.py) I would like to avoid manually comp...

localize ordinal numbers

Hi, for ($rank=0; $rank<100; $rank++) { printf("Your rank: %d%s", $rank, $suffix); } Is there exist a gettext function to localize $suffix in the general case (any language)? Thank you. ...

php constant with gettext

I am using config file which contains: config.php define('SYS_TITLE','My Application Title'); I load language local for gettext based on SESSION variable in another file included after the config file is loaded. how to make it something like: echo _(SYS_TITLE); What is the best way to translate the SYS_TITLE without changing much o...

How to generate a .po file?

On Windows using WAMPserver (Apache, MySql, Php) I have the following: //test.php if (!defined('LC_MESSAGES')) define('LC_MESSAGES', 6); $lang = "sv"; putenv("LANG=$lang"); setlocale(LC_ALL, $lang); $domain = "messages"; bindtextdomain($domain, "./locale"); textdomain($domain); echo _("This is a string"); It works fine, i.e. it out...

Multilingual support using gettext with codeigniter, best practice?

I know how to create .po files and how to generate .mo files and then use them for translation on my Codeigniter powered site. However, I'm not quite sure on how to change language from the site GUI. I want to stick to codeigniter's default url calling schema: www.domain.com/controllername/method/param1/param2. Calling the server like ...

Howto find unmarked strings with gettext?

Does gettext have a way to warn me about strings that have not been wrapped in _() or N_()? Basically is there a way to get a list of all strings that do NOT match the keywords used by xgettext. So, I want: ! xgettext source_code Answer from the gettext mailing list: Run xgettext once, without --extract-all, to get the normal P...