From f2945b29811a375c5e86925a9119034c2b4fec81 Mon Sep 17 00:00:00 2001 From: Luiz Marin <67489841+luizcmarin@users.noreply.github.com> Date: Mon, 6 May 2024 12:48:40 -0300 Subject: [PATCH 1/4] Fix docs --- README.md | 31 +++------------ composer.json | 4 +- docs/guide/en/README.md | 5 +++ docs/{ => guide}/en/extractor.md | 0 docs/{ => guide}/en/intl-formatter.md | 0 docs/{ => guide}/en/simple-formatter.md | 0 docs/guide/pt-BR/README.md | 5 +++ docs/{ => guide}/pt-BR/extractor.md | 0 docs/{ => guide}/pt-BR/intl-formatter.md | 0 docs/{ => guide}/pt-BR/simple-formatter.md | 0 docs/internals.md | 45 ++++++++++++++++++++++ 11 files changed, 63 insertions(+), 27 deletions(-) create mode 100644 docs/guide/en/README.md rename docs/{ => guide}/en/extractor.md (100%) rename docs/{ => guide}/en/intl-formatter.md (100%) rename docs/{ => guide}/en/simple-formatter.md (100%) create mode 100644 docs/guide/pt-BR/README.md rename docs/{ => guide}/pt-BR/extractor.md (100%) rename docs/{ => guide}/pt-BR/intl-formatter.md (100%) rename docs/{ => guide}/pt-BR/simple-formatter.md (100%) create mode 100644 docs/internals.md diff --git a/README.md b/README.md index e1f5b15..7a8ba4b 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ standalone PHP applications. ## Installation -The package could be installed with composer: +The package could be installed with [Composer](https://getcomposer.org): ```shell composer require yiisoft/translator @@ -295,32 +295,13 @@ echo $translator->withDefaultCategory($newDefaultCategoryId); The package contains interfaces for development of custom formatters, readers, and writers. -## Testing +## Documentation -### Unit testing +- Guide: [English](docs/guide/en/README.md), [Português - Brasil](docs/guide/pt-BR/README.md) +- [Internals](docs/internals.md) -The package is tested with [PHPUnit](https://phpunit.de/). To run tests: - -```shell -./vendor/bin/phpunit -``` - -### Mutation testing - -The package tests are checked with [Infection](https://infection.github.io/) mutation framework with -[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: - -```shell -./vendor/bin/roave-infection-static-analysis-plugin -``` - -### Static analysis - -The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: - -```shell -./vendor/bin/psalm -``` +If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that. +You may also check out other [Yii Community Resources](https://www.yiiframework.com/community). ## License diff --git a/composer.json b/composer.json index 49060bb..dd4f838 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "issues": "https://github.com/yiisoft/translator/issues?state=open", "forum": "https://www.yiiframework.com/forum/", "wiki": "https://www.yiiframework.com/wiki/", - "irc": "irc://irc.freenode.net/yii", + "irc": "ircs://irc.libera.chat:6697/yii", "chat": "https://t.me/yii3en", "source": "https://github.com/yiisoft/translator" }, @@ -67,4 +67,4 @@ "test": "phpunit --testdox --no-interaction", "test-watch": "phpunit-watcher watch" } -} +} \ No newline at end of file diff --git a/docs/guide/en/README.md b/docs/guide/en/README.md new file mode 100644 index 0000000..4ef10fc --- /dev/null +++ b/docs/guide/en/README.md @@ -0,0 +1,5 @@ +# Documentation + +- [Extractor](extractor.md) +- [`intl` formatter](intl-formatter.md) +- [Simple Formatter](simple-formatter.md) diff --git a/docs/en/extractor.md b/docs/guide/en/extractor.md similarity index 100% rename from docs/en/extractor.md rename to docs/guide/en/extractor.md diff --git a/docs/en/intl-formatter.md b/docs/guide/en/intl-formatter.md similarity index 100% rename from docs/en/intl-formatter.md rename to docs/guide/en/intl-formatter.md diff --git a/docs/en/simple-formatter.md b/docs/guide/en/simple-formatter.md similarity index 100% rename from docs/en/simple-formatter.md rename to docs/guide/en/simple-formatter.md diff --git a/docs/guide/pt-BR/README.md b/docs/guide/pt-BR/README.md new file mode 100644 index 0000000..4ef10fc --- /dev/null +++ b/docs/guide/pt-BR/README.md @@ -0,0 +1,5 @@ +# Documentation + +- [Extractor](extractor.md) +- [`intl` formatter](intl-formatter.md) +- [Simple Formatter](simple-formatter.md) diff --git a/docs/pt-BR/extractor.md b/docs/guide/pt-BR/extractor.md similarity index 100% rename from docs/pt-BR/extractor.md rename to docs/guide/pt-BR/extractor.md diff --git a/docs/pt-BR/intl-formatter.md b/docs/guide/pt-BR/intl-formatter.md similarity index 100% rename from docs/pt-BR/intl-formatter.md rename to docs/guide/pt-BR/intl-formatter.md diff --git a/docs/pt-BR/simple-formatter.md b/docs/guide/pt-BR/simple-formatter.md similarity index 100% rename from docs/pt-BR/simple-formatter.md rename to docs/guide/pt-BR/simple-formatter.md diff --git a/docs/internals.md b/docs/internals.md new file mode 100644 index 0000000..8dc4049 --- /dev/null +++ b/docs/internals.md @@ -0,0 +1,45 @@ +# Internals + +## Unit testing + +The package is tested with [PHPUnit](https://phpunit.de/). To run tests: + +```shell +./vendor/bin/phpunit +``` + +## Mutation testing + +The package tests are checked with [Infection](https://infection.github.io/) mutation framework with +[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: + +```shell +./vendor/bin/roave-infection-static-analysis-plugin +``` + +## Static analysis + +The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: + +```shell +./vendor/bin/psalm +``` + +## Rector + +Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or +use either newest or any specific version of PHP: + +```shell +./vendor/bin/rector +``` + +## Composer require checker + +This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`. + +To run the checker, execute the following command: + +```shell +./vendor/bin/composer-require-checker +``` From 4ca1439e925fb8e4d94d078f8294ba089170bc27 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 18 May 2024 17:36:42 +0300 Subject: [PATCH 2/4] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dd4f838..59e885d 100644 --- a/composer.json +++ b/composer.json @@ -67,4 +67,4 @@ "test": "phpunit --testdox --no-interaction", "test-watch": "phpunit-watcher watch" } -} \ No newline at end of file +} From 18e537ce9193d41924912c3702a9df450b33c054 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 18 May 2024 17:37:35 +0300 Subject: [PATCH 3/4] Update internals.md --- docs/internals.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/internals.md b/docs/internals.md index 8dc4049..087a514 100644 --- a/docs/internals.md +++ b/docs/internals.md @@ -25,7 +25,7 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static ./vendor/bin/psalm ``` -## Rector +## Code style Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or use either newest or any specific version of PHP: @@ -34,11 +34,10 @@ use either newest or any specific version of PHP: ./vendor/bin/rector ``` -## Composer require checker +## Dependencies -This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`. - -To run the checker, execute the following command: +This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if +all dependencies are correctly defined in `composer.json`. To run the checker, execute the following command: ```shell ./vendor/bin/composer-require-checker From f5bf9a2453955860526d4677b7d55021a9fcd260 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 18 May 2024 17:38:23 +0300 Subject: [PATCH 4/4] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7a8ba4b..b2d9c76 100644 --- a/README.md +++ b/README.md @@ -43,16 +43,16 @@ PHP arrays or GNU gettext. Message formatters provide extra syntax that is recog ## Built-in message formatters -- [Simple formatter](docs/en/simple-formatter.md) just replaces parameters in messages. Does not take into account the +- [Simple formatter](docs/guide/en/simple-formatter.md) just replaces parameters in messages. Does not take into account the locale. -- [`intl` formatter](docs/en/intl-formatter.md) utilizes PHP intl extension message formatting capabilities. +- [`intl` formatter](docs/guide/en/intl-formatter.md) utilizes PHP intl extension message formatting capabilities. ## Extracting messages The message extraction is done via [console extractor](https://github.com/yiisoft/translator-extractor) that searches for translator message calls and builds translation files. -In some cases you need to do so without using console. If that is your case, check [extractor guide](docs/en/extractor.md). +In some cases you need to do so without using console. If that is your case, check [extractor guide](docs/guide/en/extractor.md). ## Configuration