i18n-localization
Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
PHP Artisan CLI patterns including make commands, flags, custom commands, and AI-friendly usage.
Advanced Eloquent ORM patterns including relationships, eager loading, factories, and query optimization.
Laravel development best practices covering service providers, dependency injection, facades, and the Laravel Way.
Laravel Tinker best practices for debugging, testing ideas, and data exploration. When and how to use safely.
Laravel-native error handling patterns. Renderable exceptions, Livewire traits strategies, and user-facing notifications.
Integrate Anthropic Claude API with Laravel. HTTP client, message format, error handling. Use when calling Claude models from Laravel applications.
| name | i18n-localization |
| description | Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support. |
| allowed-tools | Read, Glob, Grep |
Best practices for Laravel localization.
Laravel provides two ways to manage translations:
lang/en/messages.php)Good for large apps with structured text.
// lang/en/messages.php
return [
'welcome' => 'Welcome to our application',
];
// Usage
echo __('messages.welcome');
lang/en.json)Good for prototyping or smaller apps.
// lang/en.json
{
"I love programming.": "Eu amo programar."
}
// Usage
echo __('I love programming.');
{{-- Standard --}}
<h1>{{ __('messages.welcome') }}</h1>
{{-- Direct Directive --}}
@lang('auth.failed')
{{-- With Replacements --}}
<p>{{ __('Welcome, :name', ['name' => $user->name]) }}</p>
{{-- Pluralization --}}
<p>{{ trans_choice('messages.apples', 10) }}</p>
// Helper
$message = __('messages.saved');
// Facade
use Illuminate\Support\Facades\Lang;
$message = Lang::get('messages.saved');
For robust localization management, don't reinvent the wheel.
laravel-lang/commonOfficial translations for validation, auth, and pagination messages in 75+ languages.
composer require laravel-lang/common --dev
php artisan lang:update
laravel-lang/publisherEasily publish and manage language files.
The kit includes a simple script to detect hardcoded strings in Blade templates.
php .agent/skills/i18n-localization/scripts/i18n_checker.php resources/views
This will scan your views and report strings that look like text but aren't wrapped in translation helpers.
__() for output to ensure it goes through the translation layer (and escaping).{!! !!} when displaying translations containing HTML.