Showing 1-16 of 16 items.

How to add a DropDown Language Picker (i18n) to the Menu

Created 2 years ago by JQL JQL, updated 2 years ago by JQL JQL. 4 comments

Yii comes with internationalisation (i18n) "out of the box". There are instructions in the manual as to how to configure Yii to use i18n, but little information all in one place on how to fully integrate it into the bootstrap menu. This document attempts to remedy that.

1 0
1
Viewed: 122 146 times
Version: 2.0
Category: How-tos

Getting information from the current locale

Created 8 years ago by CeBe CeBe, updated 8 years ago by CeBe CeBe. 0 comments

Yii 2.0 comes with a formatter component to format dates, numbers, and other values for international users according to their locale. This is very useful for displaying data. When working with incoming data or when using enhanced input methods like the [MaskedInput widget](https://www.yiiframework.com/doc/api/2.0/yii-widgets-maskedinp...

5 0
2
Viewed: 27 477 times
Version: 2.0
Category: How-tos

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

Created 12 years ago by Kartik V Kartik V, updated 11 years ago by Kartik V Kartik V. 12 comments

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.

0 0
51
Viewed: 185 996 times
Version: 2.0
Category: How-tos

How to provide a fallback or mapping for translation messages?

Created 13 years ago by schmunk schmunk, updated 11 years ago by schmunk schmunk. 1 comment

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.

3 0
6
Viewed: 16 163 times
Version: 1.1
Category: How-tos

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

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 3 comments

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.

9 0
9
Viewed: 23 936 times
Version: 1.1
Category: How-tos

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

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 0 comments

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.

4 0
1
Viewed: 23 350 times
Version: 1.1
Category: How-tos

How to set up Unicode

Created 17 years ago by Mike Mike, updated 13 years ago by Roman Solomatin Roman Solomatin. 10 comments

To fix issues with display of special language characters once and for all there's a solution: use Unicode UTF-8 everywhere. If everything is set up to use Unicode, you can use mostly every language in your application.

19 0
14
Viewed: 151 714 times
Version: 1.1
Category: How-tos