Skip to content

Commit

Permalink
Set translates for labels of Language model
Browse files Browse the repository at this point in the history
  • Loading branch information
itstructure committed Aug 1, 2020
1 parent eeea2a5 commit 7f45a14
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
14 changes: 1 addition & 13 deletions README.md
Expand Up @@ -40,19 +40,7 @@ Addition module description you can see in my [Personal site](https://pack-devel

Via composer:

`composer require itstructure/yii2-admin-module ~1.8.1`

or in section **require** of composer.json file set the following:

```json
"require": {
"itstructure/yii2-admin-module": "~1.8.1"
}
```

and command `composer install`, if you install yii2 project extensions first,

or command `composer update`, if all yii2 project extensions are already installed.
`composer require itstructure/yii2-admin-module ~1.8.2`

## Usage

Expand Down
3 changes: 3 additions & 0 deletions changelog.md
@@ -1,5 +1,8 @@
### CHANGE LOG:

**1.8.2 August 1, 2020:**
- Set translates for labels of `Language` model.

**1.8.1 June 22, 2020:**
- Modify README syntax.

Expand Down
2 changes: 1 addition & 1 deletion src/messages/ru-RU/main.php
@@ -1,7 +1,7 @@
<?php

return [
'ID' => 'ID',
'ID' => 'Идентификатор',
'Home' => 'Домой',
'Actions' => 'Действия',
'Create' => 'Создать',
Expand Down
15 changes: 8 additions & 7 deletions src/models/Language.php
Expand Up @@ -2,6 +2,7 @@

namespace Itstructure\AdminModule\models;

use Itstructure\AdminModule\Module;
use Itstructure\AdminModule\interfaces\ModelInterface;
use Itstructure\FieldWidgets\interfaces\{LanguageListInterface, LanguageFieldInterface};

Expand Down Expand Up @@ -101,13 +102,13 @@ public function rules()
public function attributeLabels()
{
return [
'id' => 'ID',
'shortName' => 'Short name',
'name' => 'Name',
'locale' => 'Locale',
'default' => 'Default',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'id' => Module::t('main', 'ID'),
'shortName' => Module::t('languages', 'Short name'),
'name' => Module::t('languages', 'Language name'),
'locale' => Module::t('languages', 'Locale'),
'default' => Module::t('languages', 'Set this language as default'),
'created_at' => Module::t('main', 'Created date'),
'updated_at' => Module::t('main', 'Updated date'),
];
}

Expand Down

0 comments on commit 7f45a14

Please sign in to comment.