Browse Source

Added configuration for headers in PHP files generated by `message/extract` command (#14417)

tags/2.0.13
Robert Korulczyk 7 years ago committed by Alexander Makarov
parent
commit
d2781cd232
  1. 2
      .php_cs
  2. 4
      docs/internals-es/translation-workflow.md
  3. 4
      docs/internals-ja/translation-workflow.md
  4. 4
      docs/internals-pl/translation-workflow.md
  5. 6
      docs/internals-pt-BR/translation-workflow.md
  6. 2
      docs/internals-ru/translation-workflow.md
  7. 6
      docs/internals-sr-Latn/translation-workflow.md
  8. 4
      docs/internals-uk/translation-workflow.md
  9. 4
      docs/internals-uz/translation-workflow.md
  10. 4
      docs/internals/translation-workflow.md
  11. 1
      framework/CHANGELOG.md
  12. 181
      framework/console/controllers/MessageController.php
  13. 11
      framework/console/widgets/Table.php
  14. 8
      framework/messages/ar/yii.php
  15. 8
      framework/messages/az/yii.php
  16. 8
      framework/messages/bg/yii.php
  17. 8
      framework/messages/bs/yii.php
  18. 8
      framework/messages/ca/yii.php
  19. 12
      framework/messages/config.php
  20. 8
      framework/messages/cs/yii.php
  21. 8
      framework/messages/da/yii.php
  22. 6
      framework/messages/de/yii.php
  23. 6
      framework/messages/el/yii.php
  24. 6
      framework/messages/es/yii.php
  25. 8
      framework/messages/et/yii.php
  26. 6
      framework/messages/fa/yii.php
  27. 6
      framework/messages/fi/yii.php
  28. 8
      framework/messages/fr/yii.php
  29. 8
      framework/messages/he/yii.php
  30. 8
      framework/messages/hr/yii.php
  31. 8
      framework/messages/hu/yii.php
  32. 8
      framework/messages/id/yii.php
  33. 6
      framework/messages/it/yii.php
  34. 6
      framework/messages/ja/yii.php
  35. 8
      framework/messages/ka/yii.php
  36. 8
      framework/messages/kk/yii.php
  37. 8
      framework/messages/ko/yii.php
  38. 8
      framework/messages/lt/yii.php
  39. 22
      framework/messages/lv/yii.php
  40. 41
      framework/messages/ms/yii.php
  41. 8
      framework/messages/nb-NO/yii.php
  42. 8
      framework/messages/nl/yii.php
  43. 13
      framework/messages/pl/yii.php
  44. 8
      framework/messages/pt-BR/yii.php
  45. 8
      framework/messages/pt/yii.php
  46. 8
      framework/messages/ro/yii.php
  47. 6
      framework/messages/ru/yii.php
  48. 6
      framework/messages/sk/yii.php
  49. 8
      framework/messages/sl/yii.php
  50. 10
      framework/messages/sr-Latn/yii.php
  51. 10
      framework/messages/sr/yii.php
  52. 8
      framework/messages/sv/yii.php
  53. 6
      framework/messages/tg/yii.php
  54. 6
      framework/messages/th/yii.php
  55. 6
      framework/messages/tr/yii.php
  56. 8
      framework/messages/uk/yii.php
  57. 8
      framework/messages/uz/yii.php
  58. 8
      framework/messages/vi/yii.php
  59. 8
      framework/messages/zh-CN/yii.php
  60. 8
      framework/messages/zh-TW/yii.php
  61. 6
      framework/views/messageConfig.php
  62. 4
      tests/framework/behaviors/SluggableBehaviorTest.php
  63. 30
      tests/framework/console/controllers/PHPMessageControllerTest.php
  64. 1
      tests/framework/db/ActiveRecordTest.php
  65. 4
      tests/framework/validators/ExistValidatorTest.php

2
.php_cs

@ -24,6 +24,4 @@ return yii\cs\YiisoftConfig::create()
->notPath('framework/classes.php')
->notPath('framework/helpers/mimeTypes.php')
->notPath('framework/views/messageConfig.php')
// temporary disable messages processing - conflicts with header fixer
->exclude('framework/messages')
);

4
docs/internals-es/translation-workflow.md

@ -14,11 +14,11 @@ El orden para comenzar con la traducción de mensajes:
1. Comprobar que en `framework/messages/config.php` su idioma aparece en `languages`. Si no, añade tu idioma allí (recuerda que debes mantener la lista en orden alfabético).
El formato de código de idioma debe seguir el [Código de Idiomas IETF](http://es.wikipedia.org/wiki/C%C3%B3digo_de_idioma_IETF), por ejemplo, `es`.
2. Ir al directorio `framework` y ejecutar el comando `yii message/extract messages/config.php`.
2. Ir al directorio `framework` y ejecutar el comando `yii message/extract @yii/messages/config.php --languages=<tu-idioma>`.
3. Traducir los mensajes en `framework/messages/tu-idioma/yii.php`. Asegúrate de guardar el archivo con codificación UTF-8.
4. [Crear un pull request](https://github.com/yiisoft/yii2/blob/master/docs/internals-es/git-workflow.md).
Con el fin de mantener la traducción al día puedes ejecutar `yii message/extract messages/config.php` nuevamente.
Con el fin de mantener la traducción al día puedes ejecutar `yii message/extract @yii/messages/config.php --languages=<tu-idioma>` nuevamente.
Se volverán a extraer automáticamente los mensajes de mantenimiento intactos sin los cambios.
En el archivo de traducción de cada elemento del `array` representa un mensaje (clave) y su la traducción (valor). Si el valor está vacío, el mensaje se considera como no traducido.

4
docs/internals-ja/translation-workflow.md

@ -15,11 +15,11 @@ Yii は国際的なアプリケーションと開発者にとって役に立つ
1. `framework/messages/config.php` をチェックして、あなたの言語が `languages` のリストに載っていることを確認してください。
もし無ければ、あなたの言語をそこに追加します (リストをアルファベット順に保つことを忘れないでください)。
言語コードの形式は、例えば `ru``zh-CN` のように、[IETF言語タグ](http://ja.wikipedia.org/wiki/IETF%E8%A8%80%E8%AA%9E%E3%82%BF%E3%82%B0) に従うべきです。
2. `framework` に入って、`./yii message/extract --languages=<your_language>` を走らせます。
2. `framework` に入って、`./yii message/extract @yii/messages/config.php --languages=<your_language>` を走らせます。
3. `framework/messages/your_language/yii.php` のメッセージを翻訳します。ファイルは必ず UTF-8 エンコーディングを使って保存してください。
4. [プルリクエスト](git-workflow.md) をします。
あなたの翻訳を最新状態に保つために、`./yii message/extract --languages=<your_language>` を再び走らせることが出来ます。
あなたの翻訳を最新状態に保つために、`./yii message/extract @yii/messages/config.php --languages=<your_language>` を再び走らせることが出来ます。
このコマンドは、変更のなかった箇所には触れることなく、自動的にメッセージを再抽出してくれます。
翻訳ファイルの中で、配列の各要素は、メッセージ(キー)と翻訳(値)をあらわします。

4
docs/internals-pl/translation-workflow.md

@ -15,11 +15,11 @@ Aby rozpocząć tłumaczenie komunikatów:
1. Sprawdź plik `framework/messages/config.php` i upewnij się, że Twój język jest wymieniony w sekcji `languages`.
Jeśli nie, dodaj go tam (pamiętaj, że lista powinna być posortowana alfabetycznie). Format kodu języka powinien być zgodny
ze [specyfikacją IETF](http://en.wikipedia.org/wiki/IETF_language_tag) (przykładowo `ru`, `zh-CN`).
2. Przejdź do folderu `framework` i uruchom `./yii message/extract --languages=<twoj_jezyk>`.
2. Przejdź do folderu `framework` i uruchom `./yii message/extract @yii/messages/config.php --languages=<twoj_jezyk>`.
3. Przetłumacz komunikaty w pliku `framework/messages/twoj_jezyk/yii.php`. Upewnij się, że zapisujesz plik z kodowaniem UTF-8.
4. [Wyślij prośbę o dołączenie kodu](git-workflow.md).
Aby Twoje tłumaczenia pozostawały aktualne, możesz uruchomić `./yii message/extract --languages=<twoj_jezyk>` ponownie po pewnym czasie.
Aby Twoje tłumaczenia pozostawały aktualne, możesz uruchomić `./yii message/extract @yii/messages/config.php --languages=<twoj_jezyk>` ponownie po pewnym czasie.
Komunikaty zostaną jeszcze raz wyekstraktowane, pozostawiając w pliku te, które się nie zmieniły.
W pliku tłumaczeń każdy element tablicy reprezentuje przetłumaczony (wartość) komunikat (klucz). Jeśli wartość jest pusta,

6
docs/internals-pt-BR/translation-workflow.md

@ -15,7 +15,7 @@ para o usuário final, tais como erros de validação.
Os passos para iniciar a tradução de mensagens são:
1. Com o `console` entre na pasta `yii2/framework` e execute o seguinte comando:
`yii message/extract messages/config.php`.
`./yii message/extract @yii/messages/config.php --languages=pt-BR`.
2. As mensagens a serem traduzidas encontram-se no seguinte caminho:
`framework/messages/pt-BR/yii.php`. Certifique-se de salvar o arquivo com a
codificação UTF-8 (Plain).
@ -26,7 +26,7 @@ Os passos para iniciar a tradução de mensagens são:
Para manter as traduções sempre atualizadas, certifique-se que seu fork do Yii
esteja com a última versão. Em seguida, basta executar o comando
`yii message/extract messages/config.php` novamente e o mesmo irá adicionar
`./yii message/extract @yii/messages/config.php --languages=pt-BR` novamente e o mesmo irá adicionar
automaticamente as novas mensagens a serem traduzidas.
No arquivo de tradução cada elemento do array representa a tradução de uma
@ -115,4 +115,4 @@ Regras e Observações
- query string
- case-sensitive
- case-insensitive
- callback
- callback

2
docs/internals-ru/translation-workflow.md

@ -11,7 +11,7 @@ Yii переводится на множество языков, в том чи
Для того, чтобы обновить перевод:
1. Открываем в консоли директорию `framework`, запускаем `yii message/extract messages/config.php`.
1. Открываем в консоли директорию `framework`, запускаем `./yii message/extract @yii/messages/config.php --languages=ru`.
3. Переводим сообщения в `framework/messages/ru/yii.php`. Важно чтобы файлы были в кодировке UTF-8.
4. [Делаем pull request](https://github.com/yiisoft/yii2/blob/master/docs/internals-ru/git-workflow.md) с переводом из `ru`,
остальные языки не трогаем.

6
docs/internals-sr-Latn/translation-workflow.md

@ -13,11 +13,11 @@ Da bi započeli rad sa prevodom poruka potrebno je da:
1. Otvorite `framework/messages/config.php` i proverite da li je vaš jezik naveden u `languages`. Ako nije,
dodajte tu vaš jezik (ne zaboravite da zadržite alfabetički rapored). Format koda jezika treba da prati
[IETF jezičku tag specifikaciju](http://en.wikipedia.org/wiki/IETF_language_tag), na primer, `ru`, `zh-CN`.
2. Uđite u `framework` direktorijum i pokrenite `yii message/extract messages/config.php`.
2. Uđite u `framework` direktorijum i pokrenite `./yii message/extract @yii/messages/config.php --languages=<your_language>`.
3. Prevedite poruke unutar `framework/messages/your_language/yii.php` fajla. Pobrinite se da se fajl sačuva sa UTF-8 enkodingom.
4. [Napravite pull zahtev](https://github.com/yiisoft/yii2/blob/master/docs/internals-sr-Latn/git-workflow.md).
Kako bi vaš prevod bio ažuran možete pokrenuti komandu `yii message/extract messages/config.php` još jednom. Ona će automatski ponovo izvući poruke ostavljajući nepromenjene netaknutim.
Kako bi vaš prevod bio ažuran možete pokrenuti komandu `./yii message/extract @yii/messages/config.php --languages=<your_language>` još jednom. Ona će automatski ponovo izvući poruke ostavljajući nepromenjene netaknutim.
U fajlu za prevođenje svaki element niza predstavlja prevod (vrednost) poruke (ključ). Ako je vrednost prazna, poruka se smatra neprevedenom. Poruke koje više ne trebaju prevod će imati svoje prevode zatvorene između para '@@' znaka. Poruke se mogu koristiti i u formatu za množinu. Pogledajte [i18n sekciju uputstva](../guide-sr-Latn/tutorial-i18n.md) za više informacija.
@ -32,4 +32,4 @@ Nakon što je inicijalni posao završen možete dobiti šta je promenjeno nakon
php build translation "../docs/guide" "../docs/guide-ru" "Russian guide translation report" > report_guide_ru.html
```
Ako se bude bunio u vezi composer-a, izvršite `composer install` u samom root-u direktorijumu.
Ako se bude bunio u vezi composer-a, izvršite `composer install` u samom root-u direktorijumu.

4
docs/internals-uk/translation-workflow.md

@ -12,11 +12,11 @@ Yii перекладається на багато різних мов, щоб
Щоб розпочати переклад повідомлень необхідно:
1. Перейти до директорії `framework` та виконати команду `./yii message/extract messages/config.php`.
1. Перейти до директорії `framework` та виконати команду `./yii message/extract @yii/messages/config.php --languages=uk`.
2. Перекласти повідомлення у файлі `framework/messages/uk/yii.php`. Зберегти файл у кодуванні UTF-8.
3. [Відправити "pull request"](git-workflow.md).
Для підтримання перекладу в актуальному стані можна знову використовувати команду `./yii message/extract messages/config.php`.
Для підтримання перекладу в актуальному стані можна знову використовувати команду `./yii message/extract @yii/messages/config.php --languages=uk`.
Це автоматично здобуде нові повідомлення, зберігаючи при цьому вже перекладені.
У файлі перекладу кожний ключ елементу масиву представляє повідомлення, а значення елементу масиву представляє переклад.

4
docs/internals-uz/translation-workflow.md

@ -10,7 +10,7 @@ Ikki turdagi habarlar bor: istisnolar, qaysiki ishlab chiquvchi nazarda tutgan v
Tarjimani yangilash uchun:
1. Konsolda `framework` direktoriyani ochamiz, `yii message/extract messages/config.php` ni ishga tushiramiz.
1. Konsolda `framework` direktoriyani ochamiz, `./yii message/extract @yii/messages/config.php --languages=uz` ni ishga tushiramiz.
3. Habarlarni `framework/messages/uz/yii.php` ga ko`chiramiz. Muhimi fayllar UTF-8 kodlashda bo'lishi kerak.
4. `uz` dagi tarjimalar bilan [pull request qilamiz](https://github.com/yiisoft/yii2/blob/master/docs/internals/git-workflow.md), qolgan tillarga tegmaymiz.
@ -133,4 +133,4 @@ Oxirgi variantni tashlashdan oldin uni umumiy stilini, orfografiyasini, punktlar
- validator — validator.
- validator class — validator klasi.
- view — namoyish.
- query builder — so'rovlar konstruktori.
- query builder — so'rovlar konstruktori.

4
docs/internals/translation-workflow.md

@ -16,11 +16,11 @@ In order to start with message translation:
add your language there (remember to keep the list in alphabetical order). The format of language code
should follow [IETF language tag spec](http://en.wikipedia.org/wiki/IETF_language_tag), for example,
`ru`, `zh-CN`.
2. Go to `framework` and run `./yii message/extract --languages=<your_language>`.
2. Go to `framework` and run `./yii message/extract @yii/messages/config.php --languages=<your_language>`.
3. Translate messages in `framework/messages/your_language/yii.php`. Make sure file is saved using UTF-8 encoding.
4. [Make a pull request](git-workflow.md).
In order to keep your translation up to date you may run `./yii message/extract --languages=<your_language>` again. It will
In order to keep your translation up to date you may run `./yii message/extract @yii/messages/config.php --languages=<your_language>` again. It will
automatically re-extract messages keeping unchanged ones intact.
In the translation file each array element represents the translation (value) of a message (key). If the value is empty,

1
framework/CHANGELOG.md

@ -26,6 +26,7 @@ Yii Framework 2 Change Log
- Enh #13378: Added skipOnEmpty option to SluggableBehaviour (andrewnester)
- Enh #14389: Optimize `Validator::validateAttributes()` by calling `attributeNames()` only once (nicdnep)
- Enh #14105: Implemented a solution for retrieving DBMS constraints in `yii\db\Schema` (sergeymakinen)
- Enh #14417: Added configuration for headers in PHP files generated by `message/extract` command (rob006)
2.0.12 June 05, 2017

181
framework/console/controllers/MessageController.php

@ -131,6 +131,25 @@ class MessageController extends \yii\console\Controller
* @see isCategoryIgnored
*/
public $ignoreCategories = [];
/**
* @var string File header in generated PHP file with messages. This property is used only if [[$format]] is "php".
* @since 2.0.13
*/
public $phpFileHeader = '';
/**
* @var string|null DocBlock used for messages array in generated PHP file. If `null`, default DocBlock will be used.
* This property is used only if [[$format]] is "php".
* @since 2.0.13
*/
public $phpDocBlock;
/**
* @var array Config for messages extraction.
* @see actionExtract()
* @see initConfig()
* @since 2.0.13
*/
protected $config;
/**
@ -155,6 +174,8 @@ class MessageController extends \yii\console\Controller
'messageTable',
'catalog',
'ignoreCategories',
'phpFileHeader',
'phpDocBlock',
]);
}
@ -271,81 +292,45 @@ EOD;
*/
public function actionExtract($configFile = null)
{
$configFileContent = [];
if ($configFile !== null) {
$configFile = Yii::getAlias($configFile);
if (!is_file($configFile)) {
throw new Exception("The configuration file does not exist: $configFile");
}
$configFileContent = require $configFile;
}
$this->initConfig($configFile);
$config = array_merge(
$this->getOptionValues($this->action->id),
$configFileContent,
$this->getPassedOptionValues()
);
$config['sourcePath'] = Yii::getAlias($config['sourcePath']);
$config['messagePath'] = Yii::getAlias($config['messagePath']);
if (!isset($config['sourcePath'], $config['languages'])) {
throw new Exception('The configuration file must specify "sourcePath" and "languages".');
}
if (!is_dir($config['sourcePath'])) {
throw new Exception("The source path {$config['sourcePath']} is not a valid directory.");
}
if (empty($config['format']) || !in_array($config['format'], ['php', 'po', 'pot', 'db'])) {
throw new Exception('Format should be either "php", "po", "pot" or "db".');
}
if (in_array($config['format'], ['php', 'po', 'pot'])) {
if (!isset($config['messagePath'])) {
throw new Exception('The configuration file must specify "messagePath".');
}
if (!is_dir($config['messagePath'])) {
throw new Exception("The message path {$config['messagePath']} is not a valid directory.");
}
}
if (empty($config['languages'])) {
throw new Exception('Languages cannot be empty.');
}
$files = FileHelper::findFiles(realpath($config['sourcePath']), $config);
$files = FileHelper::findFiles(realpath($this->config['sourcePath']), $this->config);
$messages = [];
foreach ($files as $file) {
$messages = array_merge_recursive($messages, $this->extractMessages($file, $config['translator'], $config['ignoreCategories']));
$messages = array_merge_recursive($messages, $this->extractMessages($file, $this->config['translator'], $this->config['ignoreCategories']));
}
$catalog = isset($config['catalog']) ? $config['catalog'] : 'messages';
$catalog = isset($this->config['catalog']) ? $this->config['catalog'] : 'messages';
if (in_array($config['format'], ['php', 'po'])) {
foreach ($config['languages'] as $language) {
$dir = $config['messagePath'] . DIRECTORY_SEPARATOR . $language;
if (in_array($this->config['format'], ['php', 'po'])) {
foreach ($this->config['languages'] as $language) {
$dir = $this->config['messagePath'] . DIRECTORY_SEPARATOR . $language;
if (!is_dir($dir) && !@mkdir($dir)) {
throw new Exception("Directory '{$dir}' can not be created.");
}
if ($config['format'] === 'po') {
$this->saveMessagesToPO($messages, $dir, $config['overwrite'], $config['removeUnused'], $config['sort'], $catalog, $config['markUnused']);
if ($this->config['format'] === 'po') {
$this->saveMessagesToPO($messages, $dir, $this->config['overwrite'], $this->config['removeUnused'], $this->config['sort'], $catalog, $this->config['markUnused']);
} else {
$this->saveMessagesToPHP($messages, $dir, $config['overwrite'], $config['removeUnused'], $config['sort'], $config['markUnused']);
$this->saveMessagesToPHP($messages, $dir, $this->config['overwrite'], $this->config['removeUnused'], $this->config['sort'], $this->config['markUnused']);
}
}
} elseif ($config['format'] === 'db') {
} elseif ($this->config['format'] === 'db') {
/** @var Connection $db */
$db = Instance::ensure($config['db'], Connection::className());
$sourceMessageTable = isset($config['sourceMessageTable']) ? $config['sourceMessageTable'] : '{{%source_message}}';
$messageTable = isset($config['messageTable']) ? $config['messageTable'] : '{{%message}}';
$db = Instance::ensure($this->config['db'], Connection::className());
$sourceMessageTable = isset($this->config['sourceMessageTable']) ? $this->config['sourceMessageTable'] : '{{%source_message}}';
$messageTable = isset($this->config['messageTable']) ? $this->config['messageTable'] : '{{%message}}';
$this->saveMessagesToDb(
$messages,
$db,
$sourceMessageTable,
$messageTable,
$config['removeUnused'],
$config['languages'],
$config['markUnused']
$this->config['removeUnused'],
$this->config['languages'],
$this->config['markUnused']
);
} elseif ($config['format'] === 'pot') {
$this->saveMessagesToPOT($messages, $config['messagePath'], $catalog);
} elseif ($this->config['format'] === 'pot') {
$this->saveMessagesToPOT($messages, $this->config['messagePath'], $catalog);
}
}
@ -739,23 +724,7 @@ EOD;
$array = VarDumper::export($merged);
$content = <<<EOD
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yii {$this->id}/{$this->action->id}' 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.
*/
{$this->config['phpFileHeader']}{$this->config['phpDocBlock']}
return $array;
EOD;
@ -902,4 +871,72 @@ EOD;
$this->stdout("Nothing to save.\n", Console::FG_GREEN);
}
}
/**
* @param string $configFile
* @throws Exception If configuration file does not exists.
* @since 2.0.13
*/
protected function initConfig($configFile)
{
$configFileContent = [];
if ($configFile !== null) {
$configFile = Yii::getAlias($configFile);
if (!is_file($configFile)) {
throw new Exception("The configuration file does not exist: $configFile");
}
$configFileContent = require $configFile;
}
$this->config = array_merge(
$this->getOptionValues($this->action->id),
$configFileContent,
$this->getPassedOptionValues()
);
$this->config['sourcePath'] = Yii::getAlias($this->config['sourcePath']);
$this->config['messagePath'] = Yii::getAlias($this->config['messagePath']);
if (!isset($this->config['sourcePath'], $this->config['languages'])) {
throw new Exception('The configuration file must specify "sourcePath" and "languages".');
}
if (!is_dir($this->config['sourcePath'])) {
throw new Exception("The source path {$this->config['sourcePath']} is not a valid directory.");
}
if (empty($this->config['format']) || !in_array($this->config['format'], ['php', 'po', 'pot', 'db'])) {
throw new Exception('Format should be either "php", "po", "pot" or "db".');
}
if (in_array($this->config['format'], ['php', 'po', 'pot'])) {
if (!isset($this->config['messagePath'])) {
throw new Exception('The configuration file must specify "messagePath".');
}
if (!is_dir($this->config['messagePath'])) {
throw new Exception("The message path {$this->config['messagePath']} is not a valid directory.");
}
}
if (empty($this->config['languages'])) {
throw new Exception('Languages cannot be empty.');
}
if ($this->config['format'] === 'php' && $this->config['phpDocBlock'] === null) {
$this->config['phpDocBlock'] = <<<DOCBLOCK
/**
* Message translations.
*
* This file is automatically generated by 'yii {$this->id}/{$this->action->id}' 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.
*/
DOCBLOCK;
}
}
}

11
framework/console/widgets/Table.php

@ -8,7 +8,6 @@
namespace yii\console\widgets;
use Yii;
use yii\base\Object;
use yii\base\Widget;
use yii\helpers\ArrayHelper;
use yii\helpers\Console;
@ -61,7 +60,7 @@ class Table extends Widget
const CHAR_RIGHT = 'right';
const CHAR_RIGHT_MID = 'right-mid';
const CHAR_MIDDLE = 'middle';
/**
* @var array table headers
*/
@ -304,10 +303,10 @@ class Table extends Widget
foreach ($columns as $column) {
$columnWidth = max(array_map(function ($val) {
if (is_array($val)) {
$encodings = array_fill(0, count($val), Yii::$app->charset);
return max(array_map('mb_strwidth', $val, $encodings)) + mb_strwidth($this->_listPrefix, Yii::$app->charset);
}
return mb_strwidth($val, Yii::$app->charset);
$encodings = array_fill(0, count($val), Yii::$app->charset);
return max(array_map('mb_strwidth', $val, $encodings)) + mb_strwidth($this->_listPrefix, Yii::$app->charset);
}
return mb_strwidth($val, Yii::$app->charset);
}, $column)) + 2;
$this->_columnWidths[] = $columnWidth;
$totalWidth += $columnWidth;

8
framework/messages/ar/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/az/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/bg/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/bs/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/ca/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

12
framework/messages/config.php

@ -1,4 +1,9 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
return [
// string, required, root directory of all source files
@ -47,6 +52,13 @@ return [
// Please refer to "except" for details about the patterns.
// If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
'only' => ['*.php'],
'phpFileHeader' => '/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
',
// Generated file format. Can be "php", "db" or "po".
'format' => 'php',
// Connection component ID for "db" format.

8
framework/messages/cs/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/da/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

6
framework/messages/de/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/el/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/es/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

8
framework/messages/et/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

6
framework/messages/fa/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/fi/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

8
framework/messages/fr/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/he/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/hr/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/hu/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/id/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

6
framework/messages/it/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/ja/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

8
framework/messages/ka/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/kk/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/ko/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/lt/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

22
framework/messages/lv/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
@ -17,18 +23,18 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'{nFormatted} B' => '{nFormatted} B',
'{nFormatted} GB' => '{nFormatted} Gb',
'{nFormatted} B' => '{nFormatted} B',
'{nFormatted} GB' => '{nFormatted} Gb',
'{nFormatted} GiB' => '{nFormatted} GiB',
'{nFormatted} KB' => '{nFormatted} KB',
'{nFormatted} KB' => '{nFormatted} KB',
'{nFormatted} KiB' => '{nFormatted} KiB',
'{nFormatted} MB' => '{nFormatted} MB',
'{nFormatted} MB' => '{nFormatted} MB',
'{nFormatted} MiB' => '{nFormatted} MiB',
'{nFormatted} PB' => '{nFormatted} PB',
'{nFormatted} PB' => '{nFormatted} PB',
'{nFormatted} PiB' => '{nFormatted} PiB',
'{nFormatted} TB' => '{nFormatted} TB',
'{nFormatted} TB' => '{nFormatted} TB',
'{nFormatted} TiB' => '{nFormatted} TiB',
'{nFormatted} {n, plural, =1{byte} other{bytes}}' => '{nFormatted} {n, plural, zero{baitu} one{baits} other{baiti}}',
'{nFormatted} {n, plural, =1{byte} other{bytes}}' => '{nFormatted} {n, plural, zero{baitu} one{baits} other{baiti}}',
'{nFormatted} {n, plural, =1{gibibyte} other{gibibytes}}' => '{nFormatted} gibi{n, plural, zero{baitu} one{baits} other{baiti}}',
'{nFormatted} {n, plural, =1{gigabyte} other{gigabytes}}' => '{nFormatted} giga{n, plural, zero{baitu} one{baits} other{baiti}}',
'{nFormatted} {n, plural, =1{kibibyte} other{kibibytes}}' => '{nFormatted} kibi{n, plural, zero{baitu} one{baits} other{baiti}}',

41
framework/messages/ms/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
@ -35,22 +41,15 @@ return [
'Page not found.' => 'Halaman tidak dijumpai.',
'Please fix the following errors:' => 'Sila betulkan ralat berikut:',
'Please upload a file.' => 'Sila muat naik fail',
'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' =>
'Memaparkan <b>{begin, number}-{end, number}</b> daripada <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.',
'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' => 'Memaparkan <b>{begin, number}-{end, number}</b> daripada <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.',
'The file "{file}" is not an image.' => 'Fail ini "{file}" bukan berjenis gambar.',
'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' =>
'Fail ini "{file}" terlalu besar. Saiz tidak boleh lebih besar daripada {formattedLimit}.',
'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' =>
'Fail ini "{file}" terlalu kecil. Saiznya tidak boleh lebih kecil daripada {formattedLimit}.',
'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' => 'Fail ini "{file}" terlalu besar. Saiz tidak boleh lebih besar daripada {formattedLimit}.',
'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' => 'Fail ini "{file}" terlalu kecil. Saiznya tidak boleh lebih kecil daripada {formattedLimit}.',
'The format of {attribute} is invalid.' => 'Format untuk atribut ini {attribute} tidak sah.',
'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' =>
'Gambar "{file}" terlalu panjang. Panjang gambar tidak boleh lebih besar daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' =>
'Gambar "{file}" terlalu lebar. Gambar tidak boleh lebih lebar daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' =>
'Gambar "{file}" terlalu singkat. Panjang tidak boleh lebih singkat daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' =>
'Gambar "{file}" terlalu kecil. Lebar gambar tidak boleh kurang daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Gambar "{file}" terlalu panjang. Panjang gambar tidak boleh lebih besar daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Gambar "{file}" terlalu lebar. Gambar tidak boleh lebih lebar daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Gambar "{file}" terlalu singkat. Panjang tidak boleh lebih singkat daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Gambar "{file}" terlalu kecil. Lebar gambar tidak boleh kurang daripada {limit, number} {limit, plural, one{pixel} other{pixels}}.',
'The requested view "{name}" was not found.' => 'Paparan yang diminta "{name}" tidak dijumpai.',
'The verification code is incorrect.' => 'Kod penyesah tidak tepat.',
'Total <b>{count, number}</b> {count, plural, one{item} other{items}}.' => 'Jumlah <b>{count, number}</b> {count, plural, one{item} other{items}}.',
@ -60,8 +59,7 @@ return [
'View' => 'Paparan',
'Yes' => 'Ya',
'You are not allowed to perform this action.' => 'Anda tidak dibenarkan untuk mengunakan fungsi ini.',
'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' =>
'Anda boleh memuat naik tidak lebih daripada {limit, number} {limit, plural, one{file} other{files}}.',
'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'Anda boleh memuat naik tidak lebih daripada {limit, number} {limit, plural, one{file} other{files}}.',
'in {delta, plural, =1{a day} other{# days}}' => 'dalam {delta, plural, =1{a day} other{# days}}',
'in {delta, plural, =1{a minute} other{# minutes}}' => 'dalam {delta, plural, =1{a minute} other{# minutes}}',
'in {delta, plural, =1{a month} other{# months}}' => 'dalam {delta, plural, =1{a month} other{# months}}',
@ -88,12 +86,9 @@ return [
'{attribute} must be no less than {min}.' => '{attribute} tidak boleh kurang daripada {min}.',
'{attribute} must be repeated exactly.' => '{attribute} mestilah diulang dengan tepat.',
'{attribute} must not be equal to "{compareValue}".' => '{attribute} mestilah tidak sama dengan "{compareValue}".',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' =>
'{attribute} mesti mengandungi sekurang-kurangnya {min, number} {min, plural, one{character} other{characters}}.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' =>
'{attribute} mesti mengangungi paling banyak {max, number} {max, plural, one{character} other{characters}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' =>
'{attribute} mesti mengandungi {length, number} {length, plural, one{character} other{characters}}.',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => '{attribute} mesti mengandungi sekurang-kurangnya {min, number} {min, plural, one{character} other{characters}}.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} mesti mengangungi paling banyak {max, number} {max, plural, one{character} other{characters}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} mesti mengandungi {length, number} {length, plural, one{character} other{characters}}.',
'{delta, plural, =1{a day} other{# days}} ago' => '{delta, plural, =1{a day} other{# days}} lalu',
'{delta, plural, =1{a minute} other{# minutes}} ago' => '{delta, plural, =1{a minute} other{# minutes}} lalu',
'{delta, plural, =1{a month} other{# months}} ago' => '{delta, plural, =1{a month} other{# months}} lalu',

8
framework/messages/nb-NO/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/nl/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

13
framework/messages/pl/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
@ -17,8 +23,7 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'The combination {values} of {attributes} has already been taken.' => 'Zestawienie {values} dla {attributes} jest już w użyciu.',
'Unknown alias: -{name}' => 'Nieznany alias: -{name}',
' and ' => ' i ',
'(not set)' => '(brak wartości)',
'An internal server error occurred.' => 'Wystąpił wewnętrzny błąd serwera.',
'Are you sure you want to delete this item?' => 'Czy na pewno usunąć ten element?',
@ -37,7 +42,9 @@ return [
'Page not found.' => 'Nie odnaleziono strony.',
'Please fix the following errors:' => 'Proszę poprawić następujące błędy:',
'Please upload a file.' => 'Proszę wgrać plik.',
'Powered by {yii}' => 'Powered by {yii}',
'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' => 'Wyświetlone <b>{begin, number}-{end, number}</b> z <b>{totalCount, number}</b> {totalCount, plural, one{rekordu} other{rekordów}}.',
'The combination {values} of {attributes} has already been taken.' => 'Zestawienie {values} dla {attributes} jest już w użyciu.',
'The file "{file}" is not an image.' => 'Plik "{file}" nie jest obrazem.',
'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' => 'Plik "{file}" jest zbyt duży. Jego rozmiar nie może przekraczać {formattedLimit}.',
'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' => 'Plik "{file}" jest za mały. Jego rozmiar nie może być mniejszy niż {formattedLimit}.',
@ -50,10 +57,12 @@ return [
'The verification code is incorrect.' => 'Kod weryfikacyjny jest nieprawidłowy.',
'Total <b>{count, number}</b> {count, plural, one{item} other{items}}.' => 'Razem <b>{count, number}</b> {count, plural, one{rekord} few{rekordy} many{rekordów} other{rekordu}}.',
'Unable to verify your data submission.' => 'Nie udało się zweryfikować przesłanych danych.',
'Unknown alias: -{name}' => 'Nieznany alias: -{name}',
'Unknown option: --{name}' => 'Nieznana opcja: --{name}',
'Update' => 'Aktualizuj',
'View' => 'Zobacz szczegóły',
'Yes' => 'Tak',
'Yii Framework' => 'Yii Framework',
'You are not allowed to perform this action.' => 'Brak upoważnienia do wykonania tej czynności.',
'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'Możliwe wgranie najwyżej {limit, number} {limit, plural, one{pliku} few{plików} many{plików} other{pliku}}.',
'in {delta, plural, =1{a day} other{# days}}' => 'za {delta, plural, =1{jeden dzień} other{# dni}}',

8
framework/messages/pt-BR/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/pt/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/ro/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

6
framework/messages/ru/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/sk/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

8
framework/messages/sl/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

10
framework/messages/sr-Latn/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
@ -103,5 +109,5 @@ return [
'{attribute} must not be equal to "{compareValue}".' => '{attribute} ne sme biti jednak "{compareValue}".',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => '{attribute} treba da sadrži bar {min, number} {min, plural, one{karakter} other{karaktera}}.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} treba da sadrži najviše {max, number} {max, plural, one{karakter} other{karaktera}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} treba da sadrži {length, number} {length, plural, one{karakter} other{karaktera}}.'
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} treba da sadrži {length, number} {length, plural, one{karakter} other{karaktera}}.',
];

10
framework/messages/sr/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
@ -103,5 +109,5 @@ return [
'{attribute} must not be equal to "{compareValue}".' => '{attribute} не сме бити једнак "{compareValue}".',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => '{attribute} треба да садржи барем {min, number} {min, plural, one{карактер} other{карактера}}.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} треба да садржи највише {max, number} {max, plural, one{карактер} other{карактера}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} треба да садржи {length, number} {length, plural, one{карактер} other{карактера}}.'
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} треба да садржи {length, number} {length, plural, one{карактер} other{карактера}}.',
];

8
framework/messages/sv/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

6
framework/messages/tg/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/th/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

6
framework/messages/tr/yii.php

@ -1,5 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.

8
framework/messages/uk/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/uz/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/vi/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/zh-CN/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

8
framework/messages/zh-TW/yii.php

@ -1,8 +1,14 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*

6
framework/views/messageConfig.php

@ -46,6 +46,12 @@ return [
'messagePath' => __DIR__,
// boolean, whether the message file should be overwritten with the merged messages
'overwrite' => true,
/*
// File header used in generated messages files
'phpFileHeader' => '',
// PHPDoc used for array of messages with generated messages files
'phpDocBlock' => null,
*/
/*
// Message categories to ignore

4
tests/framework/behaviors/SluggableBehaviorTest.php

@ -302,8 +302,8 @@ class SkipOnEmptySluggableActiveRecord extends ActiveRecordSluggable
'attribute' => 'name',
'slugAttribute' => 'slug',
'ensureUnique' => true,
'skipOnEmpty' => true
'skipOnEmpty' => true,
],
];
}
}
}

30
tests/framework/console/controllers/PHPMessageControllerTest.php

@ -42,6 +42,8 @@ class PHPMessageControllerTest extends BaseMessageControllerTest
'sourcePath' => $this->sourcePath,
'messagePath' => $this->messagePath,
'overwrite' => true,
'phpFileHeader' => "/*file header*/\n",
'phpDocBlock' => '/*doc block*/',
];
}
@ -92,4 +94,32 @@ class PHPMessageControllerTest extends BaseMessageControllerTest
return require $messageFilePath;
}
// By default phpunit runs inherited test after inline tests, so `testCreateTranslation()` would be run after
// `testCustomFileHeaderAndDocBlock()` (that would break `@depends` annotation). This ensures that
// `testCreateTranslation() will be run before `testCustomFileHeaderAndDocBlock()`.
public function testCreateTranslation()
{
parent::testCreateTranslation();
}
/**
* @depends testCreateTranslation
*/
public function testCustomFileHeaderAndDocBlock()
{
$category = 'test_headers_category';
$message = 'test message';
$sourceFileContent = "Yii::t('{$category}', '{$message}');";
$this->createSourceFile($sourceFileContent);
$this->saveConfigFile($this->getConfig());
$this->runMessageControllerAction('extract', [$this->configFileName]);
$messageFilePath = $this->getMessageFilePath('test_headers_category');
$content = file_get_contents($messageFilePath);
$head = substr($content, 0, strpos($content, 'return '));
$expected = "<?php\n/*file header*/\n/*doc block*/\n";
$this->assertSame($expected, $head);
}
}

1
tests/framework/db/ActiveRecordTest.php

@ -1505,5 +1505,4 @@ abstract class ActiveRecordTest extends DatabaseTestCase
$this->assertEquals('Some {{updated}} name', $customer->name);
$this->assertEquals('Some {{%updated}} address', $customer->address);
}
}

4
tests/framework/validators/ExistValidatorTest.php

@ -7,11 +7,9 @@
namespace yiiunit\framework\validators;
use Yii;
use yii\base\Exception;
use yii\validators\ExistValidator;
use yiiunit\data\ar\ActiveRecord;
use yiiunit\data\ar\Document;
use yiiunit\data\ar\Order;
use yiiunit\data\ar\OrderItem;
use yiiunit\data\validators\models\ValidatorTestMainModel;
@ -192,7 +190,7 @@ abstract class ExistValidatorTest extends DatabaseTestCase
OrderItem::$tableName = $oldTableName;
}
/**
/**
* Test expresssion in targetAttribute
* @see https://github.com/yiisoft/yii2/issues/14304
*/

Loading…
Cancel
Save