Using browser langauge as a workaround for IP-based location detection

Often times, users store both their country and language information int heir browser settings, which you can use for both language and localization data. This information is stored in the PHP variable $_SERVER['HTTP_ACCEPT_LANGUAGE'] and looks something like this:

en-US,en;q=0.5

Setting OG and i18n contexts

Out-of-the-box contexts

A major component of localizing content is to be able to set language and other contexts so that your Views, blocks, and other data may be country and language aware.

Out of the box, for a multilingual site you can visit:

/admin/config/regional/language/configure

And for OG you can visit:

/admin/config/group/context (requires OG Context module)

To set the types of context providers you wish to use, along with priorities. IP-detection modules also extend the list of options for multilingual options.

Date Formats and Exposed Filters

Date formatting – the order of day, month, and year – is important to many websites. However, getting date formats working correctly with Views’ exposed filters can take a bit of administrative work.

The following modules should be installed and enabled:

Import content and its translations from CSV (managing entityreference field)

In this page, we will see how to handle an entityreference field in content type 2 referencing a content of content type 1 without having the id of the target, only its title.

And of course in all the languages we want.

Principle

For the main language import, we will be using an entityfieldquery to get the id of the content of content type 1 in the main language.
For the other languages import, we will use the main language import to be sure of the id of the target.

Import content and its translations from CSV

Using migrate-7.x-2.6-RC1.

The main purpose of this cookbook is to show how to import one content type in as many languages as you want using CSV import.

It assumes that you have one csv file per language, that each is in the csv format, and that the content for all its translations are at the same line. It also assumes you're using the Content Translation method of translation, and not entity translation.

Force using "" to avoid problem with language like russian chinese, japanese, arabic, etc...

Pages

Subscribe with RSS Subscribe to RSS - Internationalization