Using Poedit with XAMPP
Asked Answered
B

2

9

I am struggling for quite a while now to get into translation files with PHP's gettext() function and creating the files with Poedit. Poedit didn't come with a helpfile either and I tried lots of things found online but nothing works.. I am on Mac OSX with an XAMPP configuration.

on OSX my XAMPP dir is

/Applications/XAMPP/xamppfiles/htdocs/

inside this dir I created gettext.php with

<?php echo _("Hello World"); ?>

and the following folders:

/locale/
/locale/it_IT/LC_MESSAGES/

With Poedit when I do > File > New Catalog

Language: Italian
Country: Italy
Charset: UTF-8
Source code charset: UTF-8
Base path: /Applications/XAMPP/xamppfiles/htdocs/

Than I save default.po to /locale/it_IT/LC_MESSAGES/

"Updating the catalog failed. Click on 'More>>' for details

13:04:10: Poedit did not find any files in scanned directories.
13:04:11: Entries in the catalog are probably incorrect.
13:04:11: Updating the catalog failed. Click on 'More>>' for details.
Bratwurst answered 14/9, 2010 at 13:8 Comment(0)
R
19

Poedit is partially strange like gettext itself. I've just tried and got the error message myself, because I forgot one crucial setting. Go into catalogue > options, and the paths tab, duplicate the base path into the path list. Poedit uses the base path for locating the .po files, I'd guess. The actual source files aren't found unless you set one of the (source?) paths. Then the menu entry catalogue > read from source files should be available as well.

Rihana answered 17/9, 2010 at 12:22 Comment(1)
Ok, I finally got it! I left the . In the basepath, than /Applications/XAMPP/xamppfiles/htdocs/ in the path list. Thanks again Mario for the help!Bratwurst
H
0

For other reference: I saw the same cryptic message when I tried to update Javascript sources.

It turns out I didn't have the Javascript parser added to PoEdit. I fixed the problem by following these helpful steps:

how to generate po file from js file using poedit

Hayne answered 25/12, 2013 at 3:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.