@@ -23,6 +23,7 @@ yarn add @devwizard/laravel-localizer-react
2323```
2424
2525** Backend (Composer):**
26+
2627``` bash
2728composer require devwizardhq/laravel-localizer
2829php artisan localizer:install --framework=react
@@ -143,18 +144,18 @@ function ConditionalMessage() {
143144
144145Returns an object with the following properties and methods:
145146
146- | Property | Type | Description |
147- | ----------| ------| -------------|
148- | ` __ ` | ` (key, replacements?, fallback?) => string ` | Main translation function |
149- | ` trans ` | ` (key, replacements?, fallback?) => string ` | Alias for ` __ ` |
150- | ` lang ` | ` (key, replacements?, fallback?) => string ` | Alias for ` __ ` |
151- | ` has ` | ` (key) => boolean ` | Check if translation key exists |
152- | ` choice ` | ` (key, count, replacements?) => string ` | Pluralization support |
153- | ` locale ` | ` string ` | Current locale code |
154- | ` dir ` | ` 'ltr' \| 'rtl' ` | Text direction |
155- | ` availableLocales ` | ` Record<string, LocaleInfo> ` | Available locales with metadata |
156- | ` translations ` | ` Record<string, string> ` | All translations for current locale |
157- | ` getLocales ` | ` () => string[] ` | Get all available locale codes |
147+ | Property | Type | Description |
148+ | ------------------ | ------------------------------------------- | ----------------------------------- |
149+ | ` __ ` | ` (key, replacements?, fallback?) => string ` | Main translation function |
150+ | ` trans ` | ` (key, replacements?, fallback?) => string ` | Alias for ` __ ` |
151+ | ` lang ` | ` (key, replacements?, fallback?) => string ` | Alias for ` __ ` |
152+ | ` has ` | ` (key) => boolean ` | Check if translation key exists |
153+ | ` choice ` | ` (key, count, replacements?) => string ` | Pluralization support |
154+ | ` locale ` | ` string ` | Current locale code |
155+ | ` dir ` | ` 'ltr' \| 'rtl' ` | Text direction |
156+ | ` availableLocales ` | ` Record<string, LocaleInfo> ` | Available locales with metadata |
157+ | ` translations ` | ` Record<string, string> ` | All translations for current locale |
158+ | ` getLocales ` | ` () => string[] ` | Get all available locale codes |
158159
159160## Vite Plugin Options
160161
@@ -203,8 +204,8 @@ The package is fully typed. Generated translation files include TypeScript defin
203204``` typescript
204205// Generated by localizer:generate
205206export const en = {
206- " welcome" : " Welcome" ,
207- " validation.required" : " This field is required" ,
207+ welcome: ' Welcome' ,
208+ ' validation.required' : ' This field is required' ,
208209} as const ;
209210
210211export type TranslationKeys = keyof typeof en ;
0 commit comments