Laravel Translations Checker —— 使用 Laravel 翻译检查器查找缺失的翻译

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) 后的输出示例:

Laravel

使用此工具,您可以快速确保为所有内容定义的翻译! 要开始使用此软件包,请查看 GitHub 上的自述文件,网址为 laravel-translations-checker

本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。

原文地址:https://laravel-news.com/laravel-transla...

译文地址:https://learnku.com/laravel/t/66561

本文为协同翻译文章,如您发现瑕疵请点击「改进」按钮提交优化建议
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!