Translate Zend Framework website like WPML in Wordpress - zend-framework

I want to know if it's possible to translate a Zend Framework 1 website in a manner similar with the one implemented by WPML for Wordpress.
What I want is to make an application that can scan the website source code for translation variables, then store them in a database or a .po file.
Also please note that I am not interested in switching to another framework or using only Wordpress for my website but in a method of simple and easy translation for someone without programming skills.

What you need is:
Zend_Translate with gettext adapter
Zend_Registry
Poedit
More info here.

PoEdit http://www.poedit.net/download.php
I have used this software to create .mo files for Zend_Translate gettext adapter in one of my ZF projects.

Related

EPiServer migrate content from home grown CMS

Hopefully someone can help me, I'm new to EPiServer and have been given a data migration task. We are using the latest version 8.5. I need to migrate content from a clients home grown CMS (that luckily is in a tree like structure) to EPiServer. There doesn't seem to be a whole lot of information about this on the web - perhaps I just don't know the right thing to search for.
It looks like using the EPiServer.ServiceApi might be the route to go but again locating useful documentation is proving difficult.
I was thinking of setting up the client CMS in SQL Server and writing a simple console application to call the EPiServer.ServiceApi inserting the content. If anyone has any information on this or better still and example i would be very grateful.
Thanks,
Dan
If you are just importing content from another CMS I would write a scheduled job in EPiServer:
http://world.episerver.com/code/dannymurphy/Stoppable-Scheduled-Job-with-feedback/
That job then uses the standard IContentRepository to create content:
http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/8/Content/Persisting-IContent-instances/
That way you can run it whenever you want and have access to EPiServers complete API. Also you can see progress of the import through the job status.
In the job you can read the content as a file in any format you like or directly from the source CMS database or some xml or RSS feed perhaps.
I have moved content from PHP, Java and .NET CMS this way. In .NET you could even access the source CMS via WCF or SOAP if available.
The ServiceApi is relatively new and more focused on Commerce products and media assets rather than CMS page and block content so I wouldn't use that.
There is complete documentation below for the ServiceApi by the way, did you not find it?
http://world.episerver.com/documentation/Items/EPiServer-Service-API/
Regarding language management you can read more in the below links:
http://cjsharp.com/blog/2013/04/11/working-with-localization-and-language-branches-in-episerver-7-mvc/
http://tedgustaf.com/blog/2010/5/create-a-new-page-language-branch-programmatically-in-episerver/
Basically you have two options for multiple languages. If the content is just straight translations you should create nine different language versions (branches) of the same page. You can also have multiple sites in an EPiServer installation but that requires 9 separate licenses (and the associated costs).
I've done a lot of EpiServer content migration projects. The easiest way if it's possible is to export your current sites tree in Json and then import that into EpiServer. I've had to do it on a recent project and mixed with Json.net it's pretty easy.
If you want to go that route you can find all the code to do it here: EpiServer Content Migration With Json.Net/

Zend Framework and fuelphp

I wanted to know if it was possible to use zend framework libraries from zend 1.11 in fuelphp? fuel looks nice and I started looking at it as I believe its the next logical step for any CI developer.
Is there any site or a howto for using zend library with fuel?
Thanks
It really depends on what portions of Zend Framework you want to use. Some parts, e.g. Zend_View are tied into the MVC-part of the framework, but components like Zend_Pdf or Zend_Service_* have only few dependencies and should work fine in other frameworks as well.
What you should do is check out the Reference Manual to see what other components are required by the component you are trying to use. And then put them in a library folder. Alternatively, just put the whole Zend Framework in a folder if you don't mind carrying the dead weight with you.
I've been using ZF-components standalone and found that it's useful to add it to include_path as you would when using ZF as MVC-framework, because some ZF-classes are instantiated dynamically, i.e. not via require_once and that won't work without the folder containing Zend/ being in the include_path.
Finally you have to add the folder to your autoloader, this should be as easy as:
Autoloader::add_namespace('Zend', __DIR__.'/path/to/Zend/library');

Sample working CMS with Zend Framework

I'm looking for a sample project that uses Zend Framework so that I can see how masters do it.
I'm not looking for something that uses other stuff like smarty, or any other major library.
There are plenty of samples for different subjects on sites like zendcast.com but I need a full working solution.
I couldn't come up with anything like that by googling.
I came accross this a while ago, it has a sectoion on Central authentication
http://www.zend.com/webinar/Framework/70170000000bEs9-webinar-secure-application-development-with-the-ZF-20100505.flv
Here are the notes, look at page 9
http://static.zend.com/topics/Webinar-Zend-Secure-Application-Development-with-the-Zend-Framework.pdf
Is this a good idea?
We are making a full open source CMS, based on Zend Framework: Centurion CMS (http://www.centurion-project.org/).
We are working on it since more than 2 years. The project is under the new BSD licence.
Feel free to try, use, pull feature, make some push request, criticize...
If you have any question use the our Google group: http://groups.google.com/group/centurion-project
Social Engine 4 is what you are asking for but its not free nor open source . The best application ever created using ZF has became even more popular then Zend itself (google trend) its known as "Magento". Its open source and based on best programming practices (design patterns) .
Social Engine 4 projects are built on Zend Framework.
Social Engine 3 used smarty but they decided to move to Zend.
Have a look at TomatoCMS
Pro Zend Framework Techniques: Build a Full CMS Project
I think this book will be useful for you.

How to name files using gettext translations with Zend Framework

I'm using gettext translation adapter in a Zend Framework projekt. But I'm wondering what's the best practise when naming and placing these translation files within my project?
At first I had APPLICATION_PATH/languages/sv_SE.po (and sv_SE.mo)
But then I read about the auto searching features of Zend Framework and started wondering if it would be better to have the languages in subfolders. But the structure APPLICATION_PATH/languages/sv_SE/sv_SE.po and APPLICATION_PATH/languages/en_US/en_US.po didn't feel quite natural. Using array adapters ect it have felt easier to come up with a good naming conventions... But what is the best practise when it comes to using gettext translations in Zend Framework? Is it most common to have all translations in a single file or should one use something like
APPLICATION_PATH/languages/en_US/admin.po
APPLICATION_PATH/languages/en_US/forms.po
APPLICATION_PATH/languages/en_US/othercrap.po
Feels like this apporach might make it tedious when scaning source for strings to translate since one would have to open several files etc.
I ended up using
APPLICATION_PATH/languages/en_US/admin.po
APPLICATION_PATH/languages/en_US/forms.po
APPLICATION_PATH/languages/en_US/othercrap.po
which has worked fine.

How to prune Zend Framework?

I wouldn't use most of the classes from Zend Framework, that's why I'm looking for the thinnest possible ZF configuration.
Is there a better way of finding what I really need other than deleting the whole library/Zend folder, then putting back files based on the error messages that I receive?
I have not used it myself, but http://blog.fedecarg.com/2009/02/01/zend-framework-automatic-dependency-tracking/ may be what you are looking for.
Hm...
There is a lot of information about Zend Framework on SO and with a little bit of reading you would have found the answers to your question
You would also find the answers to your question by just reading the introduction to Zend Framework on the Zend Framework website.
No, that's not how you'll do it. Zend Framework, unlike most/all other PHP frameworks, is rigidly loosely coupled. You can use every component stand-alone. You can only use the loader, or only Zend_Translate. Or you can just use the MVC modules, or Zend_Db, etc.
Of course if you use Zend_Form and want to validate or filter the input, you'll need Zend_Validate and Zend_Filter. But you'll know that because you'll instantiate objects. So just copy into your empty library folder the modules you need. Or even better, copy everything in! A) you won't regret it. B) disk space is not your problem.
What I would do is set up the plugin loader cache and then purge all files apart from the ones called within the automatically generated include file.
zend.loader.pluginloader.performance
I hope it makes sense... :o)