From 8ca0ff513b6028d5dd7932075184cb6e775f33d4 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 14 Sep 2017 17:24:10 +1000 Subject: [PATCH] + CMTD::I18N::* --- lib/CMTD.pm | 1 + lib/CMTD/I18N.pm | 9 +++++++++ lib/CMTD/I18N/en.pm | 11 +++++++++++ lib/CMTD/I18N/ru.pm | 21 +++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 lib/CMTD/I18N.pm create mode 100644 lib/CMTD/I18N/en.pm create mode 100644 lib/CMTD/I18N/ru.pm diff --git a/lib/CMTD.pm b/lib/CMTD.pm index dec4aa9..3aa9bb3 100644 --- a/lib/CMTD.pm +++ b/lib/CMTD.pm @@ -10,6 +10,7 @@ sub startup { $self->plugin('CMTD::Helpers'); $self->plugin(Config => {file => 'cmtd.conf'}); + $self->plugin(I18N => {namespace => 'CMTD::I18N', default => 'en'}); if (my $s = $self->app->config->{secret}) { $self->app->secrets([ $s ]); } else { diff --git a/lib/CMTD/I18N.pm b/lib/CMTD/I18N.pm new file mode 100644 index 0000000..878cf70 --- /dev/null +++ b/lib/CMTD/I18N.pm @@ -0,0 +1,9 @@ +package CMTD::I18N; + +use strict; +use warnings; +use utf8; + +use Mojo::Base 'Locale::Maketext'; + +1; diff --git a/lib/CMTD/I18N/en.pm b/lib/CMTD/I18N/en.pm new file mode 100644 index 0000000..d030b1e --- /dev/null +++ b/lib/CMTD/I18N/en.pm @@ -0,0 +1,11 @@ +package CMTD::I18N::en; + +use strict +use warnings; +use utf8; + +use Mojo::Base 'CMTD::I18N'; + +our %Lexicon = ( _AUTO => 1 ); + +1; diff --git a/lib/CMTD/I18N/ru.pm b/lib/CMTD/I18N/ru.pm new file mode 100644 index 0000000..75d0ff4 --- /dev/null +++ b/lib/CMTD/I18N/ru.pm @@ -0,0 +1,21 @@ +package CMTD::I18N::ru; + +use strict; +use warnings; +use utf8; + +use Mojo::Base 'CMTD::I18N'; + +our %Lexicon = ( + _AUTO => 1, # enable fallback + Comments => 'Комментарии', + Name => 'Имя', + Date => 'Дата', + Reply => 'Ответ', + Send => 'Отправить', + Add => 'Добавить', + + 'No comments' => 'Нет комментариев', +); + +1;