Wiki

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

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

Created 8 months ago by Kartik VHow-tos10 comments – viewed 12,462 times – ( +30 ) – 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 for your model in just 1 line

Created 4 years ago by mintaoTutorials0 comments – viewed 11,731 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

Using SQLite and CDbMessageSource as a module

Created 2 years ago by pheadeauxHow-tos5 comments – viewed 11,176 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.

Simple example for language translation

Created 10 months ago by RKAHow-tos2 comments – viewed 10,495 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

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

Created 2 years ago by c@cbaHow-tos3 comments – viewed 9,837 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 9,095 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.

Entire Messages into javascript object

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

Expert's model generation with Gii

Created 6 months ago by le_topTips0 comments – viewed 3,927 times – ( +3 ) – version 1.1
Efficient coding with Yii implies efficient use of the code generator. This article shares the personalised Gii templates that were built starting from the standard templates proposed by AweGen.

How to provide a fallback or mapping for translation messages?

Created about a year ago by schmunkHow-tos1 comment – viewed 3,778 times – ( +5 ) – version 1.1
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.

I18n / localised routes in Yii

Created 7 months ago by ElecenHow-tos2 comments – viewed 2,067 times – ( +3 / -1 ) – version 1.1
So, you need localised urls made simple that follow the Yii framework guidelines?
tags: i18n, Routing