Create .po language files using PoEdit
Set up PoEdit for ZF2 View Fiels
By default PoEdit doesn’t know how to parse ZF2′s view files. We first need to tell the program to actually look for and parse them. This is done by following these simple steps:- Download PoEdit
- Install and Open PoEdit
- GoTo Menu File > Settings > Parser
- Select PHP > Edit
- Add ;*.phtml to file extensions to parse
- Hit OK twice
Create the language files
Now let’s take a look at why PoEdit is so much referenced throughout the internet when it comes to generating translation files. We will automate the process for our very own translation files.- Goto Menu File > New Catalog
- Feel free to edit the Information in the window, but leave Language blank
- GoTo Tab Paths
- Add the path to your Module as default path, e.g.:
C:\xampp\htdocs\AwesomeApp\modules\MyModule - Add . as an alternate path
- GoTo Tab Keywords
- Add the ZF2 translator keyword “translate” (obviously no brackets)
- Hit OK
- Select your save-path, e.g.:
C:\xampp\htdocs\AwesomeApp\modules\MyModule\language - Define the file name, e.g.: ‘de_DE’.po
- Hit OK
One thing to note: When you wish to add or remove single translation string when making newer versions of your Module, simply open the language file, e.g.: de_DE.po and select Catalog > Refresh from sources
PS: I only have PoEdit on a german version. I assume that my guessed translation for menu items will be very similar but probably won’t match 1:1. Please help me out and leave a comment for me to be able to update this post for greater accuracy. Thanks in advance.
resources : http://samminds.com/2012/09/create-po-language-files-using-poedit/
Không có nhận xét nào:
Đăng nhận xét