Wiki

Articles tagged with "i18n", sorted by viewsX
Displaying 11-20 of 22 result(s).

i18n for your model in just 1 line

Created 4 years ago by mintaoTutorials0 comments – viewed 10,993 times – ( +12 ) – version 1.1
A simple trick to get the localized version of a model field is to add this little method to your models.
tags: i18n

Multilanguage and SEO friendly

Created 9 months ago by InterboyHow-tos1 comment – viewed 10,406 times – ( +5 )
In your application configuration (protected/config/main.php), set the sourceLanguage parameter to English:

Using SQLite and CDbMessageSource as a module

Created 2 years ago by pheadeauxHow-tos5 comments – viewed 9,227 times – ( +5 ) – version 1.1
There are scenarios when you work with DVCS (like Mercurial or Git) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very time consuming. Plus, when working in a team, you never know when the database was updated.

How to extend CFormatter, add i18n support to booleanFormat and use it in CDetailView

Created 2 years ago by c@cbaHow-tos3 comments – viewed 8,835 times – ( +9 ) – version 1.1
As you know, the CDetailView widget displays details of a single model. If no formatting is specified, boolean values that are stored in the database as 0 and 1, are represented in the detail view as 0 and 1. If formatted as boolean, they are represented as 'No' and 'Yes'. We want to add i18n support, so that Yes and No appear in the current language.

How to obtain a grammatically correct translation of the model name in giix-generated view files

Created 2 years ago by c@cbaHow-tos0 comments – viewed 8,158 times – ( +4 ) – version 1.1
The giix code generator has out of the box i18n support for model names and attribute labels (besides other cool features > check it out!) . But I want to factor in not only the plural form, but also the grammatical cases (especially the accusative) while translating 'Manage Objects', 'Create Object', 'Edit Object' etc.

Simple example for language translation

Created 4 months ago by RKAHow-tos2 comments – viewed 4,985 times – ( +1 ) – version 1.1
Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.
tags: yii, i18n

Entire Messages into javascript object

Created about a year ago by markuxHow-tos0 comments – viewed 4,277 times – ( +2 ) – version 1.1
I needed all messages with their translation into javascript. This is my solution:

How to provide a fallback or mapping for translation messages?

Created about a year ago by schmunkHow-tos1 comment – viewed 3,124 times – ( +5 )
Sometimes you want to use exisiting translations for locales, which do not directly match. An example would be a website targeting Germany (de_de), Austria (de_at) and Switzerland (de_ch, fr_ch, it_ch). Although you may have exisiting translations for German (de), French (fr) and Italian (it), there are problems using it directly.

Save and Display Date/Time Fields in different formats in Yii2

Created 2 months ago by Kartik VHow-tos4 comments – viewed 2,150 times – ( +24 ) – version 2.0
You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.

I18n / localised routes in Yii

Created 28 days ago by ElecenHow-tos1 comment – viewed 964 times – ( +2 / -1 ) – version 1.1
So, you need localised urls made simple that follow the Yii framework guidelines?
tags: i18n, Routing