Laravel Translations Checker —— 使用 Laravel 翻译检查器查找缺失的翻译
Laravel Translations Checker 包会查找您支持的语言的缺失翻译。这个包可以让你使用 CLI 来检查所有语言的翻译:
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.pphp artisan translations:check --excludedDirectories=vendor
The language nl (resources/lang/nl) is missing the file ( passwords.php )
Missing the translation with key: nl.passwords.reset
Missing the translation with key: nl.passwords.sent
Missing the translation with key: nl.passwords.throttled
Missing the translation with key: nl.passwords.token
Missing the translation with key: nl.passwords.userasswords.throttled7Missing the translation with key: nl.passwords.token8Missing the translation with key: nl.passwords.user
此软件包支持在 .php
和 .json
翻译文件中查找翻译。 此外,自述文件 中提供了一个很好的例子来检查 GitHub 操作中缺少的翻译:
translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit
- name: Install Dependencies
run: composer install -q --no-interaction --no-scripts
- name: Run translations check
run: php artisan translations:check --excludedDirectories=vendor
以下是在新的 Laravel 应用程序中添加新语言 (es
) 后的输出示例:
使用此工具,您可以快速确保为所有内容定义的翻译! 要开始使用此软件包,请查看 GitHub 上的自述文件,网址为 laravel-translations-checker。
本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。