Showing posts with label plural. Show all posts
Showing posts with label plural. Show all posts

Sunday, February 3, 2013

Handling plurals with the Yii PHP framework


Yii (which stands for Yes, it is) is a free, open-source PHP framework started by Qiang Xue in 2008. Aimed at performance, based on MVC architecture, and following the event-driven programming paradigm, it also supports message translation, date and time formatting, number formatting, and interface localization. We will focus here on the way Yii handles the plural form format in its message translation feature in its current release (1.1.13).

Tuesday, January 15, 2013

CodeIgniter tutorial: how to extend a helper


CodeIgniter helpers are toolkits of functions created to ease your coder life. You can find them in the system/helpers/ directory. Among them, we get arrays, captchas, cookies, emails, and forms helpers to cite just a few.

The inflector helper (inflector_helper.php) defines the functions singular (which returns the singular form of the word given as parameter) and plural (which returns the plural form of the word given as parameter), but only for the English language. We will see in this tutorial how to add the support of another language (here, French) to the plural function, and thus enabling the pluralization of French.