From 0d556e295ba5fcd9b7e5fa5bf59e56088faca4f9 Mon Sep 17 00:00:00 2001 From: stes Date: Mon, 7 May 2018 22:32:50 +0300 Subject: [PATCH] translations --- common/config/main.php | 12 ------------ common/messages/en/app.php | 4 ++++ common/messages/ru/app.php | 17 +++++++++++++++++ common/messages/ua/app.php | 18 ++++++++++++++++++ frontend/config/main.php | 19 +++++++++---------- frontend/views/layouts/main.php | 35 ++++++++--------------------------- frontend/views/site/contact.php | 19 ++++--------------- 7 files changed, 60 insertions(+), 64 deletions(-) create mode 100644 common/messages/en/app.php create mode 100644 common/messages/ru/app.php create mode 100644 common/messages/ua/app.php diff --git a/common/config/main.php b/common/config/main.php index bd93636..756f265 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -35,22 +35,10 @@ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@artbox/core/messages', ], - 'catalog' => [ - 'class' => 'yii\i18n\PhpMessageSource', - 'basePath' => '@artbox/catalog/messages', - ], 'app' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@common/messages', ], - 'blog' => [ - 'class' => 'yii\i18n\PhpMessageSource', - 'basePath' => '@artbox/weblog/messages', - ], - 'order' => [ - 'class' => 'yii\i18n\PhpMessageSource', - 'basePath' => '@artbox/order/messages', - ], ], ], 'filedb' => [ diff --git a/common/messages/en/app.php b/common/messages/en/app.php new file mode 100644 index 0000000..1e66061 --- /dev/null +++ b/common/messages/en/app.php @@ -0,0 +1,4 @@ + 'Read more' +]; \ No newline at end of file diff --git a/common/messages/ru/app.php b/common/messages/ru/app.php new file mode 100644 index 0000000..c4d2b3f --- /dev/null +++ b/common/messages/ru/app.php @@ -0,0 +1,17 @@ + 'Главная', + 'Contacts' => 'Контакты', + 'About' => 'О нас', + 'Blog' => 'Блог', + 'Events' => 'Мероприятия', + 'Name' => 'Имя', + 'Phone' => 'Телефон', + 'Message' => 'Сообщения', + 'You question' => 'Ваш вопрос', + 'Send' => 'Отправить', + 'Contact us!' => 'Свяжитесь с нами', + 'Go to contact page' => 'Перейти на страницу контактов', + 'Send message' => 'Отправить сообщение', + 'Contact form' => "Форма для связи" +]; \ No newline at end of file diff --git a/common/messages/ua/app.php b/common/messages/ua/app.php new file mode 100644 index 0000000..d789275 --- /dev/null +++ b/common/messages/ua/app.php @@ -0,0 +1,18 @@ + 'Головна', + 'Contacts' => 'Контакти', + 'About' => 'Про нас', + 'Blog' => 'Блог', + 'Events' => 'Заходи', + 'Name' => 'Ім\'я', + 'Phone' => 'Телефон', + 'Message' => 'Повідомленя', + 'You question' => 'Ваше питання', + 'Send' => 'Відправити', + 'Contact us!' => 'Зв\'яжіться з нами', + 'Go to contact page' => 'Перейти до сторінки контактів', + 'Читать далее' => 'Читати далі', + "Send message" => 'Надіслати повідомлення', + "Contact form" => 'Форма для зв\'язку' +]; \ No newline at end of file diff --git a/frontend/config/main.php b/frontend/config/main.php index c7cbf0d..ac73461 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -1,7 +1,6 @@ [ - 'email' => 'Email', - 'name' => 'Name', - 'message' => 'You question', + 'email' => \Yii::t('app','Email'), + 'name' => \Yii::t('app','Name'), + 'message' => \Yii::t('app','You question'), ], 'inputOptions' => [ 'message' => [ @@ -56,7 +55,7 @@ 'options' => [], ], ], - 'buttonContent' => 'Send', + 'buttonContent' => \Yii::t('app','Send'), 'scenario' => 'feedback', 'sendEmail' => false, 'formId' => 'feedback-form', @@ -97,10 +96,10 @@ ] ], 'labels' => [ - 'email' => 'Email', - 'name' => 'Name', - 'message' => 'Message', - 'phone' => 'Phone' + 'email' => \Yii::t('app','Email'), + 'name' => \Yii::t('app', 'Name'), + 'message' => \Yii::t('app','Message'), + 'phone' => \Yii::t('app','Phone') ], 'inputOptions' => [ @@ -123,7 +122,7 @@ 'buttonOptions' => [ 'class' => 'btn btn-template-main', ], - 'buttonContent' => ' Send message', + 'buttonContent' => '' .\Yii::t('app','Send message'), 'sendEmail' => false, 'ajax' => true, 'formId' => 'contact-form', diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index eb36959..797f37d 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -238,7 +238,8 @@ _________________________________________________________ --> ); } ?> - language); ?> + language); + ?>
]; } $items[] = [ - 'label' => \Yii::t('app', 'Contatcs'), + 'label' => \Yii::t('app', 'Contacts'), 'url' => [ 'site/contact' ], ]; $items[] = [ @@ -449,43 +450,23 @@ _________________________________________________________ --> - Contact us! +
-

+

office)) { - echo \Yii::t( - 'app', - 'Office {office}', - [ - 'office' => $settings->office, - ] - ) . Html::tag('br'); - } - if (!empty($settings->street)) { - echo $settings->street; - if (!empty($settings->house)) { - echo " " . $settings->house; - } - echo Html::tag('br'); - } - if (!empty($settings->city)) { - echo $settings->city; - echo Html::tag('br'); - } - if (!empty($settings->country)) { - echo Html::tag('strong', $settings->country); + if (!empty($settings->lang->address)) { + echo Html::tag('strong', $settings->lang->address); } ?>

'btn btn-small btn-template-transparent-primary', diff --git a/frontend/views/site/contact.php b/frontend/views/site/contact.php index 035520c..37d119b 100755 --- a/frontend/views/site/contact.php +++ b/frontend/views/site/contact.php @@ -10,13 +10,12 @@ use common\models\Settings; use frontend\assets\MapAsset; use yii\helpers\Html; - use yii\bootstrap\ActiveForm; use yii\web\View; MapAsset::register($this); $settings = Settings::getInstance(); - $this->title = \Yii::t('app', 'Contact'); + $this->title = \Yii::t('app', 'Contacts'); $this->params[ 'breadcrumbs' ][] = $this->title; $js = <<< JS @@ -59,18 +58,8 @@ JS;

Address

street )) { - echo $settings->street; - if (!empty( $settings->house )) { - echo " " . $settings->house; - } - echo Html::tag('br'); - } - if (!empty( $settings->city )) { - echo $settings->city; - if (!empty( $settings->country )) { - echo Html::tag('strong', ", " . $settings->country); - } + if (!empty( $settings->lang->address )) { + echo $settings->lang->address; } ?>

@@ -138,7 +127,7 @@ JS;
-

Contact form

+

-- libgit2 0.21.4