gettext

How to implement search on a gettext driven multi language site?

I'm setting up a multi-language using gettext. Since all text from other languages are in the compiled .mo files. How should I attack the search function of the site? Any help or point of direction would be appreciated. Note, I have not coded a search enigine before… ...

How do you use gettext when you have link into the translated text ?

I use gettext to translate my web site. It would be nice to have link in text translated but I don't want to write html tags in gettext files because these translations may be used elsewhere. I could create text for web site only (with links) and text for all purpose. I'll have to maintain 2 versions. :-( I could also write a custom p...

How to make PoEdit correctly parse custom "ngettext" implementation?

I've coded a gettext wrapper that makes the whole process of l10n a little bit simpler but somehow I can't get PoEdit to correctly identify and parse plural version calls to the function. This is what I originally had: _e(array('%d house', '%d houses'), 5); But that doesn't work at all, PoEdit picks nothing at all. I also tried: _e('...

PHP/Gettext Problems

I remember running some tests a some months ago with gettext and the following code worked perfectly: putenv('LANG=l33t'); putenv('LANGUAGE=l33t'); putenv('LC_MESSAGES=l33t'); if (defined('LC_MESSAGES')) // available if PHP was compiled with libintl { setlocale(LC_MESSAGES, 'l33t'); } else { setlocale(LC_ALL, 'l33t'); } bindt...

Grep for .PO file, or RegEx for a block of text between delimiters

Start with this file: msgid "a string" msgstr "" msgid "" "A longer string wraps " "on multiple lines." msgstr "" Grep RegEx to replace all msgstr lines like this: msgid "a string" msgstr "{a string}" msgid "" "A longer string wraps " "on multiple lines." msgstr "" "{A longer string wraps " "on multiple lines.}" In my infinite ...

Using gettext in CakePHP model validation

Hi! Is there any possibility to use the gettext functionallity within the CakePHP model validation array? Usually a programmer would do it like this: class Data extends AppModel { var $validate = array( 'title' => array( 'NichtLeer' => array( 'rule' => array('between', 4, 20), 'allowEmpty' => false, 'message' => _('B...

Why doesn't gettext have a db storage option?

Hi all, I'm doing some i18n on a web-based app using Django, which uses gettext as its i18n foundation. It seems like an obvious idea that translations should be stored in the database, and not difficult to do, but po files on the filesystem are still being used. Why is this? My current suspicion is that the benefits of developing a d...

Do you know how to parse string which are wrapped in a keywords ?

Hi, I'm trying to parse an application with Poedit. Most of my translation use a translate() method but in some views file (.phtml) I use a special keyword such as My string Do you know could I specify to poedit ? Thank you Edit: I know how to add keyword such translate, setLabel, etc... but they are all methods. I need to add some...

Gettext wrong default language

I'm using gettext to handle translations on a C++ project of mine. I generate the .pot file using xgettext and then I create .po files for spanish and english using msginit (en.po and es.po) . The problem is that, although the locale on my system is set to spanish, the .po file that gets automatically filled is en.po, where it should b...

Getting special characters with gettext

Hi. I am using gettext to translate my site. In norwegian I need to use the charaters æøå, but they show up blank. I have set the $encoding = 'iso-8859-1';from wikipedia it says that æøå should be available, but as I said they show up blank. In poedit settings and my po/mo file I have set encoding to iso-8859-1. ps. I want to support a...

Assigning Gettext String to Class Member

I'm making a site that will be translated into x languages. All strings must be localized. There are occasions when I need to display a language name, country name or other information that has been retrieved from a database. The data being dealt with in this way will seldom be changed - as above I'm talking about language names, count...

gettext problem with validation message.

I have a validation message self.errors.add_to_base(_("country cannot be deleted #{self.country_name}")) this is not working. But simple messages like self.errors.add_to_base(_("country cannot be deleted")) working fine. I am converting this messages to spanish. Any idea or solution? ...

PHP, I18n and gettext not working properly?

Hey Guys, I'm currently internationalizing an existing PHP project and thought the easiest way to do this is by just integrating I18n + gettext. Currently I have a I18n.php: <?php setlocale(LC_ALL, 'de_DE.UTF-8'); bindtextdomain('cms', './locale'); textdomain('cms'); ?> Which is being included in every file that needs some transla...

get � when for special characters using gettext and smarty

Hi. I am using $encoding = 'utf-8'; in gettext and in my html code i have set <meta charset="utf-8">. I have also set utf-8 in my .po files, but I still get � when I write æøå! What can be wrong? ...

localize content in PHP with getttext?

I have a PHP application and now I need to implement multi language support. This is the first time I have to deal with this. I did some searches on the internet and always come to PHP's gettext function, which I have compiled on my server. I would just like to know if gettext() is the best way doing this? Most articles date back to even...

Localization of GUI built with Glade and Python (Gtk)

Hi, I have made an application using Glade and Python and I would like to make several localizations. I know how to localize strings that are in the Python code, I just encapsule all the strings that are supposed to be localized with _() and than specify the translation of the string in a .po file. But how do I tell a string that is bu...

Is GNU gettext built in into Wordpress or do I have to download it separately?

Is GNU gettext built in into Wordpress or do I have to download it separately? ...

How to change the value WPLANG in Wordpress by clicking a link (switch language)?

I successfully made files for localization using Gettext (called es.po and es.mo). So far as I know I can change the language by defining the value of WPLANG in wp-config.php (in this case define ('WPLANG', 'es');) I would like the user to change his/her preferred language by clicking a link. What's the best way of doing this? ...

Calling a function with variable number of arguments with an array in C++ (like python's * operator)

Hello world! I'm trying to write a v8 module in C++; there, the functions receive a variable number of arguments in an array. I want to take that array and call a function like gettext and printf that receives a formatted string and it's necessary args. The thing is, how can one take an array and send the elements as arguments to one of...

Python: gettext doesn't load translations on Windows

This particular piece of code works very well on Linux, but not on Windows: locale.setlocale(locale.LC_ALL, '') gettext.bindtextdomain('exposong', LOCALE_PATH) gettext.textdomain('exposong') Code from here Even if i specify the locale in locale.setlocale (I tried different formats) it doesn't work. One problem might be that the loca...