问题
How do i use Poedit to read strings embedded in __(). It's a Cakephp .ctp file. At the moment it only works if i remove one underscore: _(). I know how to use the console but i want to use Poedit.
回答1:
Catalog -> Properties -> Source keywords and add __
, because unlike _
it is not xgettext's default.
Just guessing, BTW, because your question leaves a lot to be desired in terms of usable details.
回答2:
Read the books page about i18n & i10n.
You have to use the shell to generate the catalogue files and you open these files with poedit not your template files. That's how it works.
Have a read how gettext works. Translating something is more than just replacing a string...
回答3:
So to make it easier if you can't have your ctpo file parsed by poedit.
Open poedit, in the "files" => "preferences" check the extractors tabs, choose php for modification, add *.ctp to the extension lists.
Save and update your list, translations from ctp files should be there now.
Enjoy !
You should indeed use your console to generate a pot file but, for example, i'm working on a project where everything is online on a mutualised server, i don't have access to any console.
来源:https://stackoverflow.com/questions/18656322/how-to-read-in-cakephp-ctp-files-with-poedit