poedit

PHP Gettext - No translation

▼魔方 西西 提交于 2020-01-13 09:32:26
问题 I am trying to use the PHP gettext extension in order to translate some strings. All functions appear to return the correct values but calling gettext() / _() returns the original string only. The PO/MO files seem correct and I believe I have set the directories up correctly. I am running WAMP Server with PHP 5.3.10 on Windows (also tried running 5.3.4 and 5.3.8 because I have the installations). Firstly, see /new2/www/index.php : $locale = 'esn'; # returns Spanish_Spain.1252 in var dump

PHP Gettext - No translation

爷,独闯天下 提交于 2020-01-13 09:32:14
问题 I am trying to use the PHP gettext extension in order to translate some strings. All functions appear to return the correct values but calling gettext() / _() returns the original string only. The PO/MO files seem correct and I believe I have set the directories up correctly. I am running WAMP Server with PHP 5.3.10 on Windows (also tried running 5.3.4 and 5.3.8 because I have the installations). Firstly, see /new2/www/index.php : $locale = 'esn'; # returns Spanish_Spain.1252 in var dump

How to get (translatable) strings from specific domain with POEdit

南楼画角 提交于 2020-01-10 02:03:09
问题 I have been trying for hours finding a way to setup POEdit so that it can grab the text from specific domain only My gettext function looks like this: function ri($id, $parameters = array(), $domain = 'default', $locale = null) A sample call: echo ri('Text %xyz%', array('%xyz%'=>100), 'myDomain'); I will need to grab only the text with the domain myDomain to translate, or at least I want POEdit to put these texts into domain specific files. Is there a way to do it? I found several questions

Create POT file with Poedit

风流意气都作罢 提交于 2020-01-02 03:58:08
问题 I'm trying desperately to create a catalog (. In) for my new application in php. 1) I created a file "trans.php" where I put all the values ​​to be translated For example, here is my file: <?php echo _e('SORTIR LA NUIT'); ?> 2) I open Poedit, in the "Paths" here's what I entered (see photo) Then I save the same location of my file "php". 3) When I click "update", I have the following errors: 12:25:43: No files found in: /Users/aweaoftheworld/Desktop/test 12:25:43: Poedit did not find any

Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit)

为君一笑 提交于 2019-12-30 19:55:14
问题 I checked MSDN and the locale string is zh_Hant, but I also tried with zh_TW (Chinese, Taiwan). The traditional Chinese characters look OK in the poEditor, but when I open the file in the browser the characters are just weird symbols («¢Åo¥@¬É!). I think the translation is working, but there's something wrong with the encoding (I used UTF-8 for both Charset and Source Code Charset). The files generated with poEditor: messages.po: msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs

How to load language with gettext in PHP?

大城市里の小女人 提交于 2019-12-30 03:26:35
问题 I have created a language file in poedit for the use of the PHP gettext function, now on the page I am trying to test it on, I cannot get it to find/load the .po or .mo file I created, does anyone see what I am doing wrong? $locale = "en_US"; putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("default", "/includes/locale"); textdomain("default"); //my .po ad .mo file is located here /includes/locale/en/default.mo Even though I am trying to load the default english lang file,

Using Poedit to parse Twig templates in a Zend Framework 2 application

你离开我真会死。 提交于 2019-12-25 04:33:40
问题 I've downloaded Poedit, and am attempting to parse my Twig templates. A few tutorials online pointed to https://github.com/umpirsky/Twig-Gettext-Extractor which I later found was referenced in a tutorial here http://aromatix.fr/?p=611 (French) with full instructions. I got the tutorial done, installed umpirsky/twig-gettext-extractor, and when it tries to build the catalog it dies with "cannot execute program". The error popup contains this command: /path/to/twig-gettext-extractor --sort

PoEdit and PHP annotations

試著忘記壹切 提交于 2019-12-23 09:05:26
问题 I'm looking for a way to make PoEdit understand PHP annotations. Here's a sample of code I want PoEdit to pick up and put into catalog: class MyController extends Controller { /** * @Title "Home" */ public function index() { ... } } The interesting part is @Title annotation. It is accessed in front controller and assigned to master view, effectively ending up inside <title>...</title> tag. Now I need that string translated, but PoEdit seems to only understand _() expressions, and adding

How to add a new string to a *.po file w/ a PO editor

不问归期 提交于 2019-12-20 11:37:30
问题 I MANUALLY created a file: test.po with the contents: msgid "greeting" msgstr "Hello World" Now I can edit the translation (hello world) in editors like "poedit" and "GTranslated" (I'm using Ubuntu). I can even add comments to that translation. However neither "poedit" and "GTranslated" will let me ADD a new translation string - I've looked online to no avail and looked at screenshots of other editors and none seem to have a "new" button. What am I missing??? It seems stupid to have to edit

How to add a new string to a *.po file w/ a PO editor

这一生的挚爱 提交于 2019-12-20 11:37:01
问题 I MANUALLY created a file: test.po with the contents: msgid "greeting" msgstr "Hello World" Now I can edit the translation (hello world) in editors like "poedit" and "GTranslated" (I'm using Ubuntu). I can even add comments to that translation. However neither "poedit" and "GTranslated" will let me ADD a new translation string - I've looked online to no avail and looked at screenshots of other editors and none seem to have a "new" button. What am I missing??? It seems stupid to have to edit