Wiki articles tagged with "i18n"

Showing 1-20 of 28 items.
Created 6 months ago by CeBe, updated 6 months ago by CeBe.

Getting information from the current locale

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 followers
Viewed: 3 546 times
Version: 2.0
Category: How-tos
Created 3 years ago by Programmer Thailand, updated 3 years ago by Programmer Thailand.

Language Selector

common\components\LanguageSelector.php

<?php
namespace common\components;

0 0
5 followers
Viewed: 9 186 times
Version: 2.0
Category: Tutorials
Created 3 years ago by phunsanit, updated 3 years ago by phunsanit.

YII2 : simple language Switcher Widget

  1. create file common\components\languageSwitcher.php
1 0
5 followers
Viewed: 18 562 times
Version: 2.0
Category: Tutorials
Created 4 years ago by le_top, updated 4 years ago by le_top.

Selecting best language based on Browser language and available languages.

Your application is international and you have to select the best language for the user. Your user may have selected 'fr_CA' and you have 'fr_FR' or 'fr' available. What do you do? Here is a tip.

2 0
2 followers
Viewed: 8 364 times
Version: 1.1
Category: Tips
Created 4 years ago by le_top, updated 4 years ago by le_top.

CJuiDatePicker extended for more/better language support

The number of languages supported by the standard CJuiDatePicker implementation is limited and the language code to use is different from the application's language code. This Wiki shows how to improve on that.

1 0
1 follower
Viewed: 6 694 times
Version: 1.1
Category: How-tos
Created 4 years ago by le_top, updated 4 years ago by le_top.

Themed translations (i18n)

When using themes you want to changes some of the translations specifically to the theme while keeping the standard translations for most of the text. Duplicating the main translation file is a headache for maintainance. This how to provides a solution.

1 0
1 follower
Viewed: 6 706 times
Version: 1.1
Category: How-tos
Created 4 years ago by Maug Lee, updated 4 years ago by Maug Lee.

Gettext and Poedit HOWTO

Example settings when using Gettext for i18n.

0 0
2 followers
Viewed: 8 724 times
Version: 1.1
Category: Tutorials
Created 4 years ago by le_top, updated 4 years ago by le_top.

Expert's model generation with Gii

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.

1 0
2 followers
Viewed: 11 298 times
Version: 1.1
Category: Tips
1 0
5 followers
Viewed: 7 025 times
Version: 1.1
Category: How-tos
Tags: i18n, Routing
Created 4 years ago by Anas AbuDayah, updated 4 years ago by Anas AbuDayah.

Create URL to language switcher anchor with langhandler

This topic is related with langhandler extension

1 1
2 followers
Viewed: 6 648 times
Version: 1.1
Category: Tips
Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

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

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 followers
Viewed: 138 208 times
Version: 2.0
Category: How-tos
Created 4 years ago by RKA, updated 4 years ago by CeBe.

Simple example for language translation

Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.

1 0
5 followers
Viewed: 27 314 times
Version: 1.1
Category: How-tos
Tags: i18n, Yii
Created 5 years ago by Interboy, updated 4 years ago by Rohit Suthar.

Multilanguage and SEO friendly

In your application configuration (protected/config/main.php), set the sourceLanguage parameter to English:

4 0
9 followers
Viewed: 24 635 times
Version: 1.1
Category: How-tos
Created 5 years ago by schmunk, updated 4 years ago by schmunk.

How to provide a fallback or mapping for translation messages?

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 followers
Viewed: 7 820 times
Version: 1.1
Category: How-tos
Created 6 years ago by markux, updated 6 years ago by markux.

Entire Messages into javascript object

I needed all messages with their translation into javascript. This is my solution:

1 0
3 followers
Viewed: 7 678 times
Version: 1.1
Category: How-tos
Created 6 years ago by c@cba, updated 6 years ago by c@cba.

Custom Number Formatting or Decimal Separators and i18n

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
17 followers
Viewed: 64 515 times
Version: 1.1
Category: Tutorials
Created 6 years ago by pheadeaux, updated 6 years ago by pheadeaux.

Using SQLite and CDbMessageSource as a module

There are scenarios when you work with DVCS (like [Mercurial]( http://mercurial.selenic.com/) or [Git]( http://git-scm.com/)) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very...

3 0
9 followers
Viewed: 17 428 times
Version: 1.1
Category: How-tos
Created 6 years ago by c@cba, updated 6 years ago by c@cba.

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

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 followers
Viewed: 14 788 times
Version: 1.1
Category: How-tos
Created 7 years ago by c@cba, updated 6 years ago by c@cba.

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

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 follower
Viewed: 13 948 times
Version: 1.1
Category: How-tos
Created 7 years ago by c@cba, updated 7 years ago by c@cba.

SEO-conform Multilingual URLs + Language Selector Widget (i18n)

You have a multilingual application, and you want the URL of a page to be different for different languages, to account for SEO. The URL for the contact page for example should look like http://something.com/en/contact in english, and http://something.com/de/contact in german. This tutorial describes how to make it happen.
Note that currently selected language is always a part...

28 0
43 followers
Viewed: 63 913 times
Version: 1.1
Category: Tutorials