Search Results

Search found 560 results on 23 pages for 'gettext'.

Page 1/23 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • 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

  • Is gettext appropriate for internationalizing user help documentation?

    - by Richard JP Le Guen
    On my project, we have po files to internationalize/translate various labels, error messages, button-text etc. We also have separate po files for the entirety of our help documentation, which is included in the product. Is this an appropriate use of gettext - putting entire documents in po files as opposed to just labels and messages? The format has been made all the more complicated because sometimes (for tooltips or "what's this" icons) only a small part of the help doc is needed, resulting in single phrases/paragraphs being entries in the po file, which are then concatenated together when the user views the help... making the actual act of translation challenging. Is there a better way to internationalize end user help documentation?

    Read the article

  • using gettext at arm-linux system

    - by savant
    I need to use gettext for web-interface localization. Translation saved in unicode and formatted with msgedit. when I try to execute something like #LC_MESSAGES=ru_RU.utf8 gettext -d domain "Sample text" then i get string like "?????? ????" where "?" is 0x3f symbol. What I forgot to do?

    Read the article

  • Examples of localization in Perl using gettext and Locale::TextDomain, with fallback if Locale::Text

    - by Jakub Narebski
    The "On the state of i18n in Perl" blog post from 26 April 2009 recommends using Locale::TextDomain module from libintl-perl distribution for l10n / i18n in Perl. Besides I have to use gettext anyway, and gettext support in Locale::Messages / Locale::TextDomain is more natural than in gettext emulation in Locale::Maketext. The subsection "15.5.18 Perl" in chapter "15 Other Programming Languages" in GNU gettext manual says: Portability The libintl-perl package is platform independent but is not part of the Perl core. The programmer is responsible for providing a dummy implementation of the required functions if the package is not installed on the target system. However neither of two examples in examples/hello-perl in gettext sources (one using lower level Locale::Messages, one using higher level Locale::TextDomain) includes detecting if the package is installed on the target system, and providing dummy implementation if it is not. What is complicating matter (with respect to detecting if package is installed or not) is the following fragment of Locale::TextDomain manpage: SYNOPSIS use Locale::TextDomain ('my-package', @locale_dirs); use Locale::TextDomain qw (my-package); USAGE It is crucial to remember that you use Locale::TextDomain(3) as specified in the section "SYNOPSIS", that means you have to use it, not require it. The module behaves quite differently compared to other modules. Could you please tell me how one should detect if libintl-perl is present on target system, and how to provide dummy fallthrough implementation if it is not installed? Or give examples of programs / modules which do this?

    Read the article

  • xgettext vs gettext

    - by Kentor
    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/ (this one usually doesn't come with PHP) I've read about it in an article but I'm not sure how to get it working in Windows. The thing is, sometimes when you make changes, you need to restart Apache to see the new data with the gettext that comes with PHP (but with the library you don't need to restart it) so I wanted to use the library for development. Thanks!

    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

  • 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

  • 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

  • Multilingual support using gettext with codeigniter, best practice?

    - by tobefound
    I know how to create .po files and how to generate .mo files and then use them for translation on my Codeigniter powered site. However, I'm not quite sure on how to change language from the site GUI. I want to stick to codeigniter's default url calling schema: www.domain.com/controllername/method/param1/param2. Calling the server like this is a no-brainer: www.domain.com/controllername?lang=en Doing that for every controller using the default url schema, requires me to implement the same method in every controller, just to pass the lang parameter to the setlocale() function and then bind to my .po domain name. Feels awkward... ANy ideas how you guys work with gettext in codeigniter? And yes, I do want to work with gettext.

    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 constant with gettext

    - by wesamly
    I am using config file which contains: config.php define('SYS_TITLE','My Application Title'); I load language local for gettext based on SESSION variable in another file included after the config file is loaded. something like: echo _(SYS_TITLE); What is the best way to translate the SYS_TITLE without changing much of the code.

    Read the article

  • CMake module for gettext support?

    - by Artyom
    Hello, Is there a good, open-source, document CMake module for gettext support? I mean: Extracting messages from sources Merging messages to existing translations Compilation of mo-files Installation of mo-files. Because plain macros that CMake provides are quite... useless for real l10n support.

    Read the article

  • Best practice for string substition with gettext using Python

    - by Malcolm
    Looking for best practice advice on what string substitution technique to use when using gettext(). Or do all techniques apply equally? I can think of at least 3 string techniques: Classic "%" based formatting: "My name is %(name)s" % locals() .format() based formatting: "My name is {name}".format( locals() ) string.Template.safe_substitute() import string template = string.Template( "My name is ${name}" ) template.safe_substitute( locals() ) The advantage of the string.Template technique is that a translated string with with an incorrectly spelled variable reference can still yield a usable string value while the other techniques unconditionally raise an exception. The downside of the string.Template technique appears to be the inability for one to customize how a variable is formatted (padding, justification, width, etc).

    Read the article

  • PHP and Gettext not work on my server!

    - by NeoNmaN
    i have this site ( http://rssbot.dk/en/ ) i try to get gettext to work so my english, sweiden and norway site can comming up. Bot i can't get it to work, what have i doe wrong? this is my config code // define constants ( defualt - danish ) $lang = 'da_DA'; $lang_short = ''; $lang_prefix = 'da'; if ( isset( $_GET['lang'] ) ) { switch( $_GET['lang'] ) { case 'en': $lang = 'en_EN'; $lang_short = 'en/'; $lang_prefix = 'en'; break; case 'se': $lang = 'se_SE'; $lang_short = 'se/'; $lang_prefix = 'se'; break; case 'no': $lang = 'no_NO'; $lang_short = 'no/'; $lang_prefix = 'no'; break; } } define( 'LANG', $lang_short ); define( 'LANG_PREFIX', $lang_prefix ); putenv("LC_ALL=". $lang ); bindtextdomain('messages', ROOT .'lang/'); and my path is /var/www/rssbot.dk/lang/ folder. shut i make chmod right or? i hob to can be helpet

    Read the article

  • how to use gettext in php?

    - by NeoNmaN
    i have a file dk.po and dk.mo ind folder lang in my webdir. how can i use this file? i have try all, but i can't relly get it to work. pls help me. // Lang putenv('LC_ALL=dk'); setlocale(LC_ALL, 'dk'); // Specify location of translation tables bindtextdomain("dk", ROOT .'lang'); // Choose domain textdomain("dk"); Tanks a lot.

    Read the article

  • Is there a way to access the locale used by gettext under windows ?

    - by phtrivier
    I have a program where i18n is handled by gettext. The program works fine, however for some reason I need to know the name of the locale used by gettext at runtime (something like 'fr_FR') under win32. I looked into gettext sources, and there is a quite frightening function that computes it on all platforms (gl_locale_name, in a C file called "localename.h/c"). However, this file does not seem to be installed alongside gettext or libintl, so I can't seem to call the function. Is there another function provided by gettext to get this value ? Or in another package (boost, glib, anything ?) (On a related note, there is a thing called std::locale in the C++ standard library, and according to the doc calling std::locale("") should create a locale with the settings of the system, unless I am mistaken ... but then the name is 'C' under windows. Is it a viable way of getting the locale name ? What I am doing wrong ?)

    Read the article

  • Using PHP Gettext Extension vs PHP Arrays in Multilingual Websites?

    - by janoChen
    So far the only 2 good things that I've seen about using gettext instead of arrays is that I don't have to create the "greeting" "sub-array" (or whatever its called). And I don't have to create a folder for the "default language". Are there other pros and cos of using gettext and php arrays for multilingual websites? USING GETTEXT: spanish/messages.po: #: test.php:3 msgid "Hello World!" msgstr "Hola Mundo" index.php: <?php echo _("Hello World!"); ?> index.php?lang=spanish: <?php echo _("Hello World!"); ?> turns to Hola Mundo USING PHP ARRAYS: lang.en.php <?php $lang = array( "greeting" => "Hello World", ); ?> lang.es.php <?php $lang = array( "greeting" => "Hola Mundo", ); ?> index.php: <?php echo $lang['greeting']; ?> greeting turns to Hello World index.php?lang=spanish <?php echo $lang['greeting']; ?> greeting turns to Hola Mundo (I first started with gettext, but it wasn't supported in my shared free hosting Zymic. I didn't want to use Zend_translate, I found it too complicated to my simple task, so I finally ended up using php define, but later on someone told me I should use arrays)

    Read the article

  • PHP Localization Best Practices? gettext?

    - by nute
    We are in the process of making our website international, allowing multiple languages. I've looked into php's "gettext" however, if I understand it right, I see a big flaw: If my webpage has let's say "Hello World" as a static text. I can put the string as <?php echo gettext("Hello World"); ?>, generate the po/mo files using a tool. Then I would give the file to a translator to work on. A few days later we want to change the text in English to say "Hello Small World"? Do I change the value in gettext? Do I create an english PO file and change it there? If you change the gettext it will consider it as a new string and you'll instantly loose the current translation ... It seems to me that gradually, the content of the php file will have old text everywhere. Or people translating might have to be told "when you see Hello World, instead, translate Hello Small World". I don't know I'm getting confused. In other programming languages, I've seen that they use keywords such as web.home.featured.HelloWorld. What is the best way to handle translations in PHP? Thanks

    Read the article

  • MacPorts on mountain lion - cannot install apache2 due to gettext package

    - by jancha
    I have been having problem with installing gettext package from macports. When I am launching /opt/local/bin/port -v install apache2 it checks dependencies, and continues with gettext package installation. But the configure process freezes here: checking for egrep... /usr/bin/grep -E and nothing happens.. can wait hours, nothing changes. I tried to configure, make, make install manually for that package and it went all fine. But, when same configure is launched by ports, it hangs there. Question: 1) How can that be fixed? 2) Maybe I can somehow manually tell ports, that I installed that gettext package manually already? Sorry, if wrong "site" for this question. Felt most proper one.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >