larswiegers / laravel-translations-checker
确保您的Laravel翻译已检查并包含在所有语言中。
v0.9.2
2024-09-04 16:11 UTC
Requires
- php: ^7.4|^8.0|^8.1|^8.2
- ext-json: *
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^9.0|^10.0|^11.0
- dev-main
- v0.9.2
- v0.9.1
- v0.9
- v0.8
- v0.7
- v0.6
- v0.5
- v0.4
- v0.3
- v0.2
- v0.1
- dev-feature/exclude-certain-file-extensions
- dev-refactorv2
- dev-laravel-11
- dev-laravel11
- dev-exclude-ds-store
- dev-refactor
- dev-excluding-keys
- dev-json-files-instead-of-dirs
- dev-laravel-10-testing
- dev-laravel-10
- dev-php-8.2
- dev-unsed-command
- dev-readme-updates
- dev-fix_deeper_directories_bug
- dev-support-json
- dev-add-in-command
This package is auto-updated.
Last update: 2024-09-04 16:13:30 UTC
README
是否曾感到在您支持的一些语言中遗漏了翻译?用户是否向您发送了关于屏幕上奇怪字符串的邮件?
使用laravel翻译检查器,并直接获取您遗漏的翻译位置和内容!
安装
您可以通过composer安装此包
composer require larswiegers/laravel-translations-checker
用法
使用以下命令,非常简单!
php artisan translations:check
不同目录
您的翻译在奇怪的目录中?使用如下 --directory 选项
php artisan translations:check --directory=resources/lang
排除目录
一些包有自己的语言文件,排除它们可能更明智。
php artisan translations:check --excludedDirectories=lang/vendor
此选项也作为配置选项 'excluded_directories' 提供。
例如
'excluded_directories' => ['lang/vendor'],
排除语言
本节提供如何排除特定语言进行检查的说明。
要排除语言,请按照以下步骤操作
-
打开项目的配置文件。
-
定位到
translation-checker
文件。 -
将您想要排除的语言代码添加到
exclude_languages
字段。
例如
exclude_languages = ["en", "fr", "es"]
排除文件类型
- 假设您只想在项目中的php或json文件上运行,则可以使用如下 --excludedFileExtensions 选项
php artisan translations:check --excludedFileExtensions=php
此选项也作为配置选项 'excluded_file_extensions' 提供。
JSON支持
该包支持翻译的 .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
输出看起来是什么样子?
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.user
测试
composer test
更改日志
有关最近更改的更多信息,请参阅 更改日志。
贡献
有关详细信息,请参阅 贡献指南。
安全性
如果您发现任何安全问题,请通过电子邮件 larswiegers@live.nl 反馈,而不是使用问题跟踪器。
鸣谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅 许可证文件。