diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml index 74b8c923..31d38a4c 100644 --- a/.github/workflows/translation.yml +++ b/.github/workflows/translation.yml @@ -26,9 +26,10 @@ jobs: run: | cd _translations/guide po4a po4a.cfg - + cd ../cookbook + po4a po4a.cfg - name: Commit changed files uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Update translation - file_pattern: '_translations guide' + file_pattern: '_translations guide cookbook' diff --git a/_translations/cookbook/po/ru/README.md.po b/_translations/cookbook/po/ru/README.md.po new file mode 100644 index 00000000..83e8a4b7 --- /dev/null +++ b/_translations/cookbook/po/ru/README.md.po @@ -0,0 +1,75 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2025-09-12 09:45+0500\n" +"PO-Revision-Date: 2025-09-05 15:05+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 3.7\n" + +#. type: Title # +#: ../../cookbook/en/README.md +#, no-wrap +msgid "Yii3 community cookbook" +msgstr "Книга рецептов Yii3" + +#. type: Plain text +#: ../../cookbook/en/README.md +msgid "Yii3 Community Cookbook is an OpenSource book full of tips and tricks about the [Yii3](https://www.yiiframework.com/) PHP framework." +msgstr "Книга рецептов Yii3 – это бесплатная книга, которая состоит из подсказок и секретов о PHP фреймворке [Yii3](https://www.yiiframework.com/)." + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "The Yii community creates the cookbook." +msgstr "Книга создана сообществом Yii." + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "Yii core team members curate and edit it." +msgstr "Поддерживается и редактируется силами команды Yii." + +#. type: Plain text +#: ../../cookbook/en/README.md +msgid "Feel free to pull-request your own writings. Team members will review it, give feedback and merge the best possible way." +msgstr "Не стесняйтесь создать pull request со своими рецептами. Мы сделаем ревью и добавим ваш рецепт в книгу." + +#. type: Plain text +#: ../../cookbook/en/README.md +msgid "This book conforms to the [Terms of Yii Documentation](https://www.yiiframework.com/license#docs)." +msgstr "Книга следует [правилам для документации Yii](https://www.yiiframework.com/license#docs)." + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Preface](preface.md)" +msgstr "[Вступление](preface.md)" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +#, fuzzy +msgid "[Structuring code by use-case with vertical slices](organizing-code/structuring-by-use-case-with-vertical-slices.md)" +msgstr "[Организация кода по сценариям использования вертикальными слайсами](organizing-code/structuring-by-use-case-with-vertical-slices.md)" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Disabling CSRF protection](disabling-csrf-protection.md)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Sentry integration](sentry-integration.md)" +msgstr "[Интеграция с Sentry](sentry-integration.md)" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Configuring webservers](configuring-webservers/general.md)" +msgstr "[Конфигурирование веб-серверов](configuring-webservers/general.md)" diff --git a/_translations/cookbook/po/ru/configuring-webservers_apache.md.po b/_translations/cookbook/po/ru/configuring-webservers_apache.md.po new file mode 100644 index 00000000..bc44341f --- /dev/null +++ b/_translations/cookbook/po/ru/configuring-webservers_apache.md.po @@ -0,0 +1,87 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/configuring-webservers/apache.md +#, no-wrap +msgid "Configuring web servers: Apache" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/apache.md +msgid "Use the following configuration in Apache's `httpd.conf` file or within a virtual host configuration. Note that you should replace `path/to/app/public` with the actual path for `app/public`." +msgstr "" + +#. type: Fenced code block (apacheconfig) +#: en/configuring-webservers/apache.md +#, no-wrap +msgid "" +"# Set document root to be \"app/public\"\n" +"DocumentRoot \"path/to/app/public\"\n" +"\n" +"\n" +" # use mod_rewrite for pretty URL support\n" +" RewriteEngine on\n" +" \n" +" # if $showScriptName is false in UrlManager, do not allow accessing URLs with script name\n" +" RewriteRule ^index.php/ - [L,R=404]\n" +" \n" +" # If a directory or a file exists, use the request directly\n" +" RewriteCond %{REQUEST_FILENAME} !-f\n" +" RewriteCond %{REQUEST_FILENAME} !-d\n" +" \n" +" # Otherwise forward the request to index.php\n" +" RewriteRule . index.php\n" +" \n" +" SetEnv APP_ENV dev\n" +"\n" +" # ...other settings...\n" +"\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/apache.md +msgid "In case you have `AllowOverride All` you can add `.htaccess` file with the following configuration instead of using `httpd.conf`:" +msgstr "" + +#. type: Fenced code block (apacheconfig) +#: en/configuring-webservers/apache.md +#, no-wrap +msgid "" +"# use mod_rewrite for pretty URL support\n" +"RewriteEngine on\n" +"\n" +"# if $showScriptName is false in UrlManager, do not allow accessing URLs with script name\n" +"RewriteRule ^index.php/ - [L,R=404]\n" +"\n" +"# If a directory or a file exists, use the request directly\n" +"RewriteCond %{REQUEST_FILENAME} !-f\n" +"RewriteCond %{REQUEST_FILENAME} !-d\n" +"\n" +"# Otherwise forward the request to index.php\n" +"RewriteRule . index.php\n" +"\n" +"SetEnv APP_ENV dev\n" +"\n" +"# ...other settings...\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/apache.md +msgid "In the above, note the usage of `SetEnv`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`." +msgstr "" diff --git a/_translations/cookbook/po/ru/configuring-webservers_general.md.po b/_translations/cookbook/po/ru/configuring-webservers_general.md.po new file mode 100644 index 00000000..2705fbd2 --- /dev/null +++ b/_translations/cookbook/po/ru/configuring-webservers_general.md.po @@ -0,0 +1,68 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/configuring-webservers/general.md +#, no-wrap +msgid "Configuring web servers: General" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/general.md +msgid "On a production server, if you don't use Docker, configure your web server to serve only the application's public files. Point the document root of your web server to the `app/public` folder." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/general.md +#, no-wrap +msgid "" +"> [!IMPORTANT]\n" +"> If you're running your Yii application behind a reverse proxy, you might need to configure\n" +"> [Trusted proxies and headers](../../../guide/en/security/trusted-request.md).\n" +msgstr "" + +#. type: Title ## +#: en/configuring-webservers/general.md +#, no-wrap +msgid "Specific server configurations" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Nginx](nginx.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Apache](apache.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Lighttpd](lighttpd.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Nginx Unit](nginx-unit.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[IIS](iis.md)" +msgstr "" diff --git a/_translations/cookbook/po/ru/configuring-webservers_iis.md.po b/_translations/cookbook/po/ru/configuring-webservers_iis.md.po new file mode 100644 index 00000000..b4199c91 --- /dev/null +++ b/_translations/cookbook/po/ru/configuring-webservers_iis.md.po @@ -0,0 +1,69 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/configuring-webservers/iis.md +#, no-wrap +msgid "Configuring web servers: IIS" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/iis.md +msgid "When you use [IIS](https://www.iis.net/), host the application in a virtual host (Website) where the document root points to the `path/to/app/public` folder and configure the website to run PHP. In that `public` folder, place a file named `web.config` at `path/to/app/public/web.config`. Use the following content:" +msgstr "" + +#. type: Fenced code block (xml) +#: en/configuring-webservers/iis.md +#, no-wrap +msgid "" +"\n" +"\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +"\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/iis.md +msgid "Also, the following list of Microsoft's official resources could be useful to configure PHP on IIS:" +msgstr "" + +#. type: Bullet: '1. ' +#: en/configuring-webservers/iis.md +msgid "[How to set up your first IIS website](https://support.microsoft.com/en-us/help/323972/how-to-set-up-your-first-iis-web-site)" +msgstr "" + +#. type: Bullet: '2. ' +#: en/configuring-webservers/iis.md +msgid "[Configure a PHP Website on IIS](https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configure-a-php-website-on-iis)" +msgstr "" diff --git a/_translations/cookbook/po/ru/configuring-webservers_lighttpd.md.po b/_translations/cookbook/po/ru/configuring-webservers_lighttpd.md.po new file mode 100644 index 00000000..c596512d --- /dev/null +++ b/_translations/cookbook/po/ru/configuring-webservers_lighttpd.md.po @@ -0,0 +1,35 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/configuring-webservers/lighttpd.md +#, no-wrap +msgid "Configuring web servers: lighttpd" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/lighttpd.md +#, no-wrap +msgid "To use [lighttpd](https://www.lighttpd.net/) >= 1.4.24, put `index.php` in the web root and add the following to the configuration:\n" +msgstr "" + +#. type: Fenced code block +#: en/configuring-webservers/lighttpd.md +#, no-wrap +msgid "url.rewrite-if-not-file = (\"(.*)\" => \"/index.php/$0\")\n" +msgstr "" diff --git a/_translations/cookbook/po/ru/configuring-webservers_nginx-unit.md.po b/_translations/cookbook/po/ru/configuring-webservers_nginx-unit.md.po new file mode 100644 index 00000000..3b1e9223 --- /dev/null +++ b/_translations/cookbook/po/ru/configuring-webservers_nginx-unit.md.po @@ -0,0 +1,97 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/configuring-webservers/nginx-unit.md +#, no-wrap +msgid "Configuring web servers: NGINX Unit" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx-unit.md +msgid "Run Yii-based apps using [NGINX Unit](https://unit.nginx.org/) with a PHP language module. Here is a sample configuration." +msgstr "" + +#. type: Fenced code block (json) +#: en/configuring-webservers/nginx-unit.md +#, no-wrap +msgid "" +"{\n" +" \"listeners\": {\n" +" \"*:80\": {\n" +" \"pass\": \"routes/yii\"\n" +" }\n" +" },\n" +"\n" +" \"routes\": {\n" +" \"yii\": [\n" +" {\n" +" \"match\": {\n" +" \"uri\": [\n" +" \"!/assets/*\",\n" +" \"*.php\",\n" +" \"*.php/*\"\n" +" ]\n" +" },\n" +"\n" +" \"action\": {\n" +" \"pass\": \"applications/yii/direct\"\n" +" }\n" +" },\n" +" {\n" +" \"action\": {\n" +" \"share\": \"/path/to/app/public/\",\n" +" \"fallback\": {\n" +" \"pass\": \"applications/yii/index\"\n" +" }\n" +" }\n" +" }\n" +" ]\n" +" },\n" +"\n" +" \"applications\": {\n" +" \"yii\": {\n" +" \"type\": \"php\",\n" +" \"user\": \"www-data\",\n" +" \"environment\": {\n" +" \"APP_ENV\": \"dev\"\n" +" },\n" +" \"targets\": {\n" +" \"direct\": {\n" +" \"root\": \"/path/to/app/public/\"\n" +" },\n" +"\n" +" \"index\": {\n" +" \"root\": \"/path/to/app/public/\",\n" +" \"script\": \"index.php\"\n" +" }\n" +" }\n" +" }\n" +" }\n" +"}\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx-unit.md +msgid "You can also [set up](https://unit.nginx.org/configuration/#php) your PHP environment or supply a custom `php.ini` in the same configuration." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx-unit.md +msgid "In the above, note the usage of `environment`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`." +msgstr "" diff --git a/_translations/cookbook/po/ru/configuring-webservers_nginx.md.po b/_translations/cookbook/po/ru/configuring-webservers_nginx.md.po new file mode 100644 index 00000000..50c24baa --- /dev/null +++ b/_translations/cookbook/po/ru/configuring-webservers_nginx.md.po @@ -0,0 +1,92 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/configuring-webservers/nginx.md +#, no-wrap +msgid "Configuring web servers: Nginx" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "To use [Nginx](https://wiki.nginx.org/), install PHP as an [FPM SAPI](https://secure.php.net/install.fpm). Use the following Nginx configuration, replacing `path/to/app/public` with the actual path for `app/public` and `mysite.test` with the actual hostname to serve." +msgstr "" + +#. type: Fenced code block (nginx) +#: en/configuring-webservers/nginx.md +#, no-wrap +msgid "" +"server {\n" +" charset utf-8;\n" +" client_max_body_size 128M;\n" +"\n" +" listen 80; ## listen for ipv4\n" +" #listen [::]:80 default_server ipv6only=on; ## listen for ipv6\n" +"\n" +" server_name mysite.test;\n" +" root /path/to/app/public;\n" +" index index.php;\n" +"\n" +" access_log /path/to/basic/log/access.log;\n" +" error_log /path/to/basic/log/error.log;\n" +"\n" +" location / {\n" +" # Redirect everything that isn't a real file to index.php\n" +" try_files $uri $uri/ /index.php$is_args$args;\n" +" }\n" +"\n" +" # uncomment to avoid processing of calls to non-existing static files by Yii\n" +" #location ~ \\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {\n" +" # try_files $uri =404;\n" +" #}\n" +" #error_page 404 /404.html;\n" +"\n" +" # deny accessing php files for the /assets directory\n" +" location ~ ^/assets/.*\\.php$ {\n" +" deny all;\n" +" }\n" +"\n" +" location ~ \\.php$ {\n" +" include fastcgi_params;\n" +" fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n" +" fastcgi_pass 127.0.0.1:9000;\n" +" #fastcgi_pass unix:/var/run/php8-fpm.sock;\n" +" try_files $uri =404;\n" +" fastcgi_param APP_ENV \"dev\";\n" +" }\n" +"\n" +" location ~* /\\. {\n" +" deny all;\n" +" }\n" +"}\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "When you use this configuration, also set `cgi.fix_pathinfo=0` in the `php.ini` file to avoid many unnecessary system `stat()` calls." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "Also, note that when running an HTTPS server, you need to add `fastcgi_param HTTPS on;` so that Yii can detect if a connection is secure." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "In the above, note the usage of `fastcgi_param APP_ENV`. Since the Yii3 application template is using environment variables, this is a possible place to set them. In production environment remember to set `APP_ENV` to `prod`." +msgstr "" diff --git a/_translations/cookbook/po/ru/disabling-csrf-protection.md.po b/_translations/cookbook/po/ru/disabling-csrf-protection.md.po new file mode 100644 index 00000000..59a87ac6 --- /dev/null +++ b/_translations/cookbook/po/ru/disabling-csrf-protection.md.po @@ -0,0 +1,350 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-12 09:47+0500\n" +"PO-Revision-Date: 2025-09-12 09:47+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Disabling CSRF protection" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "What is CSRF protection?" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "Cross-Site Request Forgery (CSRF) protection is a security mechanism that prevents malicious websites from making unauthorized requests on behalf of authenticated users. Yii3 includes built-in CSRF protection through the `Yiisoft\\Yii\\Web\\Middleware\\Csrf` middleware." +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "For a comprehensive understanding of CSRF attacks and protection mechanisms, see the [Security best practices](../../guide/en/security/best-practices.md#avoiding-csrf) section in the main guide." +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "When to disable CSRF protection" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "While CSRF protection should generally remain enabled for web applications, there are specific scenarios where you might need to disable it:" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "When external systems cannot provide CSRF tokens" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "When building APIs or handling automated requests from external systems, CSRF protection can interfere with legitimate requests since these systems cannot provide valid CSRF tokens:" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Third-party integrations**: External services cannot provide valid CSRF tokens" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Mobile applications**: Native mobile apps typically don't use cookies or sessions in the same way as web browsers" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Server-to-server communication**: API endpoints designed for machine-to-machine communication" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Payment processors**: PayPal, Stripe, and other payment systems send webhook notifications" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Version control systems**: GitHub, GitLab webhooks for CI/CD pipelines" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Social media platforms**: Twitter, Facebook webhook notifications" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Communication services**: Slack, Discord bot integrations" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "How to disable CSRF protection" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +#, fuzzy +#| msgid "That means you only need to add `SentryMiddleware` to the global middleware list in `config/web/application.php`:" +msgid "First, you need to remove CSRF middleware from your main application middleware list in `config/web/di/application.php`:" +msgstr "А это значит, что достаточно будет добавить `SentryMiddleware` в глобальный список `middleware` в `config/web/application.php`:" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, fuzzy, no-wrap +#| msgid "" +#| "return [\n" +#| " Yiisoft\\Yii\\Web\\Application::class => [\n" +#| " '__construct()' => [\n" +#| " 'dispatcher' => DynamicReference::to(static function (Injector $injector) {\n" +#| " return ($injector->make(MiddlewareDispatcher::class))\n" +#| " ->withMiddlewares(\n" +#| " [\n" +#| " Router::class,\n" +#| " SubFolder::class,\n" +#| "+ SentryMiddleware::class,\n" +#| " ErrorCatcher::class,\n" +#| " ]\n" +#| " );\n" +#| " }),\n" +#| " 'fallbackHandler' => Reference::to(NotFoundHandler::class),\n" +#| " ],\n" +#| " ],\n" +#| "];\n" +msgid "" +"return [\n" +" Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to([\n" +" 'class' => MiddlewareDispatcher::class,\n" +" 'withMiddlewares()' => [\n" +" [\n" +" ErrorCatcher::class,\n" +" SessionMiddleware::class,\n" +" CsrfTokenMiddleware::class, // <- Remove this line \n" +msgstr "" +"return [\n" +" Yiisoft\\Yii\\Web\\Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to(static function (Injector $injector) {\n" +" return ($injector->make(MiddlewareDispatcher::class))\n" +" ->withMiddlewares(\n" +" [\n" +" Router::class,\n" +" SubFolder::class,\n" +"+ SentryMiddleware::class,\n" +" ErrorCatcher::class,\n" +" ]\n" +" );\n" +" }),\n" +" 'fallbackHandler' => Reference::to(NotFoundHandler::class),\n" +" ],\n" +" ],\n" +"];\n" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "Now, if you need to leave CSRF on for specific routes or route groups, you can do so by adding the `CsrfMiddleware` middleware to the router configuration in `config/common/routes.php`. For a group that would be the following:" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"return [\n" +" Group::create()\n" +" ->middleware(CsrfTokenMiddleware::class)\n" +" ->routes(\n" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "For a single route, you can add the middleware directly to the route:" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"Route::methods([Method::GET, Method::POST], '/say[/{test}]')\n" +" ->action(\\App\\Controller\\Echo\\Action::class)\n" +" ->name('echo/say')\n" +" ->middleware(CsrfTokenMiddleware::class)\n" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, fuzzy, no-wrap +#| msgid "Sentry integration" +msgid "Security considerations" +msgstr "Интеграция с Sentry" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "When disabling CSRF protection, keep these security considerations in mind:" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Alternative authentication methods" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "For API endpoints, implement proper authentication mechanisms:" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**API keys**: Require API keys for authentication" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Bearer tokens**: Use JWT or similar token-based authentication" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**OAuth 2.0**: Implement OAuth 2.0 for third-party access" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**IP whitelisting**: Restrict access to known IP addresses for webhooks" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, fuzzy, no-wrap +#| msgid "Installation" +msgid "Request validation" +msgstr "Установка" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "Implement additional validation for requests without CSRF protection:" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Signature verification**: Verify webhook signatures (e.g., GitHub's X-Hub-Signature)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Timestamp validation**: Check request timestamps to prevent replay attacks" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Rate limiting**: Implement rate limiting to prevent abuse" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Input validation**: Strictly validate all input parameters" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Example: Webhook signature verification" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"getHeaderLine('X-Webhook-Signature');\n" +" $payload = (string) $request->getBody();\n" +" $expectedSignature = hash_hmac('sha256', $payload, $this->webhookSecret);\n" +" \n" +" if (!hash_equals($signature, $expectedSignature)) {\n" +" throw new \\RuntimeException('Invalid webhook signature');\n" +" }\n" +" \n" +" // Process webhook payload\n" +" // ...\n" +" }\n" +"}\n" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Best practices" +msgstr "" + +#. type: Bullet: '1. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Minimize exposure**: Only disable CSRF protection where absolutely necessary" +msgstr "" + +#. type: Bullet: '2. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Use HTTPS**: Always use HTTPS for API endpoints and webhooks" +msgstr "" + +#. type: Bullet: '3. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Monitor logs**: Log all requests to API endpoints for security monitoring" +msgstr "" + +#. type: Bullet: '4. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Regular security audits**: Periodically review your API endpoints and their security measures" +msgstr "" + +#. type: Bullet: '5. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Documentation**: Clearly document which endpoints have CSRF protection disabled and why" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Conclusion" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "While CSRF protection is crucial for web applications, there are legitimate scenarios where it needs to be disabled, particularly for external APIs and webhooks. When disabling CSRF protection, always implement alternative security measures and follow security best practices to maintain the overall security of your application." +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "Remember that disabling CSRF protection increases security risks, so careful consideration and proper implementation of alternative security measures are essential." +msgstr "" diff --git a/_translations/cookbook/po/ru/organizing-code_structuring-by-use-case-with-vertical-slices.md.po b/_translations/cookbook/po/ru/organizing-code_structuring-by-use-case-with-vertical-slices.md.po new file mode 100644 index 00000000..bc0ca2cf --- /dev/null +++ b/_translations/cookbook/po/ru/organizing-code_structuring-by-use-case-with-vertical-slices.md.po @@ -0,0 +1,114 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: 2025-09-05 14:50+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. type: Title # +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +#, no-wrap +msgid "Structuring code by use-case with vertical slices" +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "When building an application, it's important to organize the code in a way that makes it easy to understand, support, and scale. One popular approach is to structure the code by use-case with vertical slices." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "Vertical slices are self-contained pieces of functionality that cover the entire stack, from the user interface to the data access layer. Developer organizes each slice around a specific use case, such as creating a new user or updating a product." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "When structuring code classically by type (such as models, views, controllers, helpers, etc.), it can be easy to lose sight of the bigger picture and how different pieces of code interact to support specific features or use cases. This can lead to code duplication, tight coupling, and poor maintainability as the application grows." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "On the other hand, structuring code by use-case makes developers focus on a specific feature or workflow and understand how different pieces of code work together to support that feature. This approach also helps to keep related code together in a single directory, making it easier to navigate and support. Vertical slicing also encourages the use of domain-driven design concepts, such as entities, repositories, and services, which can help to promote good separation of concerns and modularity." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "Additionally, structuring code by use-case can make it easier to test and debug the application since use-case namespace encapsulates each feature or workflow in its own directory with clear boundaries and well-defined interfaces." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "Here's an example directory structure for a PHP application organized using vertical slices:" +msgstr "" + +#. type: Fenced code block +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +#, no-wrap +msgid "" +"src/\n" +"└── Blog/\n" +" ├── Model/\n" +" │ ├── Comment.php\n" +" │ ├── CommentRepository.php\n" +" │ ├── Post.php\n" +" │ └── PostRepository.php\n" +" ├── Service/ \n" +" │ └── MarkdownProcessor.php\n" +" ├── UseCase/\n" +" │ ├── CreateComment/\n" +" │ │ ├── CreateCommentAction.php\n" +" │ │ ├── CreateCommentRequest.php\n" +" │ ├── CreatePost/\n" +" │ │ ├── CreatePostAction.php\n" +" │ │ ├── CreatePostRequest.php\n" +" │ ├── DeleteComment/\n" +" │ │ ├── DeleteCommentAction.php\n" +" │ │ ├── DeleteCommentRequest.php\n" +" │ ├── DeletePost/\n" +" │ │ ├── DeletePostAction.php\n" +" │ │ ├── DeletePostRequest.php\n" +" │ ├── ListComments/\n" +" │ │ ├── ListCommentsAction.php\n" +" │ ├── ListPosts/\n" +" │ │ ├── ListPostsAction.php\n" +" │ ├── UpdatePost/\n" +" │ │ ├── UpdatePostAction.php\n" +" │ │ ├── UpdatePostRequest.php\n" +" │ ├── ViewPost/\n" +" │ │ ├── ViewPostAction.php\n" +" │ ├── Rss/\n" +" │ │ ├── RssAction.php\n" +" | | ├── RssBuilder.php\n" +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "Each vertical slice has its own directory, which has code associated with the use case." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "The use-case subdirectories and their respective classes are organized by type within each directory, omitting a directory if there's a single class of the type. If code is shared between multiple use-cases, it's moved one level up such as `Model` or `Service`." +msgstr "" + +#. type: Title ## +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +#, no-wrap +msgid "References" +msgstr "" + +#. type: Bullet: '- ' +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "[Application structure overview](https://github.com/yiisoft/docs/blob/master/guide/en/structure/overview.md)" +msgstr "" diff --git a/_translations/cookbook/po/ru/preface.md.po b/_translations/cookbook/po/ru/preface.md.po new file mode 100644 index 00000000..196a56a9 --- /dev/null +++ b/_translations/cookbook/po/ru/preface.md.po @@ -0,0 +1,96 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2025-09-05 14:52+0500\n" +"PO-Revision-Date: 2025-09-05 15:08+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 3.7\n" + +#. type: Title # +#: en/preface.md +#, no-wrap +msgid "Preface" +msgstr "Вступление" + +#. type: Plain text +#: en/preface.md +msgid "Yii is a high-performance, package-based PHP framework for developing modern applications. The name Yii (pronounced `Yee` or `[ji:]`) means \"simple and evolutionary\" in Chinese. You can also think about it as an acronym for **Yes It Is**!" +msgstr "" +"Yii — высокопроизводительный компонентный PHP фреймворк для быстрой разработки современных веб-приложений.\n" +"Имя Yii (произносится как `Yee` или `[ji:]`) означает \"простой и эволюционирующий\" по-китайски. Также оно может\n" +"расшифровываться как акроним **Yes It Is**!" + +#. type: Plain text +#: en/preface.md +msgid "Yii is a generic Web programming framework. You can use it for developing all kinds of Web applications using PHP. Because of its architecture and sophisticated caching support, it's especially suitable for developing large-scale applications such as portals, content management systems, e-commerce, REST APIs, etc." +msgstr "" +"Yii является веб-фреймворком общего назначения. Он может использоваться для разработки любых типов приложений.\n" +"Благодаря компонентной архитектуре и хорошей поддержке кеширования, фреймворк отлично подходит для разработки\n" +"масштабных приложений, таких как порталы, форумы, CMS, магазины, REST API и так далее." + +#. type: Plain text +#: en/preface.md +msgid "With comprehensive documentation and an enthusiastic user community, Yii can significantly reduce your development time in the long run." +msgstr "" +"Полная документация и активное сообщество Yii позволяют значительно выиграть во времени разработки проектов\n" +"в долгосрочной перспективе." + +#. type: Title ## +#: en/preface.md +#, no-wrap +msgid "What's the book about" +msgstr "О чём эта книга?" + +#. type: Plain text +#: en/preface.md +msgid "This book is for you if you're familiar with Yii3, building Yii applications, and read the official Yii3 guide. It covers fundamentally important development concepts, application architecture approaches, integrating third party services with Yii3, etc." +msgstr "" +"Это книга для тех, кто уже знаком с Yii3, делает на нём проекты, прочитал основную документацию. Она затрагивает\n" +"фундаментально важные принципы разработки, подходы к архитектуре, интеграцию различных сервисов в Yii3 и так далее." + +#. type: Plain text +#: en/preface.md +msgid "The book consists of individual recipes gathered from Yii experts that you can apply in your applications. These go by topic, but you are free to read them in any order as there is no dependency between them." +msgstr "" +"Книга состоит из отдельных рецептов, написанных экспертами по фреймворку. Рецепты объединены по теме, но вы можете\n" +"читать из в любом порядке так один не зависит от другого." + +#. type: Title ## +#: en/preface.md +#, no-wrap +msgid "Prerequisites" +msgstr "Что понадобится перед чтением?" + +#. type: Bullet: '- ' +#: en/preface.md +msgid "You should have Yii3 installed." +msgstr "Установленный Yii3." + +#. type: Bullet: '- ' +#: en/preface.md +msgid "You should be familiar with the framework basics and the official guide." +msgstr "Вы должны быть уже знакомы с фреймворком и его документацией." + +#. type: Title ## +#: en/preface.md +#, no-wrap +msgid "How to participate" +msgstr "Как помочь?" + +#. type: Plain text +#: en/preface.md +msgid "If you've found any errata, wrong information, want to improve something or have a good recipe, create an issue or make a pull request in [the book GitHub repository](https://github.com/yiisoft/docs)." +msgstr "" +"Если нашли описки, некорректную информацию, знаете как что-либо улучшить или же у вас есть новый рецепт для книги,\n" +"создайте issue или сделайте pull request [в репозиторий книги на GitHub](https://github.com/yiisoft/docs)." diff --git a/_translations/cookbook/po/ru/sentry-integration.md.po b/_translations/cookbook/po/ru/sentry-integration.md.po new file mode 100644 index 00000000..196f53d2 --- /dev/null +++ b/_translations/cookbook/po/ru/sentry-integration.md.po @@ -0,0 +1,293 @@ +# Russian translations for PACKAGE package +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2025-09-05 14:52+0500\n" +"PO-Revision-Date: 2025-09-05 15:19+0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 3.7\n" + +#. type: Title # +#: en/sentry-integration.md +#, no-wrap +msgid "Sentry integration" +msgstr "Интеграция с Sentry" + +#. type: Title ## +#: en/sentry-integration.md +#, no-wrap +msgid "What is Sentry" +msgstr "Что такое Sentry" + +#. type: Plain text +#: en/sentry-integration.md +#, no-wrap +msgid "" +"[Sentry](https://sentry.io/) is a tool for monitoring and debugging application stability and performance.\n" +"Sentry gives you access to the events that you send there from your application.\n" +msgstr "" +"[Sentry](https://sentry.io/) – это инструмент мониторинга и отладки производительности и стабильности.\n" +"Sentry представляет доступ к событиям, которые вы отправите туда из вашего приложения.\n" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Most often, Sentry is used for monitoring errors (exceptions). You can enrich errors with context to better understand the problem: - Request arguments - Tags for grouping exceptions - Environment state: environment variables, application state, and other global attributes" +msgstr "" +"Чаще всего Sentry используется для мониторинга ошибок (исключений). \n" +"Ошибки можно \"обогатить\" контекстом для лучшего понимания вызванной проблемы: \n" +"- Аргументы, с которыми вызывалось приложение\n" +"- Теги, для группировки исключений\n" +"- Состояние среды окружения: переменные окружения, состояние приложения и прочие \"глобальные\" аттрибуты" + +#. type: Plain text +#: en/sentry-integration.md +msgid "You can find the full list of features on the official website: https://sentry.io/welcome/" +msgstr "Полный список всех возможностей можно найти на официальном сайте: https://sentry.io/welcome/" + +#. type: Title ## +#: en/sentry-integration.md +#, no-wrap +msgid "Installation" +msgstr "Установка" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Install the package" +msgstr "Установка пакета" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Install the required package `yiisoft/yii-sentry` with the following command:" +msgstr "Для установки нужного пакета установите пакет `yiisoft/yii-sentry` следующей командой:" + +#. type: Fenced code block (shell) +#: en/sentry-integration.md +#, no-wrap +msgid "composer require yiisoft/yii-sentry --prefer-dist\n" +msgstr "composer require yiisoft/yii-sentry --prefer-dist\n" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Install an HTTP driver" +msgstr "Установка HTTP-драйвера" + +#. type: Plain text +#: en/sentry-integration.md +msgid "The [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) library requires the `php-http/httplug` package and any HTTP driver. In the example below we’ll use the Guzzle adapter." +msgstr "" +"Библиотека [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) требует установки `php-http/httplug` пакета и любого HTTP-драйвера. \n" +"Для примеры используется адаптер `Guzzle`." + +#. type: Plain text +#: en/sentry-integration.md +#, no-wrap +msgid "> You can find the list of all adapters on [this page](https://docs.php-http.org/en/latest/clients.html#clients-adapters).\n" +msgstr "> Список всех адаптеров можно найти на [этой](https://docs.php-http.org/en/latest/clients.html#clients-adapters) странице.\n" + +#. type: Plain text +#: en/sentry-integration.md +msgid "To install the packages, run the following command:" +msgstr "Для установки пакетов выполните в консоли следующую команду:" + +#. type: Fenced code block (shell) +#: en/sentry-integration.md +#, no-wrap +msgid "composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist\n" +msgstr "composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist\n" + +#. type: Title ## +#: en/sentry-integration.md +#, no-wrap +msgid "Configuration" +msgstr "Настройка" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Get and store the token" +msgstr "Получение и сохранение токена" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Next, configure the application." +msgstr "Далее сконфигурируем приложение." + +#. type: Plain text +#: en/sentry-integration.md +msgid "First, register at [Sentry](https://sentry.io) and create a project." +msgstr "Для начала зарегистрируйтесь в [Sentry](https://sentry.io) и создайте проект." + +#. type: Plain text +#: en/sentry-integration.md +msgid "Then, in the project settings on the “General Settings” tab, find the “Security Token” field and copy its value." +msgstr "Далее в настройках проекта, на вкладке `General Settings`, найдите поле `Security Token` и скопируйте оттуда значение." + +#. type: Plain text +#: en/sentry-integration.md +#, no-wrap +msgid "" +"Now put this token into the package configuration. By default, the config is located at `config/packages/yiisoft/yii-sentry/config/params.php`.\n" +"Set the copied token as the value of the array element at `yiisoft/yii-sentry` => `options` => `dsn`. Example:\n" +msgstr "" +"Теперь положите этот токен в настройки пакета. По умолчанию конфиг лежит в `config/packages/yiisoft/yii-sentry/config/params.php`.\n" +"Скопированный токен запишите в значение элемента массива по ключу `yiisoft/yii-sentry` => `options` => `dsn`. Пример:\n" + +#. type: Fenced code block (diff) +#: en/sentry-integration.md +#, no-wrap +msgid "" +"'yiisoft/yii-sentry' => [\n" +" 'enabled' => true,\n" +" 'options' => [\n" +"- 'dsn' => '',\n" +"+ 'dsn' => 'TOKEN',\n" +" ],\n" +"],\n" +msgstr "" +"'yiisoft/yii-sentry' => [\n" +" 'enabled' => true,\n" +" 'options' => [\n" +"- 'dsn' => '',\n" +"+ 'dsn' => 'ТОКЕН',\n" +" ],\n" +"],\n" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Configure the HTTP client" +msgstr "Настройка HTTP-клиента" + +#. type: Plain text +#: en/sentry-integration.md +msgid "After installing the HTTP client, configure it." +msgstr "После установки HTTP-клиента, сконфигурируйте его." + +#. type: Plain text +#: en/sentry-integration.md +msgid "Create the file `config/common/sentry.php` and put the following code into it:" +msgstr "Создайте файл `config/common/sentry.php` и положите в него следующий код:" + +#. type: Fenced code block (php) +#: en/sentry-integration.md +#, no-wrap +msgid "" +" \\GuzzleHttp\\Client::class,\n" +" \\Http\\Client\\HttpAsyncClient::class => [\n" +" 'class' => \\Http\\Adapter\\Guzzle7\\Client::class,\n" +" '__construct()' => [\n" +" \\Yiisoft\\Factory\\Definition\\Reference::to(\\Http\\Client\\HttpClient::class),\n" +" ],\n" +" ],\n" +"];\n" +msgstr "" +" \\GuzzleHttp\\Client::class,\n" +" \\Http\\Client\\HttpAsyncClient::class => [\n" +" 'class' => \\Http\\Adapter\\Guzzle7\\Client::class,\n" +" '__construct()' => [\n" +" \\Yiisoft\\Factory\\Definition\\Reference::to(\\Http\\Client\\HttpClient::class),\n" +" ],\n" +" ],\n" +"];\n" + +#. type: Title # +#: en/sentry-integration.md +#, no-wrap +msgid "Integration" +msgstr "Интеграция" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Web" +msgstr "Веб" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Sentry support for `web` is implemented as middleware." +msgstr "Поддержка Sentry для `web` реализована как `middleware`." + +#. type: Plain text +#: en/sentry-integration.md +msgid "That means you only need to add `SentryMiddleware` to the global middleware list in `config/web/application.php`:" +msgstr "А это значит, что достаточно будет добавить `SentryMiddleware` в глобальный список `middleware` в `config/web/application.php`:" + +#. type: Fenced code block (diff) +#: en/sentry-integration.md +#, no-wrap +msgid "" +"return [\n" +" Yiisoft\\Yii\\Web\\Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to(static function (Injector $injector) {\n" +" return ($injector->make(MiddlewareDispatcher::class))\n" +" ->withMiddlewares(\n" +" [\n" +" Router::class,\n" +" SubFolder::class,\n" +"+ SentryMiddleware::class,\n" +" ErrorCatcher::class,\n" +" ]\n" +" );\n" +" }),\n" +" 'fallbackHandler' => Reference::to(NotFoundHandler::class),\n" +" ],\n" +" ],\n" +"];\n" +msgstr "" +"return [\n" +" Yiisoft\\Yii\\Web\\Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to(static function (Injector $injector) {\n" +" return ($injector->make(MiddlewareDispatcher::class))\n" +" ->withMiddlewares(\n" +" [\n" +" Router::class,\n" +" SubFolder::class,\n" +"+ SentryMiddleware::class,\n" +" ErrorCatcher::class,\n" +" ]\n" +" );\n" +" }),\n" +" 'fallbackHandler' => Reference::to(NotFoundHandler::class),\n" +" ],\n" +" ],\n" +"];\n" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Console" +msgstr "Консоль" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Sentry supports `console` via a handler for the [ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event) event." +msgstr "Sentry поддерживает `console` в виде обработчика события [ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event)." + +#. type: Plain text +#: en/sentry-integration.md +msgid "The package provides a configuration file that automatically subscribes the application to this event." +msgstr "Пакет предоставляет конфигурационный файл, который автоматически подписывает приложение на это событие." diff --git a/_translations/cookbook/po4a.cfg b/_translations/cookbook/po4a.cfg new file mode 100644 index 00000000..9b16a210 --- /dev/null +++ b/_translations/cookbook/po4a.cfg @@ -0,0 +1,20 @@ +[po4a_langs] ru + +[po4a_paths] pot/$master.pot $lang:po/$lang/$master.po +[options] opt:"--verbose" opt:"--addendum-charset=UTF-8" opt:"--localized-charset=UTF-8" opt:"--master-charset=UTF-8" opt:"--master-language=en_US" opt:"--porefs=file" opt:"--msgmerge-opt='--no-wrap'" opt:"--wrap-po=newlines" +[po4a_alias:markdown] text opt:"--option markdown" opt:"--option keyvalue" opt:"--option yfm_keys=title,description,menu_title" opt:"--addendum-charset=UTF-8" opt:"--localized-charset=UTF-8" opt:"--master-charset=UTF-8" opt:"--keep=5" + + +[type: markdown] ../../cookbook/en/preface.md $lang:../../cookbook/$lang/preface.md +[type: markdown] ../../cookbook/en/README.md $lang:../../cookbook/$lang/README.md +[type: markdown] ../../cookbook/en/sentry-integration.md $lang:../../cookbook/$lang/sentry-integration.md +[type: markdown] ../../cookbook/en/disabling-csrf-protection.md $lang:../../cookbook/$lang/disabling-csrf-protection.md + +[type: markdown] ../../cookbook/en/configuring-webservers/apache.md $lang:../../cookbook/$lang/configuring-webservers/apache.md pot=configuring-webservers_apache.md +[type: markdown] ../../cookbook/en/configuring-webservers/general.md $lang:../../cookbook/$lang/configuring-webservers/general.md pot=configuring-webservers_general.md +[type: markdown] ../../cookbook/en/configuring-webservers/iis.md $lang:../../cookbook/$lang/configuring-webservers/iis.md pot=configuring-webservers_iis.md +[type: markdown] ../../cookbook/en/configuring-webservers/lighttpd.md $lang:../../cookbook/$lang/configuring-webservers/lighttpd.md pot=configuring-webservers_lighttpd.md +[type: markdown] ../../cookbook/en/configuring-webservers/nginx-unit.md $lang:../../cookbook/$lang/configuring-webservers/nginx-unit.md pot=configuring-webservers_nginx-unit.md +[type: markdown] ../../cookbook/en/configuring-webservers/nginx.md $lang:../../cookbook/$lang/configuring-webservers/nginx.md pot=configuring-webservers_nginx.md + +[type: markdown] ../../cookbook/en/organizing-code/structuring-by-use-case-with-vertical-slices.md $lang:../../cookbook/$lang/organizing-code/structuring-by-use-case-with-vertical-slices.md pot=organizing-code_structuring-by-use-case-with-vertical-slices.md diff --git a/_translations/cookbook/pot/README.md.pot b/_translations/cookbook/pot/README.md.pot new file mode 100644 index 00000000..5f6d60b3 --- /dev/null +++ b/_translations/cookbook/pot/README.md.pot @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-12 09:45+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: ../../cookbook/en/README.md +#, no-wrap +msgid "Yii3 community cookbook" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/README.md +msgid "" +"Yii3 Community Cookbook is an OpenSource book full of tips and tricks about " +"the [Yii3](https://www.yiiframework.com/) PHP framework." +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "The Yii community creates the cookbook." +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "Yii core team members curate and edit it." +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/README.md +msgid "" +"Feel free to pull-request your own writings. Team members will review it, " +"give feedback and merge the best possible way." +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/README.md +msgid "" +"This book conforms to the [Terms of Yii Documentation](https://www." +"yiiframework.com/license#docs)." +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Preface](preface.md)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "" +"[Structuring code by use-case with vertical slices](organizing-code/" +"structuring-by-use-case-with-vertical-slices.md)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Disabling CSRF protection](disabling-csrf-protection.md)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Sentry integration](sentry-integration.md)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/README.md +msgid "[Configuring webservers](configuring-webservers/general.md)" +msgstr "" diff --git a/_translations/cookbook/pot/configuring-webservers_apache.md.pot b/_translations/cookbook/pot/configuring-webservers_apache.md.pot new file mode 100644 index 00000000..a0ba4ecb --- /dev/null +++ b/_translations/cookbook/pot/configuring-webservers_apache.md.pot @@ -0,0 +1,95 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/configuring-webservers/apache.md +#, no-wrap +msgid "Configuring web servers: Apache" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/apache.md +msgid "" +"Use the following configuration in Apache's `httpd.conf` file or within a " +"virtual host configuration. Note that you should replace `path/to/app/" +"public` with the actual path for `app/public`." +msgstr "" + +#. type: Fenced code block (apacheconfig) +#: en/configuring-webservers/apache.md +#, no-wrap +msgid "" +"# Set document root to be \"app/public\"\n" +"DocumentRoot \"path/to/app/public\"\n" +"\n" +"\n" +" # use mod_rewrite for pretty URL support\n" +" RewriteEngine on\n" +" \n" +" # if $showScriptName is false in UrlManager, do not allow accessing URLs with script name\n" +" RewriteRule ^index.php/ - [L,R=404]\n" +" \n" +" # If a directory or a file exists, use the request directly\n" +" RewriteCond %{REQUEST_FILENAME} !-f\n" +" RewriteCond %{REQUEST_FILENAME} !-d\n" +" \n" +" # Otherwise forward the request to index.php\n" +" RewriteRule . index.php\n" +" \n" +" SetEnv APP_ENV dev\n" +"\n" +" # ...other settings...\n" +"\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/apache.md +msgid "" +"In case you have `AllowOverride All` you can add `.htaccess` file with the " +"following configuration instead of using `httpd.conf`:" +msgstr "" + +#. type: Fenced code block (apacheconfig) +#: en/configuring-webservers/apache.md +#, no-wrap +msgid "" +"# use mod_rewrite for pretty URL support\n" +"RewriteEngine on\n" +"\n" +"# if $showScriptName is false in UrlManager, do not allow accessing URLs with script name\n" +"RewriteRule ^index.php/ - [L,R=404]\n" +"\n" +"# If a directory or a file exists, use the request directly\n" +"RewriteCond %{REQUEST_FILENAME} !-f\n" +"RewriteCond %{REQUEST_FILENAME} !-d\n" +"\n" +"# Otherwise forward the request to index.php\n" +"RewriteRule . index.php\n" +"\n" +"SetEnv APP_ENV dev\n" +"\n" +"# ...other settings...\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/apache.md +msgid "" +"In the above, note the usage of `SetEnv`. Since the Yii3 application " +"template is using environment variables, this is a possible place to set " +"them. In production environment remember to set `APP_ENV` to `prod`." +msgstr "" diff --git a/_translations/cookbook/pot/configuring-webservers_general.md.pot b/_translations/cookbook/pot/configuring-webservers_general.md.pot new file mode 100644 index 00000000..e651e68a --- /dev/null +++ b/_translations/cookbook/pot/configuring-webservers_general.md.pot @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/configuring-webservers/general.md +#, no-wrap +msgid "Configuring web servers: General" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/general.md +msgid "" +"On a production server, if you don't use Docker, configure your web server " +"to serve only the application's public files. Point the document root of " +"your web server to the `app/public` folder." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/general.md +#, no-wrap +msgid "" +"> [!IMPORTANT]\n" +"> If you're running your Yii application behind a reverse proxy, you might need to configure\n" +"> [Trusted proxies and headers](../../../guide/en/security/trusted-request.md).\n" +msgstr "" + +#. type: Title ## +#: en/configuring-webservers/general.md +#, no-wrap +msgid "Specific server configurations" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Nginx](nginx.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Apache](apache.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Lighttpd](lighttpd.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[Nginx Unit](nginx-unit.md)" +msgstr "" + +#. type: Bullet: '- ' +#: en/configuring-webservers/general.md +msgid "[IIS](iis.md)" +msgstr "" diff --git a/_translations/cookbook/pot/configuring-webservers_iis.md.pot b/_translations/cookbook/pot/configuring-webservers_iis.md.pot new file mode 100644 index 00000000..e50e7199 --- /dev/null +++ b/_translations/cookbook/pot/configuring-webservers_iis.md.pot @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/configuring-webservers/iis.md +#, no-wrap +msgid "Configuring web servers: IIS" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/iis.md +msgid "" +"When you use [IIS](https://www.iis.net/), host the application in a virtual " +"host (Website) where the document root points to the `path/to/app/public` " +"folder and configure the website to run PHP. In that `public` folder, place " +"a file named `web.config` at `path/to/app/public/web.config`. Use the " +"following content:" +msgstr "" + +#. type: Fenced code block (xml) +#: en/configuring-webservers/iis.md +#, no-wrap +msgid "" +"\n" +"\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +"\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/iis.md +msgid "" +"Also, the following list of Microsoft's official resources could be useful " +"to configure PHP on IIS:" +msgstr "" + +#. type: Bullet: '1. ' +#: en/configuring-webservers/iis.md +msgid "" +"[How to set up your first IIS website](https://support.microsoft.com/en-us/" +"help/323972/how-to-set-up-your-first-iis-web-site)" +msgstr "" + +#. type: Bullet: '2. ' +#: en/configuring-webservers/iis.md +msgid "" +"[Configure a PHP Website on IIS](https://docs.microsoft.com/en-us/iis/" +"application-frameworks/scenario-build-a-php-website-on-iis/configure-a-php-" +"website-on-iis)" +msgstr "" diff --git a/_translations/cookbook/pot/configuring-webservers_lighttpd.md.pot b/_translations/cookbook/pot/configuring-webservers_lighttpd.md.pot new file mode 100644 index 00000000..e72b246d --- /dev/null +++ b/_translations/cookbook/pot/configuring-webservers_lighttpd.md.pot @@ -0,0 +1,35 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/configuring-webservers/lighttpd.md +#, no-wrap +msgid "Configuring web servers: lighttpd" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/lighttpd.md +#, no-wrap +msgid "To use [lighttpd](https://www.lighttpd.net/) >= 1.4.24, put `index.php` in the web root and add the following to the configuration:\n" +msgstr "" + +#. type: Fenced code block +#: en/configuring-webservers/lighttpd.md +#, no-wrap +msgid "url.rewrite-if-not-file = (\"(.*)\" => \"/index.php/$0\")\n" +msgstr "" diff --git a/_translations/cookbook/pot/configuring-webservers_nginx-unit.md.pot b/_translations/cookbook/pot/configuring-webservers_nginx-unit.md.pot new file mode 100644 index 00000000..695521b3 --- /dev/null +++ b/_translations/cookbook/pot/configuring-webservers_nginx-unit.md.pot @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/configuring-webservers/nginx-unit.md +#, no-wrap +msgid "Configuring web servers: NGINX Unit" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx-unit.md +msgid "" +"Run Yii-based apps using [NGINX Unit](https://unit.nginx.org/) with a PHP " +"language module. Here is a sample configuration." +msgstr "" + +#. type: Fenced code block (json) +#: en/configuring-webservers/nginx-unit.md +#, no-wrap +msgid "" +"{\n" +" \"listeners\": {\n" +" \"*:80\": {\n" +" \"pass\": \"routes/yii\"\n" +" }\n" +" },\n" +"\n" +" \"routes\": {\n" +" \"yii\": [\n" +" {\n" +" \"match\": {\n" +" \"uri\": [\n" +" \"!/assets/*\",\n" +" \"*.php\",\n" +" \"*.php/*\"\n" +" ]\n" +" },\n" +"\n" +" \"action\": {\n" +" \"pass\": \"applications/yii/direct\"\n" +" }\n" +" },\n" +" {\n" +" \"action\": {\n" +" \"share\": \"/path/to/app/public/\",\n" +" \"fallback\": {\n" +" \"pass\": \"applications/yii/index\"\n" +" }\n" +" }\n" +" }\n" +" ]\n" +" },\n" +"\n" +" \"applications\": {\n" +" \"yii\": {\n" +" \"type\": \"php\",\n" +" \"user\": \"www-data\",\n" +" \"environment\": {\n" +" \"APP_ENV\": \"dev\"\n" +" },\n" +" \"targets\": {\n" +" \"direct\": {\n" +" \"root\": \"/path/to/app/public/\"\n" +" },\n" +"\n" +" \"index\": {\n" +" \"root\": \"/path/to/app/public/\",\n" +" \"script\": \"index.php\"\n" +" }\n" +" }\n" +" }\n" +" }\n" +"}\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx-unit.md +msgid "" +"You can also [set up](https://unit.nginx.org/configuration/#php) your PHP " +"environment or supply a custom `php.ini` in the same configuration." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx-unit.md +msgid "" +"In the above, note the usage of `environment`. Since the Yii3 application " +"template is using environment variables, this is a possible place to set " +"them. In production environment remember to set `APP_ENV` to `prod`." +msgstr "" diff --git a/_translations/cookbook/pot/configuring-webservers_nginx.md.pot b/_translations/cookbook/pot/configuring-webservers_nginx.md.pot new file mode 100644 index 00000000..ce1b74a0 --- /dev/null +++ b/_translations/cookbook/pot/configuring-webservers_nginx.md.pot @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/configuring-webservers/nginx.md +#, no-wrap +msgid "Configuring web servers: Nginx" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "" +"To use [Nginx](https://wiki.nginx.org/), install PHP as an [FPM SAPI]" +"(https://secure.php.net/install.fpm). Use the following Nginx " +"configuration, replacing `path/to/app/public` with the actual path for `app/" +"public` and `mysite.test` with the actual hostname to serve." +msgstr "" + +#. type: Fenced code block (nginx) +#: en/configuring-webservers/nginx.md +#, no-wrap +msgid "" +"server {\n" +" charset utf-8;\n" +" client_max_body_size 128M;\n" +"\n" +" listen 80; ## listen for ipv4\n" +" #listen [::]:80 default_server ipv6only=on; ## listen for ipv6\n" +"\n" +" server_name mysite.test;\n" +" root /path/to/app/public;\n" +" index index.php;\n" +"\n" +" access_log /path/to/basic/log/access.log;\n" +" error_log /path/to/basic/log/error.log;\n" +"\n" +" location / {\n" +" # Redirect everything that isn't a real file to index.php\n" +" try_files $uri $uri/ /index.php$is_args$args;\n" +" }\n" +"\n" +" # uncomment to avoid processing of calls to non-existing static files by Yii\n" +" #location ~ \\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {\n" +" # try_files $uri =404;\n" +" #}\n" +" #error_page 404 /404.html;\n" +"\n" +" # deny accessing php files for the /assets directory\n" +" location ~ ^/assets/.*\\.php$ {\n" +" deny all;\n" +" }\n" +"\n" +" location ~ \\.php$ {\n" +" include fastcgi_params;\n" +" fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n" +" fastcgi_pass 127.0.0.1:9000;\n" +" #fastcgi_pass unix:/var/run/php8-fpm.sock;\n" +" try_files $uri =404;\n" +" fastcgi_param APP_ENV \"dev\";\n" +" }\n" +"\n" +" location ~* /\\. {\n" +" deny all;\n" +" }\n" +"}\n" +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "" +"When you use this configuration, also set `cgi.fix_pathinfo=0` in the `php." +"ini` file to avoid many unnecessary system `stat()` calls." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "" +"Also, note that when running an HTTPS server, you need to add `fastcgi_param " +"HTTPS on;` so that Yii can detect if a connection is secure." +msgstr "" + +#. type: Plain text +#: en/configuring-webservers/nginx.md +msgid "" +"In the above, note the usage of `fastcgi_param APP_ENV`. Since the Yii3 " +"application template is using environment variables, this is a possible " +"place to set them. In production environment remember to set `APP_ENV` to " +"`prod`." +msgstr "" diff --git a/_translations/cookbook/pot/disabling-csrf-protection.md.pot b/_translations/cookbook/pot/disabling-csrf-protection.md.pot new file mode 100644 index 00000000..2bff158c --- /dev/null +++ b/_translations/cookbook/pot/disabling-csrf-protection.md.pot @@ -0,0 +1,355 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-12 09:47+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Disabling CSRF protection" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "What is CSRF protection?" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"Cross-Site Request Forgery (CSRF) protection is a security mechanism that " +"prevents malicious websites from making unauthorized requests on behalf of " +"authenticated users. Yii3 includes built-in CSRF protection through the " +"`Yiisoft\\Yii\\Web\\Middleware\\Csrf` middleware." +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"For a comprehensive understanding of CSRF attacks and protection mechanisms, " +"see the [Security best practices](../../guide/en/security/best-practices." +"md#avoiding-csrf) section in the main guide." +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "When to disable CSRF protection" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"While CSRF protection should generally remain enabled for web applications, " +"there are specific scenarios where you might need to disable it:" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "When external systems cannot provide CSRF tokens" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"When building APIs or handling automated requests from external systems, " +"CSRF protection can interfere with legitimate requests since these systems " +"cannot provide valid CSRF tokens:" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Third-party integrations**: External services cannot provide valid CSRF " +"tokens" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Mobile applications**: Native mobile apps typically don't use cookies or " +"sessions in the same way as web browsers" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Server-to-server communication**: API endpoints designed for machine-to-" +"machine communication" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Payment processors**: PayPal, Stripe, and other payment systems send " +"webhook notifications" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Version control systems**: GitHub, GitLab webhooks for CI/CD pipelines" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Social media platforms**: Twitter, Facebook webhook notifications" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Communication services**: Slack, Discord bot integrations" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "How to disable CSRF protection" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"First, you need to remove CSRF middleware from your main application " +"middleware list in `config/web/di/application.php`:" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"return [\n" +" Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to([\n" +" 'class' => MiddlewareDispatcher::class,\n" +" 'withMiddlewares()' => [\n" +" [\n" +" ErrorCatcher::class,\n" +" SessionMiddleware::class,\n" +" CsrfTokenMiddleware::class, // <- Remove this line \n" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"Now, if you need to leave CSRF on for specific routes or route groups, you " +"can do so by adding the `CsrfMiddleware` middleware to the router " +"configuration in `config/common/routes.php`. For a group that would be the " +"following:" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"return [\n" +" Group::create()\n" +" ->middleware(CsrfTokenMiddleware::class)\n" +" ->routes(\n" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "For a single route, you can add the middleware directly to the route:" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"Route::methods([Method::GET, Method::POST], '/say[/{test}]')\n" +" ->action(\\App\\Controller\\Echo\\Action::class)\n" +" ->name('echo/say')\n" +" ->middleware(CsrfTokenMiddleware::class)\n" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Security considerations" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"When disabling CSRF protection, keep these security considerations in mind:" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Alternative authentication methods" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "For API endpoints, implement proper authentication mechanisms:" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**API keys**: Require API keys for authentication" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Bearer tokens**: Use JWT or similar token-based authentication" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**OAuth 2.0**: Implement OAuth 2.0 for third-party access" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**IP whitelisting**: Restrict access to known IP addresses for webhooks" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Request validation" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "Implement additional validation for requests without CSRF protection:" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Signature verification**: Verify webhook signatures (e.g., GitHub's X-Hub-" +"Signature)" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Timestamp validation**: Check request timestamps to prevent replay attacks" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Rate limiting**: Implement rate limiting to prevent abuse" +msgstr "" + +#. type: Bullet: '- ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Input validation**: Strictly validate all input parameters" +msgstr "" + +#. type: Title ### +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Example: Webhook signature verification" +msgstr "" + +#. type: Fenced code block (php) +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "" +"getHeaderLine('X-Webhook-Signature');\n" +" $payload = (string) $request->getBody();\n" +" $expectedSignature = hash_hmac('sha256', $payload, $this->webhookSecret);\n" +" \n" +" if (!hash_equals($signature, $expectedSignature)) {\n" +" throw new \\RuntimeException('Invalid webhook signature');\n" +" }\n" +" \n" +" // Process webhook payload\n" +" // ...\n" +" }\n" +"}\n" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Best practices" +msgstr "" + +#. type: Bullet: '1. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Minimize exposure**: Only disable CSRF protection where absolutely " +"necessary" +msgstr "" + +#. type: Bullet: '2. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "**Use HTTPS**: Always use HTTPS for API endpoints and webhooks" +msgstr "" + +#. type: Bullet: '3. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Monitor logs**: Log all requests to API endpoints for security monitoring" +msgstr "" + +#. type: Bullet: '4. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Regular security audits**: Periodically review your API endpoints and " +"their security measures" +msgstr "" + +#. type: Bullet: '5. ' +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"**Documentation**: Clearly document which endpoints have CSRF protection " +"disabled and why" +msgstr "" + +#. type: Title ## +#: ../../cookbook/en/disabling-csrf-protection.md +#, no-wrap +msgid "Conclusion" +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"While CSRF protection is crucial for web applications, there are legitimate " +"scenarios where it needs to be disabled, particularly for external APIs and " +"webhooks. When disabling CSRF protection, always implement alternative " +"security measures and follow security best practices to maintain the overall " +"security of your application." +msgstr "" + +#. type: Plain text +#: ../../cookbook/en/disabling-csrf-protection.md +msgid "" +"Remember that disabling CSRF protection increases security risks, so careful " +"consideration and proper implementation of alternative security measures are " +"essential." +msgstr "" diff --git a/_translations/cookbook/pot/organizing-code_structuring-by-use-case-with-vertical-slices.md.pot b/_translations/cookbook/pot/organizing-code_structuring-by-use-case-with-vertical-slices.md.pot new file mode 100644 index 00000000..c2126e8b --- /dev/null +++ b/_translations/cookbook/pot/organizing-code_structuring-by-use-case-with-vertical-slices.md.pot @@ -0,0 +1,147 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:50+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +#, no-wrap +msgid "Structuring code by use-case with vertical slices" +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"When building an application, it's important to organize the code in a way " +"that makes it easy to understand, support, and scale. One popular approach " +"is to structure the code by use-case with vertical slices." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"Vertical slices are self-contained pieces of functionality that cover the " +"entire stack, from the user interface to the data access layer. Developer " +"organizes each slice around a specific use case, such as creating a new user " +"or updating a product." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"When structuring code classically by type (such as models, views, " +"controllers, helpers, etc.), it can be easy to lose sight of the bigger " +"picture and how different pieces of code interact to support specific " +"features or use cases. This can lead to code duplication, tight coupling, " +"and poor maintainability as the application grows." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"On the other hand, structuring code by use-case makes developers focus on a " +"specific feature or workflow and understand how different pieces of code " +"work together to support that feature. This approach also helps to keep " +"related code together in a single directory, making it easier to navigate " +"and support. Vertical slicing also encourages the use of domain-driven " +"design concepts, such as entities, repositories, and services, which can " +"help to promote good separation of concerns and modularity." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"Additionally, structuring code by use-case can make it easier to test and " +"debug the application since use-case namespace encapsulates each feature or " +"workflow in its own directory with clear boundaries and well-defined " +"interfaces." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"Here's an example directory structure for a PHP application organized using " +"vertical slices:" +msgstr "" + +#. type: Fenced code block +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +#, no-wrap +msgid "" +"src/\n" +"└── Blog/\n" +" ├── Model/\n" +" │ ├── Comment.php\n" +" │ ├── CommentRepository.php\n" +" │ ├── Post.php\n" +" │ └── PostRepository.php\n" +" ├── Service/ \n" +" │ └── MarkdownProcessor.php\n" +" ├── UseCase/\n" +" │ ├── CreateComment/\n" +" │ │ ├── CreateCommentAction.php\n" +" │ │ ├── CreateCommentRequest.php\n" +" │ ├── CreatePost/\n" +" │ │ ├── CreatePostAction.php\n" +" │ │ ├── CreatePostRequest.php\n" +" │ ├── DeleteComment/\n" +" │ │ ├── DeleteCommentAction.php\n" +" │ │ ├── DeleteCommentRequest.php\n" +" │ ├── DeletePost/\n" +" │ │ ├── DeletePostAction.php\n" +" │ │ ├── DeletePostRequest.php\n" +" │ ├── ListComments/\n" +" │ │ ├── ListCommentsAction.php\n" +" │ ├── ListPosts/\n" +" │ │ ├── ListPostsAction.php\n" +" │ ├── UpdatePost/\n" +" │ │ ├── UpdatePostAction.php\n" +" │ │ ├── UpdatePostRequest.php\n" +" │ ├── ViewPost/\n" +" │ │ ├── ViewPostAction.php\n" +" │ ├── Rss/\n" +" │ │ ├── RssAction.php\n" +" | | ├── RssBuilder.php\n" +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"Each vertical slice has its own directory, which has code associated with " +"the use case." +msgstr "" + +#. type: Plain text +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"The use-case subdirectories and their respective classes are organized by " +"type within each directory, omitting a directory if there's a single class " +"of the type. If code is shared between multiple use-cases, it's moved one " +"level up such as `Model` or `Service`." +msgstr "" + +#. type: Title ## +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +#, no-wrap +msgid "References" +msgstr "" + +#. type: Bullet: '- ' +#: en/organizing-code/structuring-by-use-case-with-vertical-slices.md +msgid "" +"[Application structure overview](https://github.com/yiisoft/docs/blob/master/" +"guide/en/structure/overview.md)" +msgstr "" diff --git a/_translations/cookbook/pot/preface.md.pot b/_translations/cookbook/pot/preface.md.pot new file mode 100644 index 00000000..02a37077 --- /dev/null +++ b/_translations/cookbook/pot/preface.md.pot @@ -0,0 +1,103 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:52+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/preface.md +#, no-wrap +msgid "Preface" +msgstr "" + +#. type: Plain text +#: en/preface.md +msgid "" +"Yii is a high-performance, package-based PHP framework for developing modern " +"applications. The name Yii (pronounced `Yee` or `[ji:]`) means \"simple and " +"evolutionary\" in Chinese. You can also think about it as an acronym for " +"**Yes It Is**!" +msgstr "" + +#. type: Plain text +#: en/preface.md +msgid "" +"Yii is a generic Web programming framework. You can use it for developing " +"all kinds of Web applications using PHP. Because of its architecture and " +"sophisticated caching support, it's especially suitable for developing large-" +"scale applications such as portals, content management systems, e-commerce, " +"REST APIs, etc." +msgstr "" + +#. type: Plain text +#: en/preface.md +msgid "" +"With comprehensive documentation and an enthusiastic user community, Yii can " +"significantly reduce your development time in the long run." +msgstr "" + +#. type: Title ## +#: en/preface.md +#, no-wrap +msgid "What's the book about" +msgstr "" + +#. type: Plain text +#: en/preface.md +msgid "" +"This book is for you if you're familiar with Yii3, building Yii " +"applications, and read the official Yii3 guide. It covers fundamentally " +"important development concepts, application architecture approaches, " +"integrating third party services with Yii3, etc." +msgstr "" + +#. type: Plain text +#: en/preface.md +msgid "" +"The book consists of individual recipes gathered from Yii experts that you " +"can apply in your applications. These go by topic, but you are free to read " +"them in any order as there is no dependency between them." +msgstr "" + +#. type: Title ## +#: en/preface.md +#, no-wrap +msgid "Prerequisites" +msgstr "" + +#. type: Bullet: '- ' +#: en/preface.md +msgid "You should have Yii3 installed." +msgstr "" + +#. type: Bullet: '- ' +#: en/preface.md +msgid "" +"You should be familiar with the framework basics and the official guide." +msgstr "" + +#. type: Title ## +#: en/preface.md +#, no-wrap +msgid "How to participate" +msgstr "" + +#. type: Plain text +#: en/preface.md +msgid "" +"If you've found any errata, wrong information, want to improve something or " +"have a good recipe, create an issue or make a pull request in [the book " +"GitHub repository](https://github.com/yiisoft/docs)." +msgstr "" diff --git a/_translations/cookbook/pot/sentry-integration.md.pot b/_translations/cookbook/pot/sentry-integration.md.pot new file mode 100644 index 00000000..129d963d --- /dev/null +++ b/_translations/cookbook/pot/sentry-integration.md.pot @@ -0,0 +1,264 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2025-09-05 14:52+0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: Title # +#: en/sentry-integration.md +#, no-wrap +msgid "Sentry integration" +msgstr "" + +#. type: Title ## +#: en/sentry-integration.md +#, no-wrap +msgid "What is Sentry" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +#, no-wrap +msgid "" +"[Sentry](https://sentry.io/) is a tool for monitoring and debugging application stability and performance.\n" +"Sentry gives you access to the events that you send there from your application.\n" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"Most often, Sentry is used for monitoring errors (exceptions). You can " +"enrich errors with context to better understand the problem: - Request " +"arguments - Tags for grouping exceptions - Environment state: environment " +"variables, application state, and other global attributes" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"You can find the full list of features on the official website: https://" +"sentry.io/welcome/" +msgstr "" + +#. type: Title ## +#: en/sentry-integration.md +#, no-wrap +msgid "Installation" +msgstr "" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Install the package" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"Install the required package `yiisoft/yii-sentry` with the following command:" +msgstr "" + +#. type: Fenced code block (shell) +#: en/sentry-integration.md +#, no-wrap +msgid "composer require yiisoft/yii-sentry --prefer-dist\n" +msgstr "" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Install an HTTP driver" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"The [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) " +"library requires the `php-http/httplug` package and any HTTP driver. In the " +"example below we’ll use the Guzzle adapter." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +#, no-wrap +msgid "> You can find the list of all adapters on [this page](https://docs.php-http.org/en/latest/clients.html#clients-adapters).\n" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "To install the packages, run the following command:" +msgstr "" + +#. type: Fenced code block (shell) +#: en/sentry-integration.md +#, no-wrap +msgid "composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist\n" +msgstr "" + +#. type: Title ## +#: en/sentry-integration.md +#, no-wrap +msgid "Configuration" +msgstr "" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Get and store the token" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Next, configure the application." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "First, register at [Sentry](https://sentry.io) and create a project." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"Then, in the project settings on the “General Settings” tab, find the " +"“Security Token” field and copy its value." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +#, no-wrap +msgid "" +"Now put this token into the package configuration. By default, the config is located at `config/packages/yiisoft/yii-sentry/config/params.php`.\n" +"Set the copied token as the value of the array element at `yiisoft/yii-sentry` => `options` => `dsn`. Example:\n" +msgstr "" + +#. type: Fenced code block (diff) +#: en/sentry-integration.md +#, no-wrap +msgid "" +"'yiisoft/yii-sentry' => [\n" +" 'enabled' => true,\n" +" 'options' => [\n" +"- 'dsn' => '',\n" +"+ 'dsn' => 'TOKEN',\n" +" ],\n" +"],\n" +msgstr "" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Configure the HTTP client" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "After installing the HTTP client, configure it." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"Create the file `config/common/sentry.php` and put the following code into " +"it:" +msgstr "" + +#. type: Fenced code block (php) +#: en/sentry-integration.md +#, no-wrap +msgid "" +" \\GuzzleHttp\\Client::class,\n" +" \\Http\\Client\\HttpAsyncClient::class => [\n" +" 'class' => \\Http\\Adapter\\Guzzle7\\Client::class,\n" +" '__construct()' => [\n" +" \\Yiisoft\\Factory\\Definition\\Reference::to(\\Http\\Client\\HttpClient::class),\n" +" ],\n" +" ],\n" +"];\n" +msgstr "" + +#. type: Title # +#: en/sentry-integration.md +#, no-wrap +msgid "Integration" +msgstr "" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Web" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "Sentry support for `web` is implemented as middleware." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"That means you only need to add `SentryMiddleware` to the global middleware " +"list in `config/web/application.php`:" +msgstr "" + +#. type: Fenced code block (diff) +#: en/sentry-integration.md +#, no-wrap +msgid "" +"return [\n" +" Yiisoft\\Yii\\Web\\Application::class => [\n" +" '__construct()' => [\n" +" 'dispatcher' => DynamicReference::to(static function (Injector $injector) {\n" +" return ($injector->make(MiddlewareDispatcher::class))\n" +" ->withMiddlewares(\n" +" [\n" +" Router::class,\n" +" SubFolder::class,\n" +"+ SentryMiddleware::class,\n" +" ErrorCatcher::class,\n" +" ]\n" +" );\n" +" }),\n" +" 'fallbackHandler' => Reference::to(NotFoundHandler::class),\n" +" ],\n" +" ],\n" +"];\n" +msgstr "" + +#. type: Title ### +#: en/sentry-integration.md +#, no-wrap +msgid "Console" +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"Sentry supports `console` via a handler for the [ConsoleEvents::ERROR]" +"(https://symfony.com/doc/current/components/console/events.html#the-" +"consoleevents-error-event) event." +msgstr "" + +#. type: Plain text +#: en/sentry-integration.md +msgid "" +"The package provides a configuration file that automatically subscribes the " +"application to this event." +msgstr "" diff --git a/_translations/guide/po/ru/tutorial_performance-tuning.md.po b/_translations/guide/po/ru/tutorial_performance-tuning.md.po index 72f510d9..1ae32b53 100644 --- a/_translations/guide/po/ru/tutorial_performance-tuning.md.po +++ b/_translations/guide/po/ru/tutorial_performance-tuning.md.po @@ -108,6 +108,48 @@ msgstr "" #. type: Title ## #: ../../guide/en/tutorial/performance-tuning.md #, fuzzy, no-wrap +#| msgid "Defining aliases " +msgid "Optimizing your code " +msgstr "Определение псевдонимов " + +#. type: Plain text +#: en/tutorial/performance-tuning.md +msgid "Beyond environment configuration, there are code-level optimizations that can improve your application's performance:" +msgstr "" + +#. type: Bullet: '- ' +#: en/tutorial/performance-tuning.md +msgid "Look out for [algorithm complexity](https://en.wikipedia.org/wiki/Time_complexity). Especially give attention to `foreach` within `foreach` loops but look out for using [heavy PHP functions](https://stackoverflow.com/questions/2473989/list-of-big-o-for-php-functions) in loops as well." +msgstr "" + +#. type: Bullet: '- ' +#: en/tutorial/performance-tuning.md +msgid "[Speeding up array_merge()](https://www.exakat.io/speeding-up-array_merge/)" +msgstr "" + +#. type: Bullet: '- ' +#: en/tutorial/performance-tuning.md +msgid "[Move that foreach() inside the method](https://www.exakat.io/move-that-foreach-inside-the-method/)" +msgstr "" + +#. type: Bullet: '- ' +#: en/tutorial/performance-tuning.md +msgid "[Array, classes and anonymous classes memory usage](https://www.exakat.io/array-classes-and-anonymous-memory-usage/)" +msgstr "" + +#. type: Bullet: '- ' +#: en/tutorial/performance-tuning.md +msgid "Use fully qualified function names with leading backslashes to optimize opcache performance. When calling [certain global functions](https://github.com/php/php-src/blob/944b6b6bbd6f05ad905f5f4ad07445792bee4027/Zend/zend_compile.c#L4291-L4353) from within a namespace, PHP first searches in the current namespace before falling back to the global namespace. Adding a leading backslash (e.g., `\\count()` instead of `count()`) tells PHP to directly use the global function, avoiding the namespace lookup and improving opcache efficiency. This optimization is best implemented automatically using tools like [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with the `native_function_invocation` rule." +msgstr "" + +#. type: Plain text +#: en/tutorial/performance-tuning.md +msgid "The above optimizations would give you a significant performance boost only if the code in question is executed frequently. That is usually the case for big loops or batch processing." +msgstr "" + +#. type: Title ## +#: en/tutorial/performance-tuning.md +#, fuzzy, no-wrap #| msgid "Injecting dependencies " msgid "Using caching techniques " msgstr "Внедрение зависимостей " diff --git a/_translations/guide/pot/tutorial_performance-tuning.md.pot b/_translations/guide/pot/tutorial_performance-tuning.md.pot index 9902e57e..364a9435 100644 --- a/_translations/guide/pot/tutorial_performance-tuning.md.pot +++ b/_translations/guide/pot/tutorial_performance-tuning.md.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-09-11 10:15+0500\n" +"POT-Creation-Date: 2025-09-12 04:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/cookbook/ru/README.md b/cookbook/ru/README.md index 1a24a7de..7a31f6c7 100644 --- a/cookbook/ru/README.md +++ b/cookbook/ru/README.md @@ -1,13 +1,22 @@ # Книга рецептов Yii3 -Книга рецептов Yii3 – это бесплатная книга, которая состоит из подсказок и секретов о PHP фреймворке [Yii3](https://www.yiiframework.com/). -Книга создана сообществом Yii. Поддерживается и редактируется силами команды Yii. +Книга рецептов Yii3 – это бесплатная книга, которая состоит из подсказок и +секретов о PHP фреймворке [Yii3](https://www.yiiframework.com/). -Не стесняйтесь создать pull request со своими рецептами. Мы сделаем ревью и добавим ваш рецепт в книгу. +- Книга создана сообществом Yii. +- Поддерживается и редактируется силами команды Yii. -Книга следует [правилам для документации Yii](https://www.yiiframework.com/doc/terms/). +Не стесняйтесь создать pull request со своими рецептами. Мы сделаем ревью и +добавим ваш рецепт в книгу. + +Книга следует [правилам для документации +Yii](https://www.yiiframework.com/license#docs). --- -[Вступление](preface.md) -[Интеграция с Sentry](sentry-integration.md) +- [Вступление](preface.md) +- [Structuring code by use-case with vertical + slices](organizing-code/structuring-by-use-case-with-vertical-slices.md) +- [Disabling CSRF protection](disabling-csrf-protection.md) +- [Интеграция с Sentry](sentry-integration.md) +- [Конфигурирование веб-серверов](configuring-webservers/general.md) diff --git a/cookbook/ru/preface.md b/cookbook/ru/preface.md index fcd18517..d045517a 100644 --- a/cookbook/ru/preface.md +++ b/cookbook/ru/preface.md @@ -1,25 +1,33 @@ # Вступление -Yii — высокопроизводительный компонентный PHP фреймворк для быстрой разработки современных веб-приложений. -Имя Yii (произносится как `Yee` или `[ji:]`) означает "простой и эволюционирующий" по-китайски. Также оно может +Yii — высокопроизводительный компонентный PHP фреймворк для быстрой +разработки современных веб-приложений. +Имя Yii (произносится как `Yee` или `[ji:]`) означает "простой и +эволюционирующий" по-китайски. Также оно может расшифровываться как акроним **Yes It Is**! -Yii является веб-фреймворком общего назначения. Он может использоваться для разработки любых типов приложений. -Благодаря компонентной архитектуре и хорошей поддержке кеширования, фреймворк отлично подходит для разработки -масштабных приложений, таких как порталы, форумы, CMS, магазины, REST API и так далее. +Yii является веб-фреймворком общего назначения. Он может использоваться для +разработки любых типов приложений. +Благодаря компонентной архитектуре и хорошей поддержке кеширования, +фреймворк отлично подходит для разработки +масштабных приложений, таких как порталы, форумы, CMS, магазины, REST API и +так далее. -Полная документация и активное сообщество Yii позволяют значительно выиграть во времени разработки проектов +Полная документация и активное сообщество Yii позволяют значительно выиграть +во времени разработки проектов в долгосрочной перспективе. ## О чём эта книга? -Это книга для тех, кто уже знаком с Yii3, делает на нём проекты, прочитал основную документацию. Она затрагивает -фундаментально важные принципы разработки, подходы к архитектуре, интеграцию различных сервисов в Yii3 и так далее. +Это книга для тех, кто уже знаком с Yii3, делает на нём проекты, прочитал +основную документацию. Она затрагивает +фундаментально важные принципы разработки, подходы к архитектуре, интеграцию +различных сервисов в Yii3 и так далее. -Книга состоит из отдельных рецептов, написанных экспертами по фреймворку. Рецепты объединены по теме, но вы можете +Книга состоит из отдельных рецептов, написанных экспертами по +фреймворку. Рецепты объединены по теме, но вы можете читать из в любом порядке так один не зависит от другого. - ## Что понадобится перед чтением? - Установленный Yii3. @@ -27,5 +35,7 @@ Yii является веб-фреймворком общего назначен ## Как помочь? -Если нашли описки, некорректную информацию, знаете как что-либо улучшить или же у вас есть новый рецепт для книги, -создайте issue или сделайте pull request [в репозиторий книги на GitHub](https://github.com/yiisoft/docs). +Если нашли описки, некорректную информацию, знаете как что-либо улучшить или +же у вас есть новый рецепт для книги, +создайте issue или сделайте pull request [в репозиторий книги на +GitHub](https://github.com/yiisoft/docs). diff --git a/cookbook/ru/sentry-integration.md b/cookbook/ru/sentry-integration.md index 4c8f5442..de736ca2 100644 --- a/cookbook/ru/sentry-integration.md +++ b/cookbook/ru/sentry-integration.md @@ -5,34 +5,41 @@ [Sentry](https://sentry.io/) – это инструмент мониторинга и отладки производительности и стабильности. Sentry представляет доступ к событиям, которые вы отправите туда из вашего приложения. -Чаще всего Sentry используется для мониторинга ошибок (исключений). -Ошибки можно "обогатить" контекстом для лучшего понимания вызванной проблемы: +Чаще всего Sentry используется для мониторинга ошибок (исключений). +Ошибки можно "обогатить" контекстом для лучшего понимания вызванной +проблемы: - Аргументы, с которыми вызывалось приложение - Теги, для группировки исключений -- Состояние среды окружения: переменные окружения, состояние приложения и прочие "глобальные" аттрибуты +- Состояние среды окружения: переменные окружения, состояние приложения и +прочие "глобальные" аттрибуты -Полный список всех возможностей можно найти на официальном сайте: https://sentry.io/welcome/ +Полный список всех возможностей можно найти на официальном сайте: +https://sentry.io/welcome/ ## Установка ### Установка пакета -Для установки нужного пакета установите пакет `yiisoft/yii-sentry` следующей командой: +Для установки нужного пакета установите пакет `yiisoft/yii-sentry` следующей +командой: ```shell composer require yiisoft/yii-sentry --prefer-dist +``` ### Установка HTTP-драйвера -Библиотека [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) требует установки `php-http/httplug` пакета и любого HTTP-драйвера. -Для примеры используется адаптер `Guzzle`. +Библиотека [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) +требует установки `php-http/httplug` пакета и любого HTTP-драйвера. +Для примеры используется адаптер `Guzzle`. > Список всех адаптеров можно найти на [этой](https://docs.php-http.org/en/latest/clients.html#clients-adapters) странице. -Для установки пакетов выполните в консоли следующую команду. +Для установки пакетов выполните в консоли следующую команду: ```shell composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist +``` ## Настройка @@ -40,9 +47,11 @@ composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist Далее сконфигурируем приложение. -Для начала зарегистрируйтесь в [Sentry](https://sentry.io) и создайте проект. +Для начала зарегистрируйтесь в [Sentry](https://sentry.io) и создайте +проект. -Далее в настройках проекта, на вкладке `General Settings`, найдите поле `Security Token` и скопируйте оттуда значение. +Далее в настройках проекта, на вкладке `General Settings`, найдите поле +`Security Token` и скопируйте оттуда значение. Теперь положите этот токен в настройки пакета. По умолчанию конфиг лежит в `config/packages/yiisoft/yii-sentry/config/params.php`. Скопированный токен запишите в значение элемента массива по ключу `yiisoft/yii-sentry` => `options` => `dsn`. Пример: @@ -57,7 +66,6 @@ composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist ], ``` - ### Настройка HTTP-клиента После установки HTTP-клиента, сконфигурируйте его. @@ -84,10 +92,10 @@ return [ ### Веб -Поддержка Sentry для `web` реализована как `middleware`. - -А это значит, что достаточно будет добавить `SentryMiddleware` в глобальный список `middleware` в `config/web/application.php`: +Поддержка Sentry для `web` реализована как `middleware`. +А это значит, что достаточно будет добавить `SentryMiddleware` в глобальный +список `middleware` в `config/web/application.php`: ```diff return [ @@ -110,9 +118,10 @@ return [ ]; ``` - ### Консоль -Sentry поддерживает `console` в виде обработчика события [ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event). +Sentry поддерживает `console` в виде обработчика события +[ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event). -Пакет предоставляет конфигурационный файл, который автоматически подписывает приложение на это событие. +Пакет предоставляет конфигурационный файл, который автоматически подписывает +приложение на это событие.