Installation (unchanged):
composer require laravel-lang/starter-kits --dev
Update Translations (updated for 1.15.0):
Run the Artisan command to pull the latest translations, including new keys for teams and workos-teams across all frameworks (Livewire, Vue, React, Svelte):
php artisan lang:update
Verify the updated files in:
resources/lang/vendor/laravel-lang/starter-kits/livewire/
resources/lang/vendor/laravel-lang/starter-kits/vue/
resources/lang/vendor/laravel-lang/starter-kits/react/
resources/lang/vendor/laravel-lang/starter-kits/svelte/
Verify New Keys: Check for new keys like:
laravel-lang/starter-kits.livewire::workos-teams.*laravel-lang/starter-kits.vue::teams.* (and other frameworks)
Example:grep "workos-teams" resources/lang/vendor/laravel-lang/starter-kits/livewire/en.json
Use the new workos-teams keys in your components. Example for Livewire:
// Updated for workos-teams support
public function render()
{
return view('livewire.example', [
'title' => __('laravel-lang/starter-kits.livewire::workos-teams.title'),
'description' => __('laravel-lang/starter-kits.livewire::teams.description'),
]);
}
Or in Blade:
<p>{{ __('laravel-lang/starter-kits.vue::teams.create') }}</p>
<p>{{ __('laravel-lang/starter-kits.svelte::workos-teams.invite') }}</p>
Pulling Updates (emphasize new keys): After updating to 1.15.0, run:
php artisan lang:update
Focus on:
workos-teams keys (new in this release) for all frameworks.fr) and Japanese (ja) locales (updated for passkeys and missing keys).Language-Specific Overrides (updated):
Override new keys in your project’s resources/lang/. Example for Spanish:
// resources/lang/es/livewire.json
{
"workos-teams": {
"title": "Equipos de trabajo personalizados",
"invite": "Invitar a colaboradores"
}
}
Integration with Starter Kits (updated):
workos-teams keys in your components.
Example for Vue:
<template>
<h1>{{ $t('laravel-lang/starter-kits.vue::workos-teams.title') }}</h1>
</template>
// resources/js/app.js
import workosTeamsTranslations from '@/lang/livewire/workos-teams.json';
Dynamic Language Switching (unchanged):
Use middleware to handle locale changes, especially for new locales like ja (Japanese) which now has updated keys.
laravel-lang/starter-kits.svelte::workos-teams.*) to avoid clashes.npm run dev
fr (passkeys updates) and ja (missing keys filled).
Example test case:
$this->assertEquals(
'Clés d’accès', // Updated French term
__('laravel-lang/starter-kits.livewire::teams.passkeys')
);
Missing Keys in 1.15.0:
laravel-lang/starter-kits.livewire::workos-teams.xyz is missing, verify it exists in the latest release.fr) locale: Some terms (e.g., "passkeys") were updated. Check for deprecated keys in your overrides.Caching (emphasized):
After running lang:update, clear caches and rebuild frontend assets:
php artisan view:clear
php artisan config:clear
npm run dev # For Vite/Webpack
Locale-Specific Issues:
ja): Now includes missing keys but may need UI testing for RTL/LTR alignment.fr): Updated passkey terminology may break existing translations. Review overrides in resources/lang/fr/.Artisan Command Failures:
lang:update fails, check:
workos-teams are valid JSON.resources/lang/vendor/.Log Missing Keys:
Enable debug mode and check logs for new keys like workos-teams:
// config/app.php
'debug' => true,
Example log entry:
translation missing: en.laravel-lang/starter-kits.svelte::workos-teams.invite
Validate JSON:
Manually validate new files (e.g., workos-teams.json) for syntax errors:
jsonlint resources/lang/vendor/laravel-lang/starter-kits/livewire/workos-teams.json
Contribute Translations:
Help fill gaps in Japanese (ja) or French (fr) for new workos-teams keys:
git clone https://github.com/Laravel-Lang/starter-kits.git
# Edit resources/lang/ja/livewire/workos-teams.json
Extend for Custom Starter Kits:
Create a custom namespace for workos-teams:
resources/lang/vendor/my-starter-kit/workos-teams/
Load via a service provider:
$this->loadTranslationsFrom(__DIR__.'/../lang/vendor/my-starter-kit', 'my-starter-kit');
Performance: Use fallbacks for new keys to avoid errors:
__('laravel-lang/starter-kits.livewire::workos-teams.title', [], 'en');
CI/CD Integration (updated): Add steps to update translations and rebuild assets in your pipeline:
- name: Update translations and assets
run: |
php artisan lang:update
npm install && npm run build
How can I help you explore Laravel packages today?