Wiki articles tagged with "i18n"

Showing 1-20 of 28 items.

i18n for your model in just 1 line

Created 9 years ago by mintao, updated 8 years ago by Orteko.

A simple trick to get the localized version of a model field is to add this little method to your models.

12 0
9 followers
Viewed: 15 496 times
Version: 1.1
Category: Tutorials
Tags: i18n

I18n subdomains and url-rules

Created 9 years ago by Y!!, updated 8 years ago by atrandafir.

This guide is for more or less advanced users. If you just started with Yii or didn't worked with any web-framework before, you may should come back later :-)

7 0
17 followers
Viewed: 34 495 times
Version: 1.1
Category: Tutorials
Tags: i18n, URL

Local time zones and locales

Created 8 years ago by Russell England, updated 8 years ago by Russell England.

The sql 'set time_zone' ensures that all dates retrieved are in UTC time. If your MySql server has the time zone names installed then use 'UTC' instead of '+00:00'.

Components

Copy the code at the end of this wiki for LocalTime.php and DefaultDateTimeParser.php int...

13 2
24 followers
Viewed: 82 019 times
Version: 1.1
Category: How-tos

Manage (Target) Language in Multilingual Applications + A Language Selector Widget (i18n)

Created 7 years ago by c@cba, updated 7 years ago by c@cba.

In case of a multilingual application, one might consider it a reasonable approach to store the preferred language of the user in a session variable, and after that, every time a page is requested, to check this session variable and render the page in the indicated language. This tutorial shows a Yii-way of doing this.
We implement an event handler for the onBeginRequest event; as the nam...

9 0
19 followers
Viewed: 43 002 times
Version: 1.1
Category: Tutorials

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

Created 7 years ago by c@cba, updated 7 years ago by c@cba.

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
42 followers
Viewed: 65 316 times
Version: 1.1
Category: Tutorials

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

Created 7 years ago by c@cba, updated 7 years ago by c@cba.

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: 14 265 times
Version: 1.1
Category: How-tos

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

Created 7 years ago by c@cba, updated 7 years ago by c@cba.

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: 15 100 times
Version: 1.1
Category: How-tos

Using SQLite and CDbMessageSource as a module

Created 6 years ago by pheadeaux, updated 6 years ago by pheadeaux.

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

How to customize Yii core messages?

Created 10 years ago by qiang, updated 6 years ago by Yang He.

Yii core messages refer to static text strings in the core Yii framework code which are meant to be displayed to end-users (e.g. core exception messages, default validation error messages). Customization of these core messages is needed in two circumstances:

17 0
17 followers
Viewed: 57 918 times
Version: 1.1
Category: Tutorials

Setting and maintaining the language in Application (i18n)

Created 10 years ago by olafure, updated 6 years ago by Yang He.

As seen in this post, Yii doesn't enforce how language is set and maintained within the session.

18 0
29 followers
Viewed: 112 409 times
Version: 1.1
Category: Tutorials

Custom Number Formatting or Decimal Separators and i18n

Created 6 years ago by c@cba, updated 6 years ago by c@cba.

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: 65 988 times
Version: 1.1
Category: Tutorials

Entire Messages into javascript object

Created 6 years ago by markux, updated 6 years ago by markux.

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

1 0
3 followers
Viewed: 7 815 times
Version: 1.1
Category: How-tos

Using International Dates

Created 8 years ago by Russell England, updated 6 years ago by nkd.

So here is my complete solution - note that I'm using the 'short' date format throughout.

15 0
24 followers
Viewed: 42 335 times
Version: 1.1
Category: How-tos

How to set up Unicode

Created 10 years ago by Mike, updated 6 years ago by Roman Solomatin.

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
13 followers
Viewed: 107 848 times
Version: 1.1
Category: How-tos
Tags: i18n, unicode

Simple example for language translation

Created 5 years ago by RKA, updated 5 years ago by CeBe.

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 944 times
Version: 1.1
Category: How-tos
Tags: i18n, Yii

Create URL to language switcher anchor with langhandler

Created 5 years ago by Anas AbuDayah, updated 5 years ago by Anas AbuDayah.

This topic is related with langhandler extension

1 1
2 followers
Viewed: 7 217 times
Version: 1.1
Category: Tips
1 0
5 followers
Viewed: 7 191 times
Version: 1.1
Category: How-tos
Tags: i18n, Routing

Expert's model generation with Gii

Created 4 years ago by le_top, updated 4 years ago by le_top.

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 996 times
Version: 1.1
Category: Tips

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

Created 5 years ago by Kartik V, updated 4 years ago by Kartik V.

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: 141 285 times
Version: 2.0
Category: How-tos

Gettext and Poedit HOWTO

Created 4 years ago by Maug Lee, updated 4 years ago by Maug Lee.

Example settings when using Gettext for i18n.

0 0
2 followers
Viewed: 8 980 times
Version: 1.1
Category: Tutorials