Skip to content

Commit 25f529c

Browse files
committed
feat: rename syncLangFiles
1 parent 40bb679 commit 25f529c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ During installation, you'll be prompted to choose either **Vue** or **React** fo
5757

5858
## 🚀 Usage
5959

60-
### 🔟 Where to Use `lang_file_load()`?
60+
### 🔟 Where to Use `syncLangFiles()`?
6161

62-
Call `lang_file_load()` **inside your controller method** **before rendering an Inertia view** to load necessary language files and share them with the frontend.
62+
Call `syncLangFiles()` **inside your controller method** **before rendering an Inertia view** to load necessary language files and share them with the frontend.
6363

6464
---
6565

@@ -72,7 +72,7 @@ use Inertia\Inertia;
7272

7373
public function index()
7474
{
75-
lang_file_load('auth'); // Load a single language file
75+
syncLangFiles('auth'); // Load a single language file
7676

7777
return Inertia::render('Dashboard');
7878
}
@@ -91,7 +91,7 @@ use Inertia\Inertia;
9191

9292
public function profile()
9393
{
94-
lang_file_load(['auth', 'profile']); // Load multiple files
94+
syncLangFiles(['auth', 'profile']); // Load multiple files
9595

9696
return Inertia::render('Profile');
9797
}
@@ -109,9 +109,9 @@ use Inertia\Inertia;
109109
public function show($type)
110110
{
111111
if ($type === 'admin') {
112-
lang_file_load(['admin', 'auth']);
112+
syncLangFiles(['admin', 'auth']);
113113
} else {
114-
lang_file_load(['user', 'auth']);
114+
syncLangFiles(['user', 'auth']);
115115
}
116116

117117
return Inertia::render('UserTypePage');
@@ -220,7 +220,7 @@ resources/lang/
220220
When calling:
221221

222222
```php
223-
lang_file_load('auth');
223+
syncLangFiles('auth');
224224
```
225225

226226
It dynamically loads `resources/lang/{locale}/auth.php`.

src/LangHelpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
use LaravelLangSyncInertia\Facades\Lang;
44

5-
if (! function_exists('lang_file_load')) {
5+
if (! function_exists('syncLangFiles')) {
66
/**
77
* Load one or multiple language files.
88
*
99
* @return array<string, mixed>
1010
*/
11-
function lang_file_load(string|array $fileName): array
11+
function syncLangFiles(string|array $fileName): array
1212
{
1313
return Lang::getFile($fileName);
1414
}

0 commit comments

Comments
 (0)