Articles tagged with "i18n", sorted by viewsX
Displaying 1-10 of 22 result(s).

Setting and maintaining the language in Application (i18n)

Created 5 years ago by olafureTutorials11 comments – viewed 73,809 times – ( +23 ) – version 1.1
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
tags: i18n, translation

How to set up Unicode

Created 5 years ago by MikeHow-tos10 comments – viewed 59,605 times – ( +18 ) – version 1.1
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.
tags: i18n, unicode

Local time zones and locales

Created 3 years ago by Russell EnglandHow-tos9 comments – viewed 48,012 times – ( +14 / -2 ) – version 1.1
Following on from international dates, I also wanted times in the local timezone and format. This was a little more tricky but I think I've got a solution. This is only really appropriate if you have an international app.

How to translate and do the translations the easy way

Created 2 years ago by Roman SolomatinHow-tos3 comments – viewed 42,916 times – ( +26 / -2 ) – version 1.1
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.
tags: i18n

How to customize Yii core messages?

Created 5 years ago by qiangTutorials7 comments – viewed 40,218 times – ( +17 ) – version 1.1
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:

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

Created 2 years ago by c@cbaTutorials35 comments – viewed 38,428 times – ( +29 ) – version 1.1
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 in english, and in german. This tutorial describes how to make it happen. Note that currently selected language is always a part of the URL, and thus available to the application through $_GET. You don't have to use sessions variables to keep track of the language if you don't want to.

Custom Number Formatting or Decimal Separators and i18n

Created about a year ago by c@cbaTutorials8 comments – viewed 28,491 times – ( +6 ) – version 1.1
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...

Using International Dates

Created 3 years ago by Russell EnglandHow-tos4 comments – viewed 28,144 times – ( +18 ) – version 1.1
I needed British (dd/mm/yyyy) formatted dates throughout my application but found it very difficult to find examples of how to do this - until I found this excellent forum post

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

Created 2 years ago by c@cbaTutorials10 comments – viewed 25,710 times – ( +15 ) – version 1.1
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 name of the event suggests, this event handler will be called at the beginning of each request, so its a good place to check whether a language is provided (via post, session or cookie) and set the application language accordingly. We also implement a simple Language-Selector Widget, which can render the language options as ajax-links or as a drop-down list.

I18n subdomains and url-rules

Created 4 years ago by Y!!Tutorials6 comments – viewed 21,369 times – ( +7 ) – version 1.1
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 :-)
tags: i18n, URL