Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create POT file with Poedit

Tags:

php

poedit

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".

paths configuration in Poedit

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 files in scanned directories.
12:25:43: Entries in the catalog are probably incorrect.
12:25:43: Updating the catalog failed. Click on 'More>>' for details.

Can you help me?

Sincerely,

like image 950
Raphaël Avatar asked Feb 01 '12 11:02

Raphaël


People also ask

What are .POT files?

What is a POT file? Files with . POT extension represent Microsoft PowerPoint template files created by PowerPoint 97-2003 versions. Files created with these versions of Microsoft PowerPoint are in binary format as compared to those created in Office OpenXML file formats using the higher versions of PowerPoint.


2 Answers

Make sure the path(s) defined in POEdit (Catalog > Settings > Paths) point to the folder that contains your PHP files. This should solve the problem of POEdit not finding the files.

If the did not find any files in scanned directories is resolved, POEdit will probably still find 0 messages. This is because by default POEdit doesn't support _e as a keyword. To resolve this problem, simply add "_e" to the list of keywords (in Catalog > Settings > Keywords).

like image 54
barkgj Avatar answered Oct 22 '22 10:10

barkgj


you should use _ instead of _e, for example

<?php echo _("hi there i am gettext library") ?>

by the way, _e function is from Wordpress engine, it doing same but it's not PHP predefined function.

like image 34
noroot Avatar answered Oct 22 '22 08:10

noroot