From 1ad2ae13866788094fc3c72f297a514adc20725b Mon Sep 17 00:00:00 2001 From: Roman Bahatyi Date: Thu, 13 Apr 2017 17:08:11 +0300 Subject: [PATCH 01/14] Improve saving behavior --- behaviors/TranslateBehavior.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/behaviors/TranslateBehavior.php b/behaviors/TranslateBehavior.php index 0e298a7..2b41fba 100644 --- a/behaviors/TranslateBehavior.php +++ b/behaviors/TranslateBehavior.php @@ -92,7 +92,35 @@ public function saveAttributes($event) $owner = $this->owner; foreach ($this->translateAttributes as $attribute) { if ($owner->isAttributeChanged($attribute)) { - Language::saveMessage($owner->attributes[$attribute], $this->category); + if (Yii::$app->sourceLanguage !== Yii::$app->language) { + $translateSource = LanguageSource::find() + ->where(['message' => $owner->getOldAttribute($attribute)]) + ->one(); + if ($translateSource !== null) { + if (count($translateSource->languageTranslates) > 0) { + foreach ($translateSource->languageTranslates as $translate) { + if ($translate->language === Yii::$app->language) { + $translate->translation = $owner->attributes[$attribute]; + $translate->save(); + break; + } + } + } else { + $translate = new LanguageTranslate(); + $translate->id = $translateSource->id; + $translate->language = Yii::$app->language; + $translate->translation = $owner->attributes[$attribute]; + $translate->save(); + } + + $owner->$attribute = $owner->getOldAttribute($attribute); + $owner->save(); + } else { + Language::saveMessage($owner->attributes[$attribute], $this->category); + } + } else { + Language::saveMessage($owner->attributes[$attribute], $this->category); + } } } } From ba9be5eb2e2f513d5d44b87a846c86a638c5df67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 7 May 2017 11:05:13 +0200 Subject: [PATCH 02/14] Fix TranslateBehavior issues - Fix missing namespaced - Search for source with case sensitive match - Fix language source could be loaded with the wrong category --- behaviors/TranslateBehavior.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/behaviors/TranslateBehavior.php b/behaviors/TranslateBehavior.php index 2b41fba..98f8253 100644 --- a/behaviors/TranslateBehavior.php +++ b/behaviors/TranslateBehavior.php @@ -6,6 +6,8 @@ use yii\db\BaseActiveRecord; use yii\behaviors\AttributeBehavior; use lajax\translatemanager\helpers\Language; +use lajax\translatemanager\models\LanguageSource; +use lajax\translatemanager\models\LanguageTranslate; /** * TranslateManager Database translate behavior. @@ -93,9 +95,19 @@ public function saveAttributes($event) foreach ($this->translateAttributes as $attribute) { if ($owner->isAttributeChanged($attribute)) { if (Yii::$app->sourceLanguage !== Yii::$app->language) { - $translateSource = LanguageSource::find() - ->where(['message' => $owner->getOldAttribute($attribute)]) - ->one(); + // Find the correct source with case sensitive match + $sourceMessages = LanguageSource::findAll([ + 'message' => $owner->getOldAttribute($attribute), + 'category' => $this->category, + ]); + $translateSource = null; + foreach ($sourceMessages as $source) { + if ($source->message === $owner->getOldAttribute($attribute)) { + $translateSource = $source; + break; + } + } + if ($translateSource !== null) { if (count($translateSource->languageTranslates) > 0) { foreach ($translateSource->languageTranslates as $translate) { @@ -114,7 +126,6 @@ public function saveAttributes($event) } $owner->$attribute = $owner->getOldAttribute($attribute); - $owner->save(); } else { Language::saveMessage($owner->attributes[$attribute], $this->category); } From bee6b5753962412f57a8948b3a1070a54b469100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 7 May 2017 13:09:26 +0200 Subject: [PATCH 03/14] Refactor TranslateBehavior --- behaviors/TranslateBehavior.php | 117 +++++++++++++++++++------------- 1 file changed, 71 insertions(+), 46 deletions(-) diff --git a/behaviors/TranslateBehavior.php b/behaviors/TranslateBehavior.php index 98f8253..4f46fd0 100644 --- a/behaviors/TranslateBehavior.php +++ b/behaviors/TranslateBehavior.php @@ -47,6 +47,11 @@ class TranslateBehavior extends AttributeBehavior */ public $category = 'database'; + /** + * @var BaseActiveRecord the owner model of this behavior + */ + public $owner; + /** * @inheritdoc */ @@ -70,68 +75,88 @@ public function events() } /** - * Translates a message to the specified language. + * Translates the attributes to the current language. * * @param \yii\base\Event $event */ public function translateAttributes($event) { - /* @var $owner BaseActiveRecord */ - $owner = $this->owner; foreach ($this->translateAttributes as $attribute) { - $owner->{$attribute} = Yii::t($this->category, $owner->attributes[$attribute]); + $this->owner->{$attribute} = Yii::t($this->category, $this->owner->attributes[$attribute]); } } /** - * Saveing new language element by category. + * Saves new language element by category. * * @param \yii\base\Event $event */ public function saveAttributes($event) { - /* @var $owner BaseActiveRecord */ - $owner = $this->owner; + $isAppInSourceLanguage = Yii::$app->sourceLanguage === Yii::$app->language; + foreach ($this->translateAttributes as $attribute) { - if ($owner->isAttributeChanged($attribute)) { - if (Yii::$app->sourceLanguage !== Yii::$app->language) { - // Find the correct source with case sensitive match - $sourceMessages = LanguageSource::findAll([ - 'message' => $owner->getOldAttribute($attribute), - 'category' => $this->category, - ]); - $translateSource = null; - foreach ($sourceMessages as $source) { - if ($source->message === $owner->getOldAttribute($attribute)) { - $translateSource = $source; - break; - } - } - - if ($translateSource !== null) { - if (count($translateSource->languageTranslates) > 0) { - foreach ($translateSource->languageTranslates as $translate) { - if ($translate->language === Yii::$app->language) { - $translate->translation = $owner->attributes[$attribute]; - $translate->save(); - break; - } - } - } else { - $translate = new LanguageTranslate(); - $translate->id = $translateSource->id; - $translate->language = Yii::$app->language; - $translate->translation = $owner->attributes[$attribute]; - $translate->save(); - } - - $owner->$attribute = $owner->getOldAttribute($attribute); - } else { - Language::saveMessage($owner->attributes[$attribute], $this->category); - } - } else { - Language::saveMessage($owner->attributes[$attribute], $this->category); - } + if (!$this->owner->isAttributeChanged($attribute)) { + continue; + } + + if ($isAppInSourceLanguage || !$this->saveAttributeValueAsTranslation($attribute)) { + Language::saveMessage($this->owner->attributes[$attribute], $this->category); + } + } + } + + /** + * @param string $attribute The name of the attribute. + * + * @return bool Whether the translation is saved. + */ + private function saveAttributeValueAsTranslation($attribute) + { + $sourceMessage = $this->owner->getOldAttribute($attribute); + $translatedMessage = $this->owner->attributes[$attribute]; + + // Restore the original value, so it won't be replaced with the translation in the database. + $this->owner->{$attribute} = $sourceMessage; + + $translateSource = $this->findSourceMessage($sourceMessage); + if (!$translateSource) { + return false; // The source does not exist, the message cannot be saved as translation. + } + + $translation = new LanguageTranslate(); + foreach ($translateSource->languageTranslates as $tmpTranslate) { + if ($tmpTranslate->language === Yii::$app->language) { + $translation = $tmpTranslate; + break; + } + } + + if ($translation->isNewRecord) { + $translation->id = $translateSource->id; + $translation->language = Yii::$app->language; + } + + $translation->translation = $translatedMessage; + $translation->save(); + + return true; + } + + /** + * Finds the source record with case sensitive match. + * + * @param string $message + * + * @return LanguageSource|null Null if the source is not found. + */ + private function findSourceMessage($message) + { + $sourceMessages = LanguageSource::findAll(['message' => $message, 'category' => $this->category]); + + foreach ($sourceMessages as $source) { + if ($source->message === $message) { + return $source; } } } From 9c693eacc15be1352b453b3bd61e86fb61a5aed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 7 May 2017 14:52:25 +0200 Subject: [PATCH 04/14] Update TranslateBehavior documentation --- README.md | 24 +++++++++++++++++------- behaviors/TranslateBehavior.php | 14 +++++++++++++- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8de0c34..7730309 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ A more complex example including database table with multilingual support is bel '\lajax\translatemanager\services\scanners\ScannerJavaScriptFunction', '\lajax\translatemanager\services\scanners\ScannerDatabase', ], - 'googleApiKey' => 'your_google_API_Key', // if set - google translation will be inserted into translation field when you click on the source field. + 'googleApiKey' => 'your_google_API_Key', // if set - google translation will be inserted into translation field when you click on the source field. ], ], ``` @@ -413,7 +413,17 @@ class Category extends \yii\db\ActiveRecord { * With behavior (since 1.5.3): - **Note:** This will replace the model's original attribute values! + This behavior does the following: + - Replaces the specified attributes with translations after the model is loaded. + - Saves the attribute values as: + 1. Source messages, if the current language is the source language. + 2. Translations, if the current language is different from the source language. + This way the value stored in database is not overwritten with the translation. + + **Note**: If the model should be saved as translation, but the source message does not exist yet in the database + then the message is saved as the source message whether the current language is the source language or not. + To avoid this scan the database for existing messages when using the behavior first, and only save new records + when the current language is the source language. ```php namespace common\models; @@ -500,21 +510,21 @@ Use it with the Yii CLI Google translate api is a paid service. At the moment of writing the price is $20 USD per 1 million characters trsanslated. In order to activate the feature you need to have Google account, generate google Api Key, and enable this feature -by adding 'googleApiKey' to 'translatemanager' module configuration: +by adding 'googleApiKey' to 'translatemanager' module configuration: ```php 'modules' => [ 'translatemanager' => [ - + // ... - + 'googleApiKey' => `Your_Google_API_Key', ], ], ``` -Once feature is enabled it will insert google translation of the source into the empty translation field +Once feature is enabled it will insert google translation of the source into the empty translation field (instead of original text) when you click on source field. @@ -537,7 +547,7 @@ Coding style issues can be fixed using the following command: composer cs-fix ``` -You can check the code, without affecting it: +You can check the code, without affecting it: ``` composer cs-fix-dry-run diff --git a/behaviors/TranslateBehavior.php b/behaviors/TranslateBehavior.php index 4f46fd0..7b21310 100644 --- a/behaviors/TranslateBehavior.php +++ b/behaviors/TranslateBehavior.php @@ -10,7 +10,19 @@ use lajax\translatemanager\models\LanguageTranslate; /** - * TranslateManager Database translate behavior. + * Behavior that translates the model attributes, and saves the changes into database. + * + * This behavior does the following: + * - Replaces the specified attributes with translations after the model is loaded. + * - Saves the attribute values as: + * 1. Source messages, if the current language is the source language. + * 2. Translations, if the current language is different from the source language. + * This way the value stored in database is not overwritten with the translation. + * + * **Note**: If the model should be saved as translation, but the source message does not exist yet in the database + * then the message is saved as the source message whether the current language is the source language or not. + * To avoid this scan the database for existing messages when using the behavior first, and only save new records + * when the current language is the source language. * * Installation: * From 752448db623bf91f68c3075a6be97b751e86daf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 7 May 2017 15:38:36 +0200 Subject: [PATCH 05/14] Update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c8631..540d9ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). +## [Unreleased] + +### Changed + - Improve TranslateBehavior saving #99 + The attribute is now saved as translation when the language of the application is different from the source language. + ## [1.7.0] - 2017-04-30 ### Added - Allow to override default scanners via module configuration #87 @@ -72,6 +78,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Fixed - Round error in translation statistic +[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.7.0...HEAD [1.7.0]: https://github.com/lajax/yii2-translate-manager/compare/1.6.0...1.7.0 [1.6.0]: https://github.com/lajax/yii2-translate-manager/compare/1.5.4...1.6.0 [1.5.4]: https://github.com/lajax/yii2-translate-manager/compare/1.5.3...1.5.4 From 8fdf80b83e922005fc741452f90f6de932edc91f Mon Sep 17 00:00:00 2001 From: Tobias Munk Date: Fri, 7 Jul 2017 16:12:05 +0200 Subject: [PATCH 06/14] fixed url creation --- views/language/translate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/language/translate.php b/views/language/translate.php index fa32a7b..54de2ff 100644 --- a/views/language/translate.php +++ b/views/language/translate.php @@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title; ?> - 'language_id', 'data-url' => Yii::$app->urlManager->createAbsoluteUrl('/translatemanager/language/save')]); ?> + 'language_id', 'data-url' => Yii::$app->urlManager->createUrl('/translatemanager/language/save')]); ?>
Date: Mon, 30 Oct 2017 21:52:11 +0100 Subject: [PATCH 07/14] Update package description in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 90a8905..babecec 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "lajax/yii2-translate-manager", - "description": "Online Translate", + "description": "Translation management extension for Yii 2", "type": "yii2-extension", "keywords": ["yii2", "extension", "translate", "language", "module"], "license": "MIT", From 5d7dfad79f26a71e3a0f0b068f09acbf8d7fc400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 25 Mar 2018 12:03:41 +0200 Subject: [PATCH 08/14] Fix changelog --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edb27a8..2eacc91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,11 +87,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Fixed - Round error in translation statistic -<<<<<<< HEAD -[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.7.0...HEAD -======= +[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.7.2...HEAD [1.7.2]: https://github.com/lajax/yii2-translate-manager/compare/1.7.1...1.7.2 ->>>>>>> 1.7 [1.7.1]: https://github.com/lajax/yii2-translate-manager/compare/1.7.0...1.7.1 [1.7.0]: https://github.com/lajax/yii2-translate-manager/compare/1.6.0...1.7.0 [1.6.0]: https://github.com/lajax/yii2-translate-manager/compare/1.5.4...1.6.0 From a30dd362108cd6f336268e5d72eee6c4e7f65849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Wed, 13 Jun 2018 15:27:14 +0200 Subject: [PATCH 09/14] Fix typo in Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e40777..6a07fb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,7 +86,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). - Import/export feature #31 ### Changed - - Autocofus translation textarea in frontend translation dialog #33 + - Autofocus translation textarea in frontend translation dialog #33 ### Fixed - Round error in translation statistic From c1d843df3983589e25a3467457d6489e55e7c786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 25 Aug 2019 22:06:15 +0200 Subject: [PATCH 10/14] Add `onlyCategories` option --- CHANGELOG.md | 3 +++ Module.php | 20 +++++++++++++++++++- README.md | 1 + services/scanners/ScannerFile.php | 10 +++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a07fb6..6e9e82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ## [Unreleased] +### Added + - Add `onlyCategories` option to Module settings #128 + ### Changed - Improve TranslateBehavior saving #99 The attribute is now saved as translation when the language of the application is different from the source language. diff --git a/Module.php b/Module.php index 01dd20e..2138b49 100644 --- a/Module.php +++ b/Module.php @@ -3,6 +3,7 @@ namespace lajax\translatemanager; use Yii; +use yii\base\InvalidConfigException; use yii\web\ForbiddenHttpException; use yii\web\Response; @@ -121,10 +122,15 @@ class Module extends \yii\base\Module public $roles = []; /** - * @var array list of the categories being ignored. + * @var string[] List of the categories being ignored. */ public $ignoredCategories = []; + /** + * @var string[] List of the categories to be scanned. If empty, all categories will be scanned. + */ + public $onlyCategories = []; + /** * @var array directories/files being ignored. */ @@ -286,6 +292,18 @@ class Module extends \yii\base\Module */ public $scanners = []; + /** + * @throws InvalidConfigException + */ + public function init() + { + parent::init(); + + if ($this->onlyCategories && $this->ignoredCategories) { + throw new InvalidConfigException("Please configure either 'ignoredCategories', or 'onlyCategories'!"); + } + } + /** * @inheritdoc */ diff --git a/README.md b/README.md index 24fb5ca..c889899 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ A more complex example including database table with multilingual support is bel 'jsTranslators' => ['lajax.t'], // list of the js function for translating messages. 'patterns' => ['*.js', '*.php'],// list of file extensions that contain language elements. 'ignoredCategories' => ['yii'], // these categories won't be included in the language database. + 'onlyCategories' => ['yii'], // only these categories will be included in the language database (cannot be used together with "ignoredCategories"). 'ignoredItems' => ['config'], // these files will not be processed. 'scanTimeLimit' => null, // increase to prevent "Maximum execution time" errors, if null the default max_execution_time will be used 'searchEmptyCommand' => '!', // the search string to enter in the 'Translation' search field to find not yet translated items, set to null to disable this feature diff --git a/services/scanners/ScannerFile.php b/services/scanners/ScannerFile.php index 83e4867..535d410 100644 --- a/services/scanners/ScannerFile.php +++ b/services/scanners/ScannerFile.php @@ -269,6 +269,14 @@ private function _getRoots() */ protected function isValidCategory($category) { - return !in_array($category, $this->module->ignoredCategories); + if ($this->module->onlyCategories) { + return in_array($category, $this->module->ignoredCategories); + } + + if ($this->module->ignoredCategories) { + return !in_array($category, $this->module->ignoredCategories); + } + + return true; } } From f8f40d9bb3041a9a8bf1cbf254c531f3649a3c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 25 Aug 2019 22:11:06 +0200 Subject: [PATCH 11/14] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9e82a..224b8bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). - Add `onlyCategories` option to Module settings #128 ### Changed - - Improve TranslateBehavior saving #99 + - Improve TranslateBehavior saving #99 The attribute is now saved as translation when the language of the application is different from the source language. ## [1.7.3] - 2018-04-04 From 218f41bf6cdcd455cb188c8bfdbcde71b1dc7ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sun, 25 Aug 2019 22:12:24 +0200 Subject: [PATCH 12/14] Prepare release 1.8.0 --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 224b8bb..34585c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ## [Unreleased] +## [1.8.0] - 2019-08-25 + ### Added - Add `onlyCategories` option to Module settings #128 @@ -94,7 +96,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Fixed - Round error in translation statistic -[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.7.3...HEAD +[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.8.0...HEAD +[1.8.0]: https://github.com/lajax/yii2-translate-manager/compare/1.7.3...1.8.0 [1.7.3]: https://github.com/lajax/yii2-translate-manager/compare/1.7.2...1.7.3 [1.7.2]: https://github.com/lajax/yii2-translate-manager/compare/1.7.1...1.7.2 [1.7.1]: https://github.com/lajax/yii2-translate-manager/compare/1.7.0...1.7.1 From f1fc5e1a8db4001d55a1282c7ac8722a3fa590e0 Mon Sep 17 00:00:00 2001 From: Bjorn Hijmans Date: Sat, 20 Jun 2020 12:35:50 +0200 Subject: [PATCH 13/14] Fix for onlyCategories options broken #135 --- services/scanners/ScannerFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/scanners/ScannerFile.php b/services/scanners/ScannerFile.php index 535d410..083657e 100644 --- a/services/scanners/ScannerFile.php +++ b/services/scanners/ScannerFile.php @@ -270,7 +270,7 @@ private function _getRoots() protected function isValidCategory($category) { if ($this->module->onlyCategories) { - return in_array($category, $this->module->ignoredCategories); + return in_array($category, $this->module->onlyCategories); } if ($this->module->ignoredCategories) { From f37f3f7c5b88392e611b8f82f8a35296773854c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sat, 4 Jul 2020 09:19:38 +0200 Subject: [PATCH 14/14] Prepare release 1.8.1 --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34585c8..e795683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ## [Unreleased] +## [1.8.1] - 2020-07-04 +### Fixed + - Fix `onlyCategories` option not applied correctly #135 (bjornhij) + ## [1.8.0] - 2019-08-25 ### Added - Add `onlyCategories` option to Module settings #128 ### Changed - - Improve TranslateBehavior saving #99 + - Improve TranslateBehavior saving #99 The attribute is now saved as translation when the language of the application is different from the source language. ## [1.7.3] - 2018-04-04 @@ -96,7 +100,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Fixed - Round error in translation statistic -[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.8.0...HEAD +[Unreleased]: https://github.com/lajax/yii2-translate-manager/compare/1.8.1...HEAD +[1.8.1]: https://github.com/lajax/yii2-translate-manager/compare/1.8.0...1.8.1 [1.8.0]: https://github.com/lajax/yii2-translate-manager/compare/1.7.3...1.8.0 [1.7.3]: https://github.com/lajax/yii2-translate-manager/compare/1.7.2...1.7.3 [1.7.2]: https://github.com/lajax/yii2-translate-manager/compare/1.7.1...1.7.2