I'm developing a website that's multilanguage. There are lots of solutions for example with database, .mo files, static php files etc. But what is the best way? Please can you give advice? Thanks..
I would go for gettext. As it is a de-facto standard and is used in many applications in different languages. Many people use it means bigger community and good support.
If you search for gettext in stackoverflow, you'll get good resources and examples.
Getting started with it in PHP:
http://www.onlamp.com/pub/a/php/2002/06/13/php.html
As Ardy said, Gettext is a good solution and has native integration with php, you could combine with intl for Internazionalization.
Another alternative is the Zend Framework 2 module I18n, but has dependencies with other ZF2 modules.
Related
I'm looking for a script (there has to be one) that help me to let me user translate my getText based PHP project.
Right now, I don't have time to create a solution on my one, so I were looking for some proper open-source solution using Google Search, but I could not find anything.
There are a lot of commercial solutions for this, but I would like to use a simple PHP alternative on my own server. It does not have to have a lot of features; I just want to select the languages I need and let the people translate and check translations.
I don't know of any solutions in PHP, but there are several open source projects for web-based translation tools. For example:
Weblate is based on Python/Django and supports Git integration. I think it is used by phpMyAdmin, so it should be suitable for PHP projects.
Zanata is written in Java and used by JBoss.
I also found SimplePO on Google Code which is written in PHP, but it does not seem to support plural forms. There is also a more recently updated fork on GitHub.
I've been looking into learning a PHP framework lately and have spotted these three popular choices. They all seem to have similar approaches and methods, and I'm not sure where to begin. If you are or have been using either one I'd greatly appreciate any pros, cons or other info you might want to share about them.
I'm considering these frameworks with the following in mind:
- Which one has best multi-lingual support?
- Which is the easiest to implement / start out with?
- Which is the most future-proof and versatile (i.e. working with NoSQL databases such as MongoDB)?
I have been using all of the mentioned frameworks, but I really enjoy using the codeigniter framework, because it is very lightweight and does not interfere with my workflow in doing too much things I don't want.
The i18n and multi-lingual support is really simple, there is a helper and a class ready to use.
Codeigniter has also pretty much support for any database you may want to use. If you happen to use a database that isn't supported, you can easily write your own database driver, just take a look at one of the driver files.
It is also very easy to integrate other external libraries e.g. Doctrine, adodb into your project.
I'm developing a PHP-based application that requires internationalization (i18n) support.
I'm using Smarty 3 as a template solution (and TinyMVC as the framework), and although I've been using it for small projects before (back in the days of Smarty 2.x), I haven't known about any easy-to-use i18n plugins for it. Is there such plugin/extension for Smarty 3.x that'll do the job for me? I don't mind if the backend is a bit hard to setup, that's fine, all I need is a good way to implement it in templates.
I need to translate this app into multiple languages, so I need to find a way for Smarty to support it. Is there one? Thanks.
You can use a gettext plugin with Smarty, such as the one posted on this thread which the poster developed for Smarty 3 and that he claims to have been using in production for over six months without issue.
i am looking for a new php(5) framework it must be lightweight(x<500kb), oop, have orm, active record built in, simple to learn, fast to use, active community and dev.
I need it for small, personal app development.
My php skills are quite low and i have .net background. I have previously used LightVc+cough and codeIgnitor php frameworks.
There are so-many frameworks there and it is quite hard to find the best.
I have checked the other threads here but they are to old to consider sustainable.
Thanks for your time.
I think you dig out the http://www.phpframeworks.com/. It has details about each and every accepted framework.
Code Igniter is very popular and also supports PHP4: http://codeigniter.com/
Unlike .NET and miscellaneous other programming languages, you really don't need a framework to write a PHP application. In fact, I'd advise against it. Learn the language, not a framework.
For someone with low PHP skills I'd say codeigniter although it doesn't have ORM built-in (it has a sort of lightweight active record class), but there are tutorials on how to use Doctrine (a good PHP ORM solution) with it.
However if you want a PHP5 only framework (as in written to take full advantage of PHP5) then I'd suggest looking at Kohana (a PHP5 only fork of codeigniter), Yii or Zend framework.
I'm trying to find a project that incorporates the "best practices" that are discussed and debated on a daily basis for almost all languages but I'm trying to focus on php5.
Is there a php5 open source project that I can comb through to see working examples of project that exemplifies Units Tests, Dependency Injection and other best practices
I'm basically researching for a new large project and wanted to see a shining example project in all it's glory instead of the snippets of code that are endlessly debated. Since this project will not inherit a whole bunch of legacy code I'm really trying to get things right from the start.
It seems like you are looking for something like Zend Framework!
Check out Kohana Framework too. In fact, most of the popular frameworks have great PHP code. I can not say the same for Wordpress, osCommerce, etc. Magento seems to be OK, maybe a little over engineered.
Here are the list of few libraries which are having good php standards
Laravel - PHP Framework with tons of goodies
Guzzle - CURL library
PHPUnit - PHP Testing Framework
Carbon - DateTime handling library
Faker - For generating fake data
Many more are there, the following link will help you more
https://github.com/uhub/awesome-php