gettext

gettext: extract dgettext() strings to domain.po files

I have program with multiple domains, some source files contain dgettext() calls with different text domains. How to extract gettext-strings to multiple .po files? For example, call dgettext('one', 'Hello') should go to one.po, and dgettext('two', 'Bye') to two.po. xgettext just ignores text domain and puts everything in single file. ...

how does http://imo.im do their translation?

Hello, I'm a http://imo.im user and recently noticed that they implemented a translate system so that their users could help them translate their website to all other languages. I know about gettext and I was wondering if they use that or do they use arrays like here: http://www.weberdev.com/get%5Fexample-3844.html . And also, I was won...

i18n with gettext but without the locale hassle?

I am looking for a standards-compliant way to store multi-language content for a Web Application. Until now, I have employed my own "translate()" functions that read data from a file or a dictionary table in a database. However, keeping the dictionaries up to date in a database table is very cumbersome if you work with different copies o...

Gettext, not displaying

I'm trying to load my .mo translations using the following code, but it doesn't work. I have the php gettext ext. enabled in my phpinfo() and all the required locales are installed. Did I miss anything? $locale = "en_US"; putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("messages", "./locale"); textdomain("message...

PHP Gettext problems (like non-thread-safe?)

I want to start using gettext to handle my translations on web projects (PHP 5). Since it is a widely used standard with a good reputation it seems to be the best choice. However, I'm also hearing things about server incompatibly and it being non-thread-safe. What does this mean for my projects that use it then? Since I build things tha...

gettext for HTML or LaTeX?

Hello. Is there something like gettext for HTML or LaTeX? It would be great for generating simple bilingual webpages or LaTeX documents that should be kept in sync. Is there something like that already? I guess there must be some Perl script for that, but I couldn't find one. :-) Thanks! ...

How can I use PHP's gettext in conjunction with python's gettext?

I have an app that I'm migrating portions of to Django, but python and php have a different string format. E.g. "Hello %1s" in php vs. "Hello {0}" or "Hello {name}" in python. We'll be maintaining both apps for a while, but is there a way to use the python format in PHP or vice versa? ...

How to get Dreamweaver to display php gettext text?

Is there an extension or setting that would allow Dreamweaver to actually display "Hello World" when I type <?php echo _("Hello World"); ?> ? Instead it just shows a "php" icon. I mean, I usually blend HTML and PHP together, for example: <strong>We found <?php echo $results;?> results!</strong> That way in Dreamweaver I can easily s...

Java .getText vs. Hard Coded String not returning the same results

I am completely stumped with this one . . . If I call the function below with the following: Search(SearchTextField.getText()); // (Fiberglass was entered) Search("Fiberglass"); // hardcoded I get the following results: Fiberglass 10 Not Here Fiberglass 10 String found! Same String is passed with the same length, different results...

How to create macros/shortcuts in Dreamweaver or Notepad++

I've never made "macros" or anything like that with any program. I'm moving my php code to use "gettext", so I have to look for all my static text and change it up. For example, I need to change page title to <?php echo _('page title'); ?>. I don't think there is a way to change it all up in one shot, as it involves looking to see if ...

How does gettext handle dynamic content?

In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let's say I have <?=$user1?> poked John <?=$user2?>. Maybe in some language the order of the words is different. How does gettext handle that? (no, I'm not building facebook, that was just an example) 2) ...

PHP: Gettext problems

I can't seem to get gettext working, here. I'm using MAMP Pro and phpinfo(); says that gettext is enabled. I followed this tutorial: http://zez.org/article/articleview/42/1/ I have my strings declared in my code like this: _('test string'); Then I ran xgettest -L PHP test.php, which generated my messages.po file. I opened this file i...

i18n: gettext + Zend_Translate - namespacing / grouping strings together?

I'm updating my current framework's i18n method from a Localization class that stores language strings in arrays to gettext + Zend_Translate. There's a certain situation which leaves me puzzled, single string outputting is simple but using my current method I'm grouping certain strings together, for collections such as cities, states, ...

Can someone break down how localization file ( .mo, .po ) generation works?

I'm trying to grok gettext. Here's how I think it works - First you use some sort of po editor and tell it to scan a directory for your application, create these ".po" files, the application makes a po file for each file scanned which contains a string in a programming language, then compile them to binary mo files, to which gettext pa...

Gettext: Translation of strings with HTML inside?

My current implementation, which is array based stores keys and values in a dictionary, example: $arr = array( 'message' => 'Paste a <a href="http://flickr.com/"&gt;flickr&lt;/a&gt; URL below.', ); I realize that it was probably a bad idea storing html inside of a string such as this, but if I'm using gettext then in my .mo/.po fi...

Recusive xgettext?

How can I compile a .po file using xgettext with PHP files with a single command recursively? My PHP files exist in a hierarchy, and the straight xgettext command doesn't seem to dig down recursively. ...

i18n/gettext : setlocale configuration in web applications

So I started messing around with gettext but I'm still puzzled about certain things, would be great if anyone could help me out and fill in the gaps for me. Usually most of the implementations just invoke setlocale based on a language parameter. Is there any case in which I need to use putenv, perhaps for edge cases on Windows setups? ...

How to use GNU gettext with MS Visual C++?

Is it possible to use GNU gettext with MS Visual C++? Does someone know where to find a sample project that compiles under Visual C++? Update: Thanks to Sorin Sbarnea for his comments which help me to put all the pieces together: I'm used to the Delphi version of gettext where you simply compile the unit gnugettext.pas with your projec...

Application-wide locales with Gettext and Zend_Translate?

I have a custom directory, eg /www/phpstuff which is in my include_path. Inside of this phpstuff directory is a folder i18n. It contains server-side level .mo files. Zend_Translate lets you specify a directory in the second parameter of the constructor, I can't really do Zend_Translate( 'gettext', 'i18n/', 'en' ); It tries to read f...

Is there some sort of open source repository of translated strings stored in .mo, or similar formats?

Just curious, I reckon I'll have to hire a translator to do my .mo files manually but would be great if there was some sort of resource for this. Sorry if this question doesn't belong or isn't a "real" question, but it is related to web application localization. ...