Wiki

Articles tagged with "i18n"X
Displaying 11-20 of 26 result(s).

Multilanguage and SEO friendly

Created about a year ago by InterboyHow-tos1 comment – viewed 16,422 times – ( +5 ) – version 1.1
In your application configuration (protected/config/main.php), set the sourceLanguage parameter to English:

How to provide a fallback or mapping for translation messages?

Created 2 years ago by schmunkHow-tos1 comment – viewed 4,335 times – ( +5 ) – version 1.1
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.

Entire Messages into javascript object

Created 2 years ago by markuxHow-tos0 comments – viewed 5,265 times – ( +2 ) – version 1.1
I needed all messages with their translation into javascript. This is my solution:

Custom Number Formatting or Decimal Separators and i18n

Created 2 years ago by c@cbaTutorials8 comments – viewed 41,044 times – ( +7 ) – 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 SQLite and CDbMessageSource as a module

Created 3 years ago by pheadeauxHow-tos5 comments – viewed 12,145 times – ( +5 ) – version 1.1
There are scenarios when you work with DVCS (like Mercurial or Git) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very time consuming. Plus, when working in a team, you never know when the database was updated.

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

Created 3 years ago by c@cbaHow-tos3 comments – viewed 10,588 times – ( +9 ) – version 1.1
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.

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

Created 3 years ago by c@cbaHow-tos0 comments – viewed 9,830 times – ( +4 ) – version 1.1
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.

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

Created 3 years ago by c@cbaTutorials36 comments – viewed 49,135 times – ( +32 ) – 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 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 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.

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

Created 3 years ago by c@cbaTutorials10 comments – viewed 30,688 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.

Local time zones and locales

Created 4 years ago by Russell EnglandHow-tos9 comments – viewed 58,241 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.