Language name

I’m trying to display the language name of some locales’ primary language, e.g.: English (US) for en_US locale ID. How do I do so based on Yii. I tried using the locale class from php, but whenever doing so, the framework tries to load a class Locale which (as expected) does not exist within the framework.

You can have a table with the languages names and search there. Something like this:

In svn, CLocale has a getLanguage() method. Looks like exactly what you need. Let me check if 1.1.8 Yii has the appropriate data in its i18n codes…

Nope, it’s all fresh in v1.1.9 (svn/trunk). But I believe you could try to copy the svn i18n folder over your existing one.

Da:Sourcerer, thanks a lot. This new feature is very good