Showing 1-20 of 29 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 245 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 492 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: 186 023 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 179 times
Version: 1.1
Category: How-tos

Custom Number Formatting or Decimal Separators and i18n

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

By default, the decimal separator in php (also in mysql) is a dot (.). So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot. If we want to use for example a comma (,) as the decimal separator, that is if we want to display numbers and enable users to enter numbers with a comma before the decimals, we have to...

4 0
16
Viewed: 95 041 times
Version: 1.1
Category: Tutorials

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 956 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 366 times
Version: 1.1
Category: How-tos