nativecodein/laravel-translation-scanner
__(), trans()).en.json ensure backward compatibility with existing translation files, minimizing merge conflicts.t(title)) is a unique strength, but may introduce false positives if variable names aren’t translation keys (e.g., t(user.id)).babel-plugin-i18n), risking false positives/negatives.--watch mode or Git diff integration).@lang) or custom translation helpers may not be detected.t('key.' + variable)) are unsupported, requiring manual fixes.t("user.id") being added as a translation key)?php artisan lang:publish) that could complement this?t() in frontend code).laravel-lang).t('user.' + id)) may need pre-processing.app/Http/Controllers/ + resources/js/).app/Helpers/ to skipped folders).translations:scan on PRs.translations:translate for non-critical locales (e.g., ta, ar) to reduce manual work.en.json) as a source of truth, then expand to other locales.t() over hardcoded strings in frontend code.config/app.php edits.app('translator')->macro()).resources/lang/, which is standard for Laravel translations.resources/lang/en.json exists (or let the package create it).__(), trans(), t()) are consistently used across the codebase.php artisan translations:scan
en.json for unexpected keys (e.g., variable names).php artisan translations:translate ta ar
ta.json, ar.json).- name: Scan translations
run: php artisan translations:scan
- name: Upload en.json
uses: actions/upload-artifact@v3
with:
name: en.json
path: resources/lang/en.json
translations:scan before feature freezes to reduce last-minute i18n work.es, fr).en.json prevent merge conflicts.en.json.t() usage in frontend code (e.g., Inertia.js).t({ key })).--verbose to see scanned files and skipped patterns.storage/logs/laravel.log for translation API errors.--depth=1 to limit directory traversal or exclude folders (e.g., tests/).laravel-queue.| Failure Scenario |
How can I help you explore Laravel packages today?