The Laravel Translations Checker package finds missing translations in the languages you support. Using this package is as easy as running an artisan CLI to check translations across all languages:
1php artisan translations:check --excludedDirectories=vendor2 3The language nl (resources/lang/nl) is missing the file ( passwords.php )4Missing the translation with key: nl.passwords.reset5Missing the translation with key: nl.passwords.sent6Missing the translation with key: nl.passwords.throttled7Missing the translation with key: nl.passwords.token8Missing the translation with key: nl.passwords.user
This package supports looking for translations in both .php
and .json
translation files. Also, the readme has a nice example of checking for missing translations in a GitHub action:
1translations: 2 runs-on: ubuntu-latest 3 steps: 4 - uses: actions/checkout@v2 5 - name: Setup PHP 6 uses: shivammathur/setup-php@v2 7 with: 8 php-version: '8.0' 9 extensions: mbstring, intl10 ini-values: post_max_size=256M, max_execution_time=18011 coverage: xdebug12 tools: php-cs-fixer, phpunit13 - name: Install Dependencies14 run: composer install -q --no-interaction --no-scripts15 - name: Run translations check16 run: php artisan translations:check --excludedDirectories=vendor
Here's an example of the output after adding a new language (es
) to a new Laravel application:
Using this tool, you can quickly make sure you define translations for everything! To get started with this package, check out the README on GitHub at laravel-translations-checker.
0 comments:
Post a Comment
Thanks