gettext

Using regular expressions with 'msggrep'

Hello, I have a PO file with a content like: msgid "or" msgstr "or-translation" msgid "orand" msgstr "orand-translation" I need to obtain the translation of a given msgid. Using the command "msggrep -K -e 'orand' template2.pot" I get the translation for 'orand', and this is ok. But when I use "msggrep -K -e 'or' template2.pot" if...

Using settings.LANGUAGES with properly translated names using gettext()

From Django Documentation: If you define a custom LANGUAGES setting, it's OK to mark the languages as translation strings (as in the default value displayed above) -- but use a "dummy" gettext() function, not the one in django.utils.translation. You should never import django.utils.translation from within your setti...

php string variables in gettext

Hello, How does gettext translate string variables? It doesn't seem to want to do it.. lets say I have $sentence = "Hello World"; and then I want to echo ($sentence); ... how can I do that so that I can translate what's inside $sentence in Poedit?I can use -> echo sprintf(("%s test"), $sentence) and this will print "Hello World test" in...

php string variables in gettext (forgot one case scenario)

I've posted a question yesterday but I just realized that the answer doesn't seem to be working for a certain situation. The post was http://stackoverflow.com/questions/1349159/php-string-variables-in-gettext/1349209#1349209 and here is what I asked about: Hello, How does gettext translate string variables? It doesn't seem to...

xgettext vs gettext

I have a few questions: I know what gettext is. I've read a few posts where they mentioned xgettext and was curious as to what is the difference between the two. How can I install xgettext on Windows? And finally, does anybody have a tutorial on how to install the library php-gettext http://savannah.nongnu.org/projects/php-gettext/ ...

Why does the Python gettext module require a compilation step (.po -> .mo) ?

I don't see that the compilation step is adding any value. ...

What is so good about gettext for language files?

Everywhere on SO when it comes to making a multi language app in PHP everyone say that gettext is the best way to do it. I am just wanting to know why? Like what makes this method below, less efficient then using gettext? <?PHP //Have seperate language files for each language I add, this would be english file function lang($phrase){...

How do you make gettext ALWAYS use a translation instead of default languiage text

When you call the gettext php function for translating text to another language, it uses the text you have on the page to act as the KEY/ID to lookup the value to replace it with echo gettext('hello how are you today'); that would be the text used to lookup the translation, however I would like to use something like this echo gett...

Translating php app with gettext

From my previous questions about gettext, one of the biggest benefits of using PHP's gettext extension instead of other methods of language translation was that it is super easy to have other people make translation files with a program called Poedit. Now I have gettext working in my app but I have not made any translation files yet, ...

C++: How to localize an already-written program

Hello, I want to localize a program I already written.. It's fairly big (almost 50k lines) and ideally I want a system that allows me (the programmer) to do the least amount of work possible, and without major changes to the program - if possible none at all. I looked at gettext() and liked it a lot, but it's unclear to me how it would ...

PHP gettext() in Norwegian

Hi there! I'm using PHP's gettext() for simply transform a website to an other language. The solution worked fine (English/Hungarian) until now because i need to add a Norwegian translation to a new site. When i set the Norwegian locale with setlocale(LC_ALL, "nb_NO.ISO8859-1"); gettext() only returns the base string not the translated...

Is it possible to pass parameters into a translated sentence in a .po translation file?

Hi, I am using .po and .mo files for translating my website. My question is, is it possible to pass parameters into a translated sentence in a .po translation file? For example: en -> Hi, my name is Sarah, and I am an alcoholic I want to translate that sentence using two params, name (Sarah) and profession (an alcoholic). Thank you ...

How to load language with gettext in PHP?

I have created a language file in poedit for the use of the PHP gettext function, now on the page I am trying to test it on, I cannot get it to find/load the .po or .mo file I created, does anyone see what I am doing wrong? $locale = "en_US"; putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("default", "/includes/loca...

Better to use multiple language files or 1?

From your experience, is it better to use 1 language file or multiple smaller langauge files for each language in a PHP project using the gettext extension? I am not even sure if it is possible to use multiple files, it is hard for me to test since the server caches the language files. I am doing multiple languages on a social networ...

php source code to PO file generator

Hi all, I have to convert all my echo/print string from my php source code file to PO file(for the language translation), is there any batch convector available for the same. ...

PHP gettext on Windows

There's some tutorials out there for gettext (w/ Poedit)... unfortunately, it's mostly for a UNIX environment. And even more unfortunate is that I am running my WAMP server on Windows XP (but I am developing for a UNIX environment) and none of the tutorials can get gettext working properly for me. From the man page (http://us3.php.net/...

Good method to do text with links in gettext?

I'm currently doing internationalization with gettext using PHP. I was wondering if there were any good methods for this example: By using this website, you accept the <a href="<?php print($dir); ?>/tos/">Terms of Use</a>. For en_US, this sentence would follow such a format. However, in another language, the link "Terms of Use" coul...

In a project using GNU Autotools, is there a task to launch xgettext ?

Summary : I have a project using GNU Autotools. I have a pot file. I need to update it. Is there a magical "make" task that run xgettext for me (I'm lazy ?) Verbose version : Hi I am trying to setup a project using GNU autotools and gettext. I'm trying to follow the 'lazy' path (that is, only writing configure.ac, Makefile.am, a...

Link wrappers for internationalization purposes

Hi, I am currently internationalizing my site using PHP and ran into this problem. Some string have multiple links in them so I would like to put the links in wrappers to make it easier for translators to translate (since I'm using gettext). For example: The <a href="google.com">dog</a>, <a href="bing.com">cat</a>, and <a href="yahoo....

Is it possible to combine two .po translation files together?

We have two .po files, each from different branches of a piece of software. We need to combine these into a single .po file. There are duplicates between the two files, and the ideal handling would be for one file's strings to be favoured (consistently). We have a SUSE system so the --output-file doesn't seem to have the behaviour of ...