DESCRIPTION

This module allows you to define columns that will store multiple values asociated to a language string and use it as normal columns. This is useful when you need to internationalize attributes of your DB entities.

This component will create a new resultset on your schema for each one that use it. The auto-created resultset will use the columns definition you give to add_i18n_columns() plus a FK and language columns. The i18n values of each language will reside in a row of this resultset and will transparently work as any other column as long as you provide a language to your row or resultset methods as you can see at the synopsis.

Language will be propagated to relationships with result sources that also use this component.

METHODS

add_i18n_columns

Create internationalizable columns. The columns are created in the same way you do with in add_columns.

auto_i18n_rs

By default, this component will autocreate the result class that will be used to store internationalized values. You can overwrite this method to stop this component doing this and then you must create it manually.

In your result class that use this component:

sub auto_i18n_rs { 0 }

i18n_rows

A has_many relationship to the i18n resultset will be added to your RS if auto_i18n_rs is allowed.

languages

Returns an array of available languages.

has_language

Check for a given language to be present on the row.

language_column

The name for the language column to be used and autocreated. Defaults on 'language'.

foreign_column

The name for the column to store the PK of the internationalized result class. Defaults on id_[table name of result source]

has_any_column

Returns true if the source has a i18n or regular column of this name, false otherwise.

has_i18n_column

Returns true if the source has a i18n column of this name, false otherwise.

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.