Search Results

Search found 14 results on 1 pages for 'poedit'.

Page 1/1 | 1 

  • How to generate a .po file?

    - by tobefound
    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 outputs "This is a string" which means I have gettext correctly setup up. But HOW in the world do I create a .po-file? I downloaded POEdit but I can't see how to make this happen with that software. ANy help is greatly appreciated!

    Read the article

  • cakephp, i18n .po files, How to use them correctly

    - by ion
    I have finally managed to set up a multilingual cakephp site. Although not finished it is the first time where I can change the DEFAULT_LANGUAGE in the bootstrap and I can see the language to change. My problem right now is that I cannot understand very well how to use the po files correctly. According to the tutorials I've used I need to create a folder /app/locale and inside that folder create a folder for each language in the following format: /locale/eng/LC_MESSAGES. I have done that and I have also managed to extract a default.pot file using cake i18n extract. And it appears that all occurrences of the __() function have been found succesfully. In my application I'm using 2 languages: eng and gre. I can see why you would need a seperate folder for each language. However in my case nothing happens when I edit the po files inside each folder....well almost nothing. If I edit the /app/locale/gre/LC_MESSAGES/default.po I have no language changes. If I edit the /app/locale/eng/LC_MESSAGES/default.po then the language changes to the new value (on the translation field) and it does not switch to the other language. What am I doing wrong. I hope I made myself as clear as possible.

    Read the article

  • Online editing gettext files?

    - by NeoNmaN
    Online editing gettext files, is it possible? I use gettext for all my PHP projects, but sides with a minor problem, want to mine user may translate my language from as Danish to Norwegian, but in this case it enste I know is that I need to export my file from Poedit there is any. other software that can export / import my files? for Poedit can I do with export as. hope i could help me a little.

    Read the article

  • How to enable other languages for MailChimp List Subscribe Plugin?

    - by Lenin
    I have translated the MailChimp provided MailChimp List Subscribe Form plugin for wordpress. I used poEdit to edit. At wp-config.php I have language set as ar_SA. Which works for the themes I have used in two Bilingual sites. But the mo file had to be renamed to ar.mo I got two problems: While updating the catalog poEdit crashes. But I could save the .po and generated .mo successfully. The translated .mo doesn't appear for the confirmation success or error messages through the Ajax calls which its supposed to. I am submitting my .po file link here for experts to view. I have saved the settings for translation in the files. Translated Bangla.po file || Translated Arabic.po file

    Read the article

  • PHP gettext function only returns orignal untranslated string

    - by Camsoft
    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 messages.mo messages.po I've used Poedit to create the above .po and mo files. I've made sue it use Unix line endings, UTF-8 and set the language and country accordingly. I've then created a PHP script called test.php which has the following code: <?php define('LOCALE', 'de_DE'); // Set up environmental variables putenv("LC_ALL=" . LOCALE); setlocale(LC_ALL, LOCALE); bindtextdomain("messages", "./locale"); bind_textdomain_codeset("messages", LOCALE .".utf8"); textdomain("messages"); die(gettext('This is a test.')); ?> I've imported the text "This is a test." to Poedit and supplied the translation and saved it. But for some reason the test.php script will only output the original text untranslated. It refuses to load the version for the translation files. It's worth noting that the server is running Linux (Ubuntu), Apache 2.2.11 and PHP 5.2.6-3ubuntu4.5. I've checked phpinfo() and gettext is enabled. Can someone help me? Thanks.

    Read the article

  • Mysql adapter for Zend_Translate

    - by Peter
    Hi everybody, I'm currently in the planning phase of a rather large project that I'll develop in the Zend Framework. One of the problems I'm facing is that the customers will want to translate not only the content but also the interface. I'm currently using gettext and poedit to manage my language files but this is not an option for the customer as they, for one, want have FTP access to the site. Hence, I'm thinking of a mysql back end with an interface in the front end for the customer to manage his own translations of the interface. There is however still no mysql adapater for Zend_Translate. So, does anybody now of an adapter script for Zend_Translate so it can work with a mysql table? Or any arguments against using mysql and possible other solutions for this problem?

    Read the article

  • How simplify iPhone localization?

    - by mamcx
    I need to localiza a in development app for English & Spanish. Despite the fact I follow the Apple way of use NSLocalizedString & create nibs for both, I already lost the track of the new string that need to get localized and found with surprise that I need to redo the nibs in spanish when I change the master. (Just like this http://www.gigliwood.com/weblog/Cocoa/A_Great_Need_for_Be.html) I wonder if exist a better/alternative/more automated way. I know the use of gettext & poedit and wonder if something like that can be used. Or if exist some script or tool for this.

    Read the article

  • Zend_Translate scan translation files

    - by nute
    I've trying to use Zend_Translate from Zend Framework I am using "POEdit" to generate "gettext" translation files. My files are under /www/mysite.com/webapps/includes/locale (this path is in my include path). I have: pictures.en.mo pictures.en.po (I plan on having pictures.es.mo soon) It all works fine if I manually do addTranslation() for each file. However I want to use the automatic file scanning method. I tried both of those: <?php /*Localization*/ require_once 'Zend/Translate.php'; require_once 'Zend/Locale.php'; define('LOCALE','/www/mysite.com/webapps/includes/locale'); if(!empty($_GET['locale'])){ $locale = new Zend_Locale($_GET['locale']); } else{ $locale = new Zend_Locale(); } $translate = new Zend_Translate('gettext', LOCALE, null, array('scan' => Zend_Translate::LOCALE_FILENAME)); if ( $translate->isAvailable( $locale->getLanguage() ) ){ $translate->setLocale($locale); } else{ $translate->setLocale('en'); } And this: <?php /*Localization*/ require_once 'Zend/Translate.php'; require_once 'Zend/Locale.php'; define('LOCALE','/www/mysite.com/webapps/includes/locale'); if(!empty($_GET['locale'])){ $locale = new Zend_Locale($_GET['locale']); } else{ $locale = new Zend_Locale(); } $translate = new Zend_Translate('gettext', LOCALE); if ( $translate->isAvailable( $locale->getLanguage() ) ){ $translate->setLocale($locale); } else{ $translate->setLocale('en'); } In both cases, I get a Notice: No translation for the language 'en' available. in /www/mysite.com/webapps/includes/Zend/Translate/Adapter.php on line 411 It also worked if I tried to do directory scanning.

    Read the article

  • PHP gettext on Windows

    - by Axsuul
    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/manual/en/book.gettext.php), it appears that it's a different process on a Windows environment. I've tried out some of the solutions in the comments but I still can't get it to work! Please, I've spent many hours on this, hopefully someone can point me in the right direction to get this thing to work! (and I'm sure there are others out there who share my frustration). So far with my setup, I'm only getting output "Hello World!" whereas I should be getting the translated string. Here is my setup/code so far: <?php // test.php if (!defined('LC_MESSAGES')) { define('LC_MESSAGES', 6); } $locale = "deu_DEU"; // apparently the locales are different on a WINDOWS platform putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("greetings", ".\locale"); textdomain("greetings"); echo _("Hello World"); ?> Folder structure root: C:\Program Files\WampServer 2\www test.php: C:\Program Files\WampServer 2\www\site .po: C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.po .mo: C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.mo Please advise! Thanks for your time :)

    Read the article

  • Apache gettext windows does not work/translate

    - by Prashant Kandathil
    I am new to gettext. Here is my setup: /Apache 2.2 PHP 5.3.6 Windows 7/ I have following code in the Apache/htdocs/test/index.php <?php $language = 'de_DE'; $translatefile = 'messages'; setlocale(LC_ALL, $language); putenv("LANG=".$language); bindtextdomain($translatefile, 'C:/locale'); textdomain($translatefile); echo gettext("Hello World!"); ?> I used PoEdit to generate the necessary translations under locale/de_DE/LC_MESSAGES/messsages.po & messages.mo The charset I used was UTF-8 When I visit http://localhost/test, the result is Hello World! when it should be Hall Welt! As a test, I opened command prompt and navigated to the test folder. Then I typed in php index.php The result that appeared in the console was Hall Welt! I am not sure why it is not working with Apache.

    Read the article

  • PHP gettext on Windows

    - by Axsuul
    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/manual/en/book.gettext.php), it appears that it's a different process on a Windows environment. I've tried out some of the solutions in the comments but I still can't get it to work! Please, I've spent many hours on this, hopefully someone can point me in the right direction to get this thing to work! (and I'm sure there are others out there who share my frustration). So far with my setup, I'm only getting output "Hello World!" whereas I should be getting the translated string. Here is my setup/code so far: <?php // test.php if (!defined('LC_MESSAGES')) { define('LC_MESSAGES', 6); } $locale = "deu_DEU"; // apparently the locales are different on a WINDOWS platform putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("greetings", ".\locale"); textdomain("greetings"); echo _("Hello World"); ?> Folder structure root: C:\Program Files\WampServer 2\www test.php: C:\Program Files\WampServer 2\www\site .po: C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.po .mo: C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.mo Please advise! Thanks for your time :)

    Read the article

  • Where to translate message strings - in the view or in the model?

    - by GrGr
    We have a multilingual (PHP) application and use gettext for i18n. There are a few classes in the backend/model that return messages or message formats for printf(). We use xgettext to extract the strings that we want to translate. We apply the gettext function T_() in the frontend/view - this seems to be where it belongs. So far we kept the backend clean from T_() calls, this way we can also unit-test messages. So in the frontend we have something like echo T_($mymodel->getMessage()); or printf(T_($mymodel->getMessageFormat()), $mymodel->getValue()); This makes it impossible to apply xgettext to extract the strings, unless we put some dummy T_("my message %s to translate") call in the MyModel class. So this leads to the more general question: Do you apply translation in the backend classes, resp. where do you apply translation and how do you keep track of the strings which you have to translate? (I am aware of Question: poedit workaround for dynamic gettext.)

    Read the article

1