Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 49 additions & 29 deletions _translations/po/es/guide_runtime_response.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-09-04 11:19+0500\n"
"POT-Creation-Date: 2025-12-26 22:37+0000\n"
"PO-Revision-Date: 2025-09-04 11:19+0500\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand All @@ -17,30 +17,31 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. type: Title ##
#: en/runtime/request.md en/runtime/response.md
#: ../src/guide/runtime/request.md ../src/guide/runtime/response.md
#, no-wrap
msgid "Headers"
msgstr ""

#. type: Title ##
#: en/runtime/request.md en/runtime/response.md
#: ../src/guide/runtime/request.md ../src/guide/runtime/response.md
#: ../src/internals/006-git-commit-messages.md
#, no-wrap
msgid "Body"
msgstr ""

#. type: Title #
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "Response"
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "HTTP response has status code and message, a set of headers and a body:"
msgstr ""

#. type: Fenced code block
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"HTTP/1.1 200 OK\n"
Expand All @@ -55,17 +56,17 @@ msgid ""
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "Yii uses [PSR-7 `Response`](https://www.php-fig.org/psr/psr-7/) in the web application to represent response."
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "The object should be constructed and returned as a result of the execution of controller actions or other middleware. Usually, the middleware has a response factory injected into its constructor."
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"use Psr\\Http\\Message\\ResponseFactoryInterface;\n"
Expand All @@ -90,18 +91,18 @@ msgid ""
msgstr ""

#. type: Title ##
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "Status code"
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "You can set a status code like the following:"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"use Yiisoft\\Http\\Status;\n"
Expand All @@ -110,75 +111,75 @@ msgid ""
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "Majority of status codes are available from `Status` class for convenience and readability."
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "You can set headers like this:"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "$response = $response->withHeader('Content-type', 'application/json');\n"
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "If there is a need to append a header value to the existing header:"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "$response = $response->withAddedHeader('Set-Cookie', 'qwerty=219ffwef9w0f; Domain=somecompany.co.uk; Path=/; Expires=Wed, 30 Aug 2019 00:00:00 GMT');\n"
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "And, if needed, headers could be removed:"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "$response = $response->withoutHeader('Set-Cookie');\n"
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "Response body is an object implementing `Psr\\Http\\Message\\StreamInterface`."
msgstr ""

#. type: Plain text
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
msgid "You can write to it via the interface itself:"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"$body = $response->getBody();\n"
"$body->write('Hello');\n"
msgstr ""

#. type: Title ##
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "Examples"
msgstr ""

#. type: Title ###
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "Redirecting"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"use Yiisoft\\Http\\Status;\n"
Expand All @@ -188,16 +189,35 @@ msgid ""
" ->withHeader('Location', 'https://www.example.com'); \n"
msgstr ""

#. type: Plain text
#: ../src/guide/runtime/response.md
msgid "Note that there are different statuses used for redirection:"
msgstr ""

#. type: Plain text
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"| Code | Usage | What is it for |\n"
"|------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n"
"| 301 | `Status::MOVED_PERMANENTLY` | Permanently changed a URL structure. Search engines update their indexes, and browsers cache it. |\n"
"| 308 | `Status::PERMANENT_REDIRECT` | Like 301, but guarantees the HTTP method won't change. |\n"
"| 302 | `Status::FOUND` | Temporary changes like maintenance pages. Original URL should still be used for future requests. Search engines typically don't update their indexes. |\n"
"| 307 | `Status::TEMPORARY_REDIRECT` | Like 302, but guarantees the HTTP method won't change. |\n"
"| 303 | `Status::SEE_OTHER` | After form submissions to prevent duplicate submissions if the user refreshes. Explicitly tells to use `GET` for the redirect, even if the original request was `POST`. |\n"
msgstr ""

#. type: Title ###
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid "Responding with JSON"
msgstr ""

#. type: Fenced code block (php)
#: en/runtime/response.md
#: ../src/guide/runtime/response.md
#, no-wrap
msgid ""
"use Yiisoft\\Http\\Status;\n"
"use Yiisoft\\Json\\Json;\n"
"\n"
"$data = [\n"
Expand All @@ -207,6 +227,6 @@ msgid ""
"\n"
"$response->getBody()->write(Json::encode($data));\n"
"return $response\n"
" ->withStatus(200)\n"
" ->withHeader('Content-Type', 'application/json');\n"
" ->withStatus(Status::OK)\n"
" ->withHeader('Content-Type', 'application/json');\n"
msgstr ""
19 changes: 12 additions & 7 deletions _translations/po/es/guide_start_creating-project.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-12-24 13:00+0000\n"
"POT-Creation-Date: 2025-12-26 18:30+0000\n"
"PO-Revision-Date: 2025-09-04 11:19+0500\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand All @@ -33,7 +33,7 @@ msgstr ""
msgid ""
"> [!NOTE]\n"
"> If you want to use another web server,\n"
"> see [\"Configuring web servers\"](../../../cookbook/en/configuring-webservers/general.md).\n"
"> see [\"Configuring web servers\"](../../cookbook/configuring-webservers/general.md).\n"
msgstr ""

#. type: Plain text
Expand All @@ -46,21 +46,26 @@ msgstr ""
msgid "You can create a new project from a template using the [Composer](https://getcomposer.org) package manager:"
msgstr ""

#. type: Fenced code block
#. type: Fenced code block (sh)
#: ../src/guide/start/creating-project.md
#, no-wrap
msgid "composer create-project yiisoft/app your_project\n"
msgstr ""

#. type: Plain text
#: ../src/guide/start/creating-project.md
msgid "Docker users can run the following command:"
msgstr ""
#, fuzzy
#| msgid "Events are raised like the following:"
msgid "Docker users can run the following commands:"
msgstr "Los eventos se lanzan de la siguiente forma:"

#. type: Fenced code block (sh)
#: ../src/guide/start/creating-project.md
#, no-wrap
msgid "docker run --rm -it -v \"$(pwd):/app\" composer/composer create-project yiisoft/app your_project\n"
msgid ""
"docker run --rm -it -v \"$(pwd):/app\" composer/composer create-project yiisoft/app your_project\n"
"sudo chown -R $(id -u):$(id -g) your_project\n"
"make composer update\n"
msgstr ""

#. type: Plain text
Expand Down Expand Up @@ -93,7 +98,7 @@ msgstr ""
msgid "For Docker users, run:"
msgstr ""

#. type: Fenced code block
#. type: Fenced code block (sh)
#: ../src/guide/start/creating-project.md
#, no-wrap
msgid "make up\n"
Expand Down
Loading