gettext

Gettext: Is it a good idea for the message ID to be the english text?

We're getting ready to translate our PHP website into various languages, and the gettext support in PHP looks like the way to go. All the tutorials I see recommend using the english text as the message ID, i.e. gettext("Hi there!") But is that really a good idea? Let's say someone in marketing wants to change the text to "Hi there, y...

Can I call and set the Python gettext module in a library and a module using it at the same time ?

Im a coding a library inluding textual feedback that I need to translate. I put the following lines in a _config.py module that I import everywhere in my app : import gettext, os, sys pathname = os.path.dirname(sys.argv[0]) localdir = os.path.abspath(pathname) + "/locale" gettext.install("messages", localdir) I have the *.mo files in...

How do you handle translation of text with markup?

I'm developing multi-language support for our web app. We're using Django's helpers around the gettext library. Everything has been surprisingly easy, except for the question of how to handle sentences that include significant HTML markup. Here's a simple example: Please <a href="/login/">log in</a> to continue. Here are the approache...

How can I use GNU gettext with VB6?

I've been using gettext in several private projects and now I want to use gettext to translate strings of a Visual Basic 6 application. I've checked the GNU gettext packages and it seems that I have to write quite some boilerplate code to get it working with VB6 and I fear that my boss won't allow it. Is there some out-of-the box pa...

Merge 2 GetText files

Hi, I have two medium-sized web applications that I'm merging into one. The are both localized with GetText and have large amout of common strings, so merging them manually would be extremely annoying. What is the fastest way to merge the two PO files? ...

What good alternatives to poEdit are there?

I'm looking for a .po/.mo editor. I am using gettext for the translation files but don't really like poEdit. It has to run on Windows Vista and it would be even better if it was built into Visual Studio 2008 so I could develop and translate I really want something that helps me translate and makes translation easier. I want to have sugg...

How can I combine Catalyst and ngettext?

I'm trying to get my head around i18n with Catalyst. As far as I understood the matter, there are two ways to make translations with Perl: Maketext and Gettext. However, I have a requirement to support gettext's .po format so basically I'm going with gettext. Now, I've found Catalyst::Plugin::I18n and thus Locale::Maketext::Lexicon, whi...

Java and GNU gettext for internationalization

Has anyone had any experiences developing large Java applications using GNU gettext for internationalization? I find that I really like having the English text in my source code, but I want to make sure that what I'm doing is practical for the relatively large software project I am part of. If you have experience with this, what are yo...

Using GNU gettext on Win32

I'm writing a game that is mainly geared for GNU/Linux and Mac OS X systems, but I've been keeping things fairly portable in most of my code. I've ported nearly all of the OS-specific stuff to Windows; the only thing remaining is i18n. My question is this How am I supposed to use Win32's setlocale() function along with gettext? ...

How to enable locale en_EN on centOS to get i18n gettext working

I have a development version of my PHP website and when I moved it to my production server on centOS OS I discovered my locale version of en_EN is not working. Could you please tell me what can cause that and what to do to get this working? I use setlocale and gettext to use i18n in PHP. ...

Any good introductions and resources for gettext?

I'm looking into frameworks for translation, and have been considering gettext. Because it's supposedly quite good, and lots of projects use it. Now I read part of the official manual, but it sucked. I kind of have an idea how it works now, but I have no idea where to get started. In particular my project spans C++, Lua and Javascript, ...

c file is not generated from tsmarty2c.php command

Hi, I am using smarty gettext plugin to internationalize smarty templates on windows. But when I run the command tsmarty2c.php c file is created but the strings are not in the file.C file is empty. I am using PHP 5.2.9 and smarty gettext plug in version is v 1.1.Any help is appreciated. ...

How to use xgettext iteratively to update .po files for translation

I'm looking at using xgettext to aid translation of large codebase, and I have two questions: if I have one .po file per-language, is there an easy way to update them all using a single xgettext scan of the codebase, or must I run xgettext once for each language? if I add the target langauge to the .po file header with poedit, xgettext...

Localization of ASP.NET MVC websites with GNU Gettext?

Hi, This might be an unusual question, but is there any framework or at least some helper classes that would help me use GNU Gettext for localizing a C# ASP.NET MVC website? I've been using Gettext in a previous (managed code) project and really appreciate the possibility to use PoEdit for translating the resources. I guess this would ...

How to generate examples of a gettext plural forms expression? In Python?

Given a gettext Plural-Forms line, general a few example values for each n. I'd like this feature for the web interface for my site's translators, so that they know which plural form to put where. For example, given: "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"...

Best system for multiple language support in PHP?

I have an PHP application that I want localized. Currently, the way I'm doing this is a very ugly way: $loc['hello'] = "Hello", echo $loc['hello']; will show Hello, and you can change the file to change the language. What I want is a better way and a faster of doing this, what I'm considering: 1 XML file with language data for all page...

How can I do I18N in HTML::Template[::Compiled] with gettext?

I'm currently trying to move a web project from a custom i18n system to gettext, however I'll need to prepare HTML::Template::Compiled templates for i18n too and don't know yet how to do it. My templates are stored in separate files, therefore I can't use Perl's string interpolation and I also would like to use gettext-typical _() syntax...

How to convince fellow programmers to use Gettext?

I have used GNU Gettext successfully in many projects I have worked in, but at my latest job I have suddenly found myself forced to work with a really awkward localization system. The current system stores translations in database and adding new translation goes something like this: add function call with translation key to source cod...

Gettext and locales

...

Using smarty default varible modifier with gettext

Hi there. I'm currently using smarty with zend framework, and I have set up smarty to use gettext in the following manner: {gettext text="resource-identifier"} This works properly, but I got a problem when trying to use this with the smarty default variable handler. I want to do this: {$somevar|default:gettext text="resource-identif...