Questions tagged [php-gettext]

php-gettext is a library for emulating gettext (a widely used framework for internationalization) in PHP.

Gettext is a widely used framework for internationalization. The php-gettext library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

81 questions
1
vote
1 answer

Nginx with FastCGI - GETTEXT trouble, works on Apache

I've got problem witch Nginx and php-gettext module. All works without any trouble on apache, but on nginx not. I've got two servers started on my notebook. Apache works on 80 port, and Nginx on 81. When I run my page on apache's port, then all…
1
vote
2 answers

php-gettext isn't working

I'm trying to setup localization using php-gettext, but it doesn't seem to work no matter what. I have an index.php: English | German
stamas
  • 397
  • 1
  • 3
  • 16
1
vote
0 answers

Using "CGI (every host may be set to a different PHP version)" causes gettext/_() to crash apache

I'm using MAMO PRO (Trail) version 6.3 (30448). Currently I have to hosts set up, although this issue happens for no matter the number of hosts. When I'm using the setting "Languages -> PHP -> Mode: CGI (every host may be set to a different PHP…
1
vote
0 answers

How to set locale for `LC_MESSAGES` through the config files?

In setting up gettext for PHP, one needs to declare (among others) these two things (in my example I'm using en_US): setlocale(LC_MESSAGES, 'en_US.utf8'); putenv('LANG=en_US.utf8'); I was trying to move these things into the PHP configuration file…
Digital Ninja
  • 3,415
  • 5
  • 26
  • 51
1
vote
2 answers

gettext working locally, but not on the host server

I'm facing an odd issue with gettext in my PHP application. It works on my development machines (Ubuntu 10.10 32 bit, 2 x Windows 7 64 bit, Windows 7 32 bit, all running XAMPP). The production server is a paid host running some flavour of Linux 64…
mingos
  • 23,778
  • 12
  • 70
  • 107
1
vote
2 answers

gettext problem in codeigniter

I added one library for gettext translation. Added corresponding po and mo files. And the translation is working fine. Now when I update my po file, change some translation.. after that when I reload the page, I am getting the old translation, not…
viMaL
  • 638
  • 1
  • 7
  • 20
1
vote
1 answer

How to maintain a system that uses php-gettext?

I developed a system using php-gettext library and following this tutorial. Everything worked normally and the exchange of languages is ok, but this system will undergo changes with time and new strings will emerge as well as other will leave the…
Victor Assis
  • 162
  • 7
1
vote
0 answers

Cannot load gettext.so extension for php5 (cli)

I'm unable to use the gettext extension with PHP-CLI. After configuring php.ini, I get this error message whenever I use php: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/gettext.so' -…
Katai
  • 2,773
  • 3
  • 31
  • 45
1
vote
2 answers

Extract javascript gettext in Poedit?

I have used "GNU gettext" with PHP and it did a greate job by using poedit I was able to extract the PO file format but when I tried the same thing for my javascript inside my HTML "script" tag I didn't work even more I can't see any javascript…
mr chon
  • 125
  • 1
  • 15
1
vote
0 answers

Laravel 5.1 with gettext gives undefined function _() in console commands

I'm using Laravel 5.1 on Homestead. I translate strings with the Xinax/Gettext package (https://github.com/xinax/laravel-gettext). It all works perfectly except for when trying to run a console command containing translatable strings, for example…
Mattias
  • 1,111
  • 1
  • 14
  • 23
1
vote
1 answer

Gettext not translating every string

I'm using PHP Gettext with .mo files (using PoEdit) to translate from French (fr_FR.UTF-8) to English (en_US.UTF-8), and it works quite fine but not all strings are translated ! I'm not talking about accents not translated correctly with UTF-8, some…
Ecorce
  • 123
  • 2
  • 11
1
vote
0 answers

Setting gettext to work with wamp

Haven't found this kind of problem here. Well i want to localize my website to English and Serbian language. It is working for english, but i can't make it work with serbian. My directory structure looks like this (working on WAMP): My app | …
gagitron
  • 67
  • 2
  • 10
1
vote
1 answer

php-gettext How to use it better

I'm using php-gettext instead of the native php gettext extension. I was wondering if there was a better way of translating tons of text. For example, I have this bit of code:

Adam Silva
  • 1,013
  • 18
  • 48

1
vote
0 answers

PHP versions confusing - Gettext not working with PHPStorm

I have a tedious setup and have ended up with multiple versions of PHP on Mac OSX Yosemite, and now it has become confusing. So, I managed to have gettext working with PHP for localization, and it works for Apache. But now when I have installed…
Nikhil Khullar
  • 703
  • 6
  • 21
1
vote
2 answers

can't translate to any other language using gettext php function

I use a WAMP server on Windows and make a test project. I have these files in the website folder: C:\wamp\www\project\locale\ar_EG\LC_MESSAGES\messages.po C:\wamp\www\project\locale\en_US\LC_MESSAGES\messages.po Below is the PHP…
user4401361