2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill fusengine/agents --skill laravel-i18n- SKILL.md3.9 KB
Overview
This skill provides concise guidance and templates for implementing Laravel localization: translations with __(''), trans_choice(), JSON files, pluralization, middleware, and formatting. It describes how to organize lang files, enforce safe patterns (no concatenation), and validate locales for robust multilingual apps. Use it when adding or reviewing translation work in Laravel projects.
How this skill works
Before any implementation, spawn three helper agents via TeamCreate to inspect code, verify i18n best practices, and consult official docs. The skill inspects existing translation patterns, recommends whether to use PHP key files or JSON translations, and suggests middleware and services for locale detection and formatting. After changes, run a validation agent to confirm extracted strings, plural handling, and locale safety.
When to use it
- Adding new user-facing text that must be translated
- Refactoring hardcoded strings in Blade views or controllers
- Implementing locale detection via URL, session, or headers
- Handling counts and plural forms across locales
- Centralizing date/number/currency formatting for locales
Best practices
- Never concatenate translated strings; use :placeholder replacements
- Always handle the zero case explicitly in pluralization rules
- Group translation keys by feature (e.g., auth.login.title)
- Extract strings early; avoid hardcoded text in views
- Validate allowed locales with an enum or whitelist
- Set Carbon and formatting locale in middleware or a service
Example use cases
- Replace hardcoded Blade labels with @lang or __('key') and placeholders
- Choose JSON translations for full-text translations in a large app
- Use trans_choice('key', $count) to handle singular/plural/zero forms
- Add SetLocale middleware to detect locale from URL or session
- Create a LocalizationServiceProvider to centralize formatting rules
FAQ
Use PHP key files for structured, nested translations and feature grouping; use JSON when you prefer full-text keys or need simple one-to-one translations across many strings.
How do I handle pluralization correctly?
Use trans_choice('key', $count) and include explicit zero, singular, and plural forms in your translation lines. Never build plural logic by concatenating strings.