

- #Poedit alternative how to#
- #Poedit alternative install#
- #Poedit alternative update#
- #Poedit alternative code#
The bootstrap below looks for the language specific gettext. I usually use poedit a gettext editor which is available for most platforms to create my translation files, and after some initial configuration of the catalog paths so it can see your source files please see Part 1 of this article series.
#Poedit alternative code#
The procedures and best practices for this is unfortunately like training a dog, everyone has a different way of doing it and an opinion, so the methods and code I show here are taken out of applications that are running in production so if you have a better way of doing it please feel free to comment!.
#Poedit alternative how to#
This entry is part 2 of 4 in the series Working with Zend_Translate and PoeditĪ recurring problem for site developers is implementing a solid way to create and maintain multilingual sites, this article series is my feeble attempt to guide you through how to quickly implement the Zend_Translate in an Zend Framework 1.9.x site. There are a ton of good Zend_Translate references out there, google is your friend!
#Poedit alternative update#
Now if you add new strings to your source code you simply load poedit and open your sv_SE.po file and select Catalog -> Update from sources and it will again show you the Update Summary dialog with all new string as well as changed strings and removed (Obsolete) strings. mo file is the compiled version that Zend_Translate uses. Now after you are done you simply click File -> Saveand two files will be written to your languages directory, in my case sv_SE.po and sv_SE.mo where the. When you click OK on the Update Summary Dialog you will be taken to the main poedit window where you can translate the strings.Īs you can see it’s very easy to work with simply enter your translations in the bottom text box. Translate("Welcome %s, your last login was %s",$this->user,$this->user) ?> In this example the strings where caught from $this->headTitle()->prepend($this->translate('TestBench Application -')) Now your source code will be scanned after the keywords you specified earlier and the Update Summary dialog will be showing all the strings it detected Now you click OK and the Save as dialog comes up move to your project application directory and select or create the languages directory the path should look something like C:\Zend\Apache2\htdocs\testbench\application\languages and save the file as sv_SE.po (replace this with the language/locale code that you have choosen.) (Note: If you have any other keywords that come to mind, feel free to comment and I’ll add them to this tutorial) Now select the Keywords tab and click the New item tool and add In my case C:\Zend\Apache2\htdocs\testbench then click the New item tool and add application Now select the Paths tab, and add your projects base path. The main poedit window will now come up, click File -> New Catalog, you should now see a settings window.įill in your Project name and version and the rest of the fields making sure you select Charset and Source code charset to UTF8 and selecting the language and country of the translation you are going to create, in my case Language: Swedish and Country: SWEDEN.

Now click OK twice and you are done with the preferences. Make sure your dialog matches the one above exactly! You can leave all the options as their defaults, including the Line endings format
#Poedit alternative install#
Install poedit and start it, if it’s the first time you run it you should now see a Preferences dialog. In this tutorial we are on Windows, but the process is the same on Mac & Linux based systems, and poedit even looks much the same on all platforms. I will take you through the configuration process step by step, and in the end you should have a working installation. There are a few steps you need to take to configure poedit to work with a Zend Framework project properly. This entry is part 1 of 4 in the series Working with Zend_Translate and Poedit
