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
0
votes
1 answer

Automatically add Gettext to all japanese texts in all php files in a directory

I have some 500 php files which contain some Japanese texts that are to translated. I want to add gettext to all those japanese texts. How can I add it automatically in all php files
0
votes
0 answers

PHP + Poedit + Gettext not working with spanish

I'm working on a multilanguage PHP website that uses Poedit for translations and I'm having problems with a specific language, that is Spanish. I will start saying that in the server (after website is published) both languages work fine but in my…
Diego Perez
  • 2,188
  • 2
  • 30
  • 58
0
votes
1 answer

Translate parts of a string individually using Twig and the i18n extension?

I have a string that looks like This is a list of all items with number 123456 in United States. and I want to translate it to Swedish as Detta är en lista över alla artiklar med nummer 123456 i USA. The problem is that the number 123456 and the…
Magnus
  • 17,157
  • 19
  • 104
  • 189
0
votes
1 answer

Output a variable in Twig BEFORE translation?

I'm using the Slim PHP micro framework with Twig and the translation extension i18n. I have a need to output translated country names, and would prefer to do it using the translation extension rather than building an array and fetching the name…
Magnus
  • 17,157
  • 19
  • 104
  • 189
0
votes
1 answer

php-gettext installed but not available

I have the following packages installed on Ubuntu 16.04: apache2 2.4.18-2ubuntu3.1 php-gettext 1.0.11-2build1 gettext 0.19.7-2ubuntu3 php7.0 7.0.15-0ubuntu0.16.04.4 The only mention of gettext when I call phpinfo() is in the module authors section…
Catchwa
  • 5,845
  • 4
  • 31
  • 57
0
votes
1 answer

Internationalization with gettext on Windows 7 home and PHP 7.0.8 fails

At work we have decided to translate our site into 3 additional languages and I have been looking into how to do this. I've spent the better part of the day searching google and stackoverflow, trying every different solution but I can't make it…
Cirshiss
  • 81
  • 9
0
votes
1 answer

php gettext() showing up msgid instead of msgstr

Here is my messages.po file # msgid "_greet1" msgstr "Hello" msgid "_greet2" msgstr "Bye" I get this po file compiled to mo file using PO Edit, and when I use the mo file inside translation code, I see msgid of the string instead of msgstr. I am…
h_h
  • 1,201
  • 4
  • 28
  • 47
0
votes
2 answers

PHP mail function not working. How to grab text of a DIV?

trying to find the solution, please help. First of all find the code below. when i remove the 'right variable' it's working fine. But i have to add the text of this div in every email. i have tried .text() and .html() both are not working. Please…
user1812111
  • 83
  • 1
  • 1
  • 11
0
votes
0 answers

Connection to server from client app Android

Good evening to all, I would insert a string on db that hosted in my web page. I've created a php file that with a GET method pass the param that I would insert. This method on the browser work but if i call it on Android app with the following code…
Alberto
  • 13
  • 7
0
votes
1 answer

PHP gettext and conditional statements

Translating a website with gettext and PoEdit for the first time, I noticed that the messages generated by conditional statements are ignored. How can PoEdit get the messages from a switch construct like this, for example? if ($a == 1) echo…
GCW
  • 312
  • 5
  • 17
0
votes
1 answer

PHPs gettext with directory of languages without textdomain

I want to use PHPs gettext() to translate my application automatically. But for me, it's real overkill having locales/de_DE/LC_ALL/$app_name.mo. I would need somnthing like only locales/de_DE.mo, like WordPress does it. How could I configure gettext…
jankal
  • 1,090
  • 1
  • 11
  • 28
0
votes
2 answers

Can PHP's gettext extension be used on Google Cloud Platform / Google App Engine?

I am using the php_gettext extension in my project to translate strings using ".mo"-files. I am in the process of transferring the project to Google's Cloud Platform but apparently the php_gettext extension is not enabled (see here). Is there a way…
0
votes
1 answer

Max size for PO file strings

I know that PO / MO files are meant to be used for small strings like button names, labels, etc. Not long text like an About page, etc. But lately I am encountering a lot of situations that are in the middle. For example, a two sentence call to…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
0
votes
0 answers

Strange functioning of gettext

I have a very strange situation with gettext. I configured an Apache server on a Windows Server 2008. I installed the default XAMPP distribution and tweaked a few settings. The site is running fine all in all but the situation is the following: I…
Mihail Minkov
  • 2,463
  • 2
  • 24
  • 41
0
votes
1 answer

gettext stops working randomly

I am stuck in a rut here. When browsing through a translated version of my localized site, the translation randomly stops, and I have no idea why; I'm not sure if it has to do with the way I'm setting the Locale or what, but it randomly stops…
David
  • 3
  • 3