Skip to content

Commit 43f08c0

Browse files
committed
minor #13383 [Translation] Documented the debug:translation exit codes (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #13383). Discussion ---------- [Translation] Documented the debug:translation exit codes Fixes #13019. Commits ------- 9fe3193 [Translation] Documented the debug:translation exit codes
2 parents a189b78 + 9fe3193 commit 43f08c0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

translation/debug.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,33 @@ unused or only the missing messages, by using the ``--only-unused`` or
180180
181181
$ php bin/console debug:translation en --only-unused
182182
$ php bin/console debug:translation en --only-missing
183+
184+
Debug Command Exit Codes
185+
------------------------
186+
187+
The exit code of the ``debug:translation`` command changes depending on the
188+
status of the translations. Use the following public constants to check it::
189+
190+
use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand;
191+
192+
// generic failure (e.g. there are no translations)
193+
TranslationDebugCommand::EXIT_CODE_GENERAL_ERROR;
194+
195+
// there are missing translations
196+
TranslationDebugCommand::EXIT_CODE_MISSING;
197+
198+
// there are unused translations
199+
TranslationDebugCommand::EXIT_CODE_UNUSED;
200+
201+
// some translations are using the fallback translation
202+
TranslationDebugCommand::EXIT_CODE_FALLBACK;
203+
204+
These constants are defined as "bit masks", so you can combine them as follows::
205+
206+
if (TranslationDebugCommand::EXIT_CODE_MISSING | TranslationDebugCommand::EXIT_CODE_UNUSED) {
207+
// ... there are missing and/or unused translations
208+
}
209+
210+
.. versionadded:: 5.1
211+
212+
The exit codes were introduced in Symfony 5.1

0 commit comments

Comments
 (0)