Version 0.03
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / lib / Rose / DBx / Object / I18N / Helpers.pm
blob03d9281f8194d100d8751b556e7e8e9dc0e2fef5
1 package Rose::DBx::Object::I18N::Helpers;
3 use strict;
4 use warnings;
6 use Rose::Object::MixIn();
7 our @ISA = qw(Rose::Object::MixIn);
9 __PACKAGE__->export_tag(all => [qw(i18n_language)]);
11 sub i18n_language {
12 my ($self) = @_;
14 my $lang = $ENV{RDBO_I18N_LANG};
16 if (!$lang && $self) {
17 unless ( $self->can('object_class') ) {
18 my $i18n_lang_column = $self->_i18n_lang_column;
19 $lang = $self->$i18n_lang_column;
23 return $lang;
26 =head1 COPYRIGHT & LICENSE
28 Copyright 2008 Viacheslav Tikhanovskii, all rights reserved.
30 This program is free software; you can redistribute it and/or modify it
31 under the same terms as Perl itself.
33 =cut