add translateions

This commit is contained in:
Roland Schneider 2015-11-21 20:36:46 +01:00
parent d1fa7e27cf
commit 07c2d4c36a
20 changed files with 118 additions and 36 deletions

View File

@ -98,10 +98,10 @@ class AdminMenuStructure{
protected function addLoginMainMenu(){ protected function addLoginMainMenu(){
if (Yii::$app->user->isGuest) { if (Yii::$app->user->isGuest) {
$mainMenuItem= ['label' => 'Login', 'url' => ['/site/login']]; $mainMenuItem= ['label' => Yii::t('common/site','Login'), 'url' => ['/site/login']];
} else { } else {
$mainMenuItem= [ $mainMenuItem= [
'label' => 'Kijelentkezés (' . Yii::$app->user->identity->username . ')', 'label' => Yii::t('common/site','Logout') . '(' . Yii::$app->user->identity->username . ')',
'url' => ['/site/logout'], 'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post'] 'linkOptions' => ['data-method' => 'post']
]; ];

View File

@ -55,6 +55,7 @@ class SiteController extends Controller
public function actionIndex() public function actionIndex()
{ {
Yii::$app->security->generatePasswordHash('test');
return $this->render('index'); return $this->render('index');
} }

View File

@ -7,13 +7,13 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\bootstrap\ActiveForm; use yii\bootstrap\ActiveForm;
$this->title = 'Login'; $this->title = Yii::t('common/site' , 'Login');
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="site-login"> <div class="site-login">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<p>Please fill out the following fields to login:</p> <p><?php echo Yii::t('common/site' , 'Please fill out the following fields to login:') ?> </p>
<div class="row"> <div class="row">
<div class="col-lg-5"> <div class="col-lg-5">
@ -26,7 +26,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'rememberMe')->checkbox() ?> <?= $form->field($model, 'rememberMe')->checkbox() ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?> <?= Html::submitButton( Yii::t('common/site' ,'Login'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
</div> </div>
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>

View File

@ -19,6 +19,7 @@ return [
'class' => 'yii\i18n\Formatter', 'class' => 'yii\i18n\Formatter',
'dateFormat' => 'yyyy.MM.dd', 'dateFormat' => 'yyyy.MM.dd',
'datetimeFormat' => 'yyyy.MM.dd HH:mm', 'datetimeFormat' => 'yyyy.MM.dd HH:mm',
'timeFormat' => 'HH:mm',
'locale' => 'hu-Hu', 'locale' => 'hu-Hu',
'timeZone' => 'UTC', 'timeZone' => 'UTC',
'defaultTimeZone' => 'UTC' , 'defaultTimeZone' => 'UTC' ,

View File

@ -17,6 +17,6 @@
* NOTE: this file must be saved in UTF-8 encoding. * NOTE: this file must be saved in UTF-8 encoding.
*/ */
return [ return [
'Close' => 'Nyitás', 'Close' => 'Zárás',
'Open' => 'Zárás', 'Open' => 'Nyitás',
]; ];

View File

@ -0,0 +1,32 @@
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'Logout' => 'Kijelentkezés',
'Forgot password' => 'Elfelejtett jelszó',
'Login' => 'Bejelentkezés',
'Password' => 'Jelszó',
'Please choose your new password:' => 'Kérem válasszon új jelszót:',
'Please fill out the following fields to login:' => 'Kérem töltse ki a következő mezőket a bejelentkezéshez:',
'Please fill out your email. A link to reset password will be sent there.' => 'Kérem adja meg az email címét.Értesítést fog kapni a jelszava megváltoztatásáról!',
'Remember me' => 'Emlékezz rám',
'Request password reset' => 'Jelszó módosítás kérése',
'Reset password' => 'Jelszó módosítása',
'Send' => 'Küldés',
'Username' => 'Felhasználónév/E-mail',
];

View File

@ -17,6 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding. * NOTE: this file must be saved in UTF-8 encoding.
*/ */
return [ return [
'Reception' => 'Recepció',
'Reset' => 'Módosítás',
'Adatlap' => 'Adatlap', 'Adatlap' => 'Adatlap',
'Are you sure you want to delete this item?' => 'Biztosan törölni szeretné ezt a vendéget?', 'Are you sure you want to delete this item?' => 'Biztosan törölni szeretné ezt a vendéget?',
'Befizetések' => 'Befizetések', 'Befizetések' => 'Befizetések',
@ -24,7 +26,6 @@ return [
'Create Customer' => 'Új vendég', 'Create Customer' => 'Új vendég',
'Customers' => 'Vendégek', 'Customers' => 'Vendégek',
'Delete' => 'Törlés', 'Delete' => 'Törlés',
'Reset' => '',
'Search' => 'Keresés', 'Search' => 'Keresés',
'Update' => 'Módosítás', 'Update' => 'Módosítás',
]; ];

View File

@ -17,8 +17,9 @@
* NOTE: this file must be saved in UTF-8 encoding. * NOTE: this file must be saved in UTF-8 encoding.
*/ */
return [ return [
'Money movements' => 'Pénzmozgások',
'Account' => 'Kassza', 'Account' => 'Kassza',
'User' => 'Felhasználó',
'End' => 'Időintervallum vége', 'End' => 'Időintervallum vége',
'Start' => 'Időintervallum kezdete', 'Start' => 'Időintervallum kezdete',
'User' => 'Felhasználó',
]; ];

View File

@ -0,0 +1,22 @@
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'Login' => 'Bejelentkezés',
'Password' => 'Jelszó',
];

View File

@ -17,6 +17,7 @@
* NOTE: this file must be saved in UTF-8 encoding. * NOTE: this file must be saved in UTF-8 encoding.
*/ */
return [ return [
'Logout' => 'Kijelentkezés',
'Create' => 'Mentés', 'Create' => 'Mentés',
'Create Money Movement' => 'Új pénzmozgás', 'Create Money Movement' => 'Új pénzmozgás',
'Create Transfer' => 'Új pénzmozgás', 'Create Transfer' => 'Új pénzmozgás',

View File

@ -205,7 +205,7 @@ class AccountState extends \common\models\BaseFitnessActiveRecord
public function hasDifferenceToPrevState(){ public function hasDifferenceToPrevState(){
$result = false; $result = false;
if ( isset( $this->prev_state ) ){ if ( isset( $this->prev_state ) && $this->type == self::TYPE_OPEN){
$result = $this->prev_money != $this->money; $result = $this->prev_money != $this->money;
} }
return $result; return $result;

View File

@ -31,6 +31,14 @@ class LoginForm extends Model
]; ];
} }
public function attributeLabels(){
return [
'username' =>Yii::t('common/site', 'Username'),
'password' =>Yii::t('common/site', 'Password'),
'rememberMe' =>Yii::t('common/site', 'Remember me'),
];
}
/** /**
* Validates the password. * Validates the password.
* This method serves as the inline validation for password. * This method serves as the inline validation for password.

View File

@ -378,7 +378,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord
'money', 'money',
'money_currency', 'money_currency',
'time' => function ($transfer){ 'time' => function ($transfer){
return Yii::$app->formatter->asTime($transfer->created_at); return Yii::$app->formatter->asDatetime($transfer->created_at);
}, },
'account_name' => function ($transfer) { 'account_name' => function ($transfer) {
return $transfer->account->name; return $transfer->account->name;

View File

@ -11,6 +11,8 @@ return [
'mailer' => [ 'mailer' => [
'class' => 'yii\swiftmailer\Mailer', 'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail', 'viewPath' => '@common/mail',
'fileTransport' => true,
'transport' =>[]
], ],
], ],
]; ];

View File

@ -56,16 +56,16 @@ class FrontendMenuStructure{
protected function addRecepcio(){ protected function addRecepcio(){
if ( $this->isLogged() ){ if ( $this->isLogged() ){
$this->menuItems[] = ['label' => 'Recepció', 'url' => ['/customer/reception'] ]; $this->menuItems[] = ['label' => Yii::t('frontend/customer','Reception'), 'url' => ['/customer/reception'] ];
$this->menuItems[] = ['label' => 'Kassza', $this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
'items' => [ 'items' => [
['label' => Yii::t('frontend/account-state','Default account'), 'url' => ['/account/select'] ], ['label' => Yii::t('frontend/account-state','Default account'), 'url' => ['/account/select'] ],
['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index'] ], ['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index'] ],
['label' => Yii::t('frontend/account-state','Open account state'), 'url' => ['/account-state/open'] ], ['label' => Yii::t('frontend/account-state','Open account state'), 'url' => ['/account-state/open'] ],
['label' => Yii::t('frontend/account-state','Close account state'), 'url' => ['/account-state/close'] ], ['label' => Yii::t('frontend/account-state','Close account state'), 'url' => ['/account-state/close'] ],
['label' => 'Pénzmozgások', 'url' => [ '/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow ] ], ['label' => Yii::t('frontend/money-movement','Money movements'), 'url' => [ '/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow ] ],
['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ], ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ],
['label' => 'Zárások', 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ] ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ]
] ]
]; ];
} }
@ -74,10 +74,10 @@ class FrontendMenuStructure{
protected function addLoginMainMenu(){ protected function addLoginMainMenu(){
if (Yii::$app->user->isGuest) { if (Yii::$app->user->isGuest) {
$mainMenuItem= ['label' => 'Login', 'url' => ['/site/login']]; $mainMenuItem= ['label' => Yii::t('frontend/site','Login'), 'url' => ['/site/login']];
} else { } else {
$mainMenuItem= [ $mainMenuItem= [
'label' => 'Kijelentkezés (' . Yii::$app->user->identity->username . ')', 'label' => Yii::t('frontend/transfer','Logout'). '(' . Yii::$app->user->identity->username . ')',
'url' => ['/site/logout'], 'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post'] 'linkOptions' => ['data-method' => 'post']
]; ];

View File

@ -49,6 +49,12 @@ class ResetPasswordForm extends Model
]; ];
} }
public function attributeLabels(){
return [
'passowrd' => Yii::t('frontend/site' , 'Password')
];
}
/** /**
* Resets password. * Resets password.
* *

View File

@ -1,16 +1,11 @@
<?php <?php
use frontend\components\ReceptionMenuWidget;
use frontend\components\ReceptionCardNumberWidget;
use yii\helpers\Html;
use common\models\Product;
use frontend\assets\ProductSellAsset;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Discount;
use frontend\components\ReceptionWidget;
use common\models\Account; use common\models\Account;
use common\models\Discount;
use frontend\assets\ProductSellAsset;
use frontend\components\ReceptionWidget;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */ /* @var $form yii\bootstrap\ActiveForm */
@ -67,7 +62,19 @@ $this->params['breadcrumbs'][] = Yii::t('frontend/product', 'Sale');
.table-transfers tbody .product-name, .table-transfers tbody .product-name,
.table-transfers tbody .product-time .table-transfers tbody .product-time
{ {
text-align: center; text-align: left;
}
.table-transfers .product-time{
width: 140px;
}
.table-transfers .product-count{
width: 50px;
}
.table-transfers .sale-price{
width: 80px;
}
.table-transfers .product-money{
width: 100px;
} }
</style> </style>

View File

@ -7,7 +7,7 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\bootstrap\ActiveForm; use yii\bootstrap\ActiveForm;
$this->title = 'Login'; $this->title = Yii::t('common/site' ,'Login');
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="site-login"> <div class="site-login">
@ -26,11 +26,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'rememberMe')->checkbox() ?> <?= $form->field($model, 'rememberMe')->checkbox() ?>
<div style="color:#999;margin:1em 0"> <div style="color:#999;margin:1em 0">
If you forgot your password you can <?= Html::a('reset it', ['site/request-password-reset']) ?>. <?= Html::a(Yii::t('common/site' ,'Forgot password'), ['site/request-password-reset']) ?>.
</div> </div>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?> <?= Html::submitButton(Yii::t('common/site' ,'Login'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
</div> </div>
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>

View File

@ -7,13 +7,13 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\bootstrap\ActiveForm; use yii\bootstrap\ActiveForm;
$this->title = 'Request password reset'; $this->title = Yii::t('common/site' ,'Request password reset');
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="site-request-password-reset"> <div class="site-request-password-reset">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<p>Please fill out your email. A link to reset password will be sent there.</p> <p><?php echo Yii::t('common/site' ,'Please fill out your email. A link to reset password will be sent there.') ?></p>
<div class="row"> <div class="row">
<div class="col-lg-5"> <div class="col-lg-5">
@ -22,7 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'email') ?> <?= $form->field($model, 'email') ?>
<div class="form-group"> <div class="form-group">
<?= Html::submitButton('Send', ['class' => 'btn btn-primary']) ?> <?= Html::submitButton( Yii::t('common/site' ,'Send'), ['class' => 'btn btn-primary']) ?>
</div> </div>
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>

View File

@ -7,13 +7,13 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\bootstrap\ActiveForm; use yii\bootstrap\ActiveForm;
$this->title = 'Reset password'; $this->title = Yii::t('common/site' ,'Reset password');
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
?> ?>
<div class="site-reset-password"> <div class="site-reset-password">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<p>Please choose your new password:</p> <p><?php echo Yii::t('common/site' ,'Please choose your new password:') ?></p>
<div class="row"> <div class="row">
<div class="col-lg-5"> <div class="col-lg-5">