Skip to content

Commit

Permalink
2024/02/05までの原文変更点反映。
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroKws committed Feb 5, 2024
1 parent 9e9f238 commit 4b2089c
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 20 deletions.
2 changes: 1 addition & 1 deletion original-en/dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
To get started, you should install [Google Chrome](https://www.google.com/chrome) and add the `laravel/dusk` Composer dependency to your project:

```shell
composer require --dev laravel/dusk
composer require laravel/dusk --dev
```

> [!WARNING]
Expand Down
6 changes: 6 additions & 0 deletions original-en/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ You may configure additional symbolic links in your `filesystems` configuration
public_path('images') => storage_path('app/images'),
],

The `storage:unlink` command may be used to destroy your configured symbolic links:

```shell
php artisan storage:unlink
```

<a name="driver-prerequisites"></a>
### Driver Prerequisites

Expand Down
93 changes: 89 additions & 4 deletions original-en/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
[Number::currency](#method-number-currency)
[Number::fileSize](#method-number-file-size)
[Number::forHumans](#method-number-for-humans)
[Number::ordinal](#method-number-ordinal)
[Number::spell](#method-number-spell)
[Number::useLocale](#method-number-use-locale)
[Number::withLocale](#method-number-with-locale)

</div>

Expand Down Expand Up @@ -1220,6 +1224,87 @@ The `Number::forHumans` method returns the human-readable format of the provided

// 1.23 million

<a name="method-number-ordinal"></a>
#### `Number::ordinal()` {.collection-method}

The `Number::ordinal` method returns a number's ordinal representation:

use Illuminate\Support\Number;

$number = Number::ordinal(1);

// 1st

$number = Number::ordinal(2);

// 2nd

$number = Number::ordinal(21);

// 21st

<a name="method-number-spell"></a>
#### `Number::spell()` {.collection-method}

The `Number::spell` method transforms the given number into a string of words:

use Illuminate\Support\Number;

$number = Number::spell(102);

// one hundred and two

$number = Number::spell(88, locale: 'fr');

// quatre-vingt-huit


The `after` argument allows you to specify a value after which all numbers should be spelled out:

$number = Number::spell(10, after: 10);

// 10

$number = Number::spell(11, after: 10);

// eleven

The `until` argument allows you to specify a value before which all numbers should be spelled out:

$number = Number::spell(5, until: 10);

// five

$number = Number::spell(10, until: 10);

// 10

<a name="method-number-use-locale"></a>
#### `Number::useLocale()` {.collection-method}

The `Number::useLocale` method sets the default number locale globally, which affects how numbers and currency are formatted by subsequent invocations to the `Number` class's methods:

use Illuminate\Support\Number;

/**
* Bootstrap any application services.
*/
public function boot(): void
{
Number::useLocale('de');
}

<a name="method-number-with-locale"></a>
#### `Number::withLocale()` {.collection-method}

The `Number::withLocale` method executes the given closure using the specified locale and then restores the original locale after the callback has executed:

use Illuminate\Support\Number;

$number = Number::withLocale('de', function () {
return Number::format(1500);
});

<a name="paths"></a>
## Paths

Expand Down Expand Up @@ -1268,7 +1353,7 @@ The `lang_path` function returns the fully qualified path to your application's

$path = lang_path('en/messages.php');

> [!NOTE]
> [!NOTE]
> By default, the Laravel application skeleton does not include the `lang` directory. If you would like to customize Laravel's language files, you may publish them via the `lang:publish` Artisan command.
<a name="method-mix"></a>
Expand Down Expand Up @@ -1614,7 +1699,7 @@ The `env` function retrieves the value of an [environment variable](/docs/{{vers

$env = env('APP_ENV', 'production');

> [!WARNING]
> [!WARNING]
> If you execute the `config:cache` command during your deployment process, you should be sure that you are only calling the `env` function from within your configuration files. Once the configuration has been cached, the `.env` file will not be loaded and all calls to the `env` function will return `null`.
<a name="method-event"></a>
Expand Down Expand Up @@ -1996,13 +2081,13 @@ The `value` function returns the value it is given. However, if you pass a closu
});

// false

Additional arguments may be passed to the `value` function. If the first argument is a closure then the additional parameters will be passed to the closure as arguments, otherwise they will be ignored:

$result = value(function (string $name) {
return $name;
}, 'Taylor');

// 'Taylor'

<a name="method-view"></a>
Expand Down
4 changes: 3 additions & 1 deletion original-en/scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ public function toSearchableArray()
}
```

You should also define your Typesense collection schemas in your application's `config/scout.php` file. A collection schema describes the data types of each field that is searchable via Typesense. For more information on all available schema options, please consult the [Typesense documentation](https://typesense.org/docs/latest/api/collections.html#schema-parameters). If you need to change your Typesense collection's schema after it has been defined, you must do so via Typesense's API.
You should also define your Typesense collection schemas in your application's `config/scout.php` file. A collection schema describes the data types of each field that is searchable via Typesense. For more information on all available schema options, please consult the [Typesense documentation](https://typesense.org/docs/latest/api/collections.html#schema-parameters).

If you need to change your Typesense collection's schema after it has been defined, you may either run `scout:flush` and `scout:import`, which will delete all existing indexed data and recreate the schema. Or, you may use Typesense's API to modify the collection's schema without removing any indexed data.

If your searchable model is soft deletable, you should define a `__soft_deleted` field in the model's corresponding Typesense schema within your application's `config/scout.php` configuration file:

Expand Down
16 changes: 16 additions & 0 deletions original-en/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
[squish](#method-fluent-str-squish)
[start](#method-fluent-str-start)
[startsWith](#method-fluent-str-starts-with)
[stripTags](#method-fluent-str-strip-tags)
[studly](#method-fluent-str-studly)
[substr](#method-fluent-str-substr)
[substrReplace](#method-fluent-str-substrreplace)
Expand Down Expand Up @@ -2295,6 +2296,21 @@ The `startsWith` method determines if the given string begins with the given val

// true

<a name="method-fluent-str-strip-tags"></a>
#### `stripTags` {.collection-method}

The `stripTags` method removes all HTML and PHP tags from a string:

use Illuminate\Support\Str;

$result = Str::of('<a href="https://laravel.com">Taylor <b>Otwell</b></a>')->stripTags();

// Taylor Otwell

$result = Str::of('<a href="https://laravel.com">Taylor <b>Otwell</b></a>')->stripTags('<b>');

// Taylor <b>Otwell</b>

<a name="method-fluent-str-studly"></a>
#### `studly` {.collection-method}

Expand Down
6 changes: 1 addition & 5 deletions original-en/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@ The `registerPolicies` method of the `AuthServiceProvider` is now invoked automa

**Likelihood Of Impact: Medium**

Redis [cache tag](/docs/{{version}}/cache#cache-tags) support has been rewritten for better performance and storage efficiency. In previous releases of Laravel, stale cache tags would accumulate in the cache when using Redis as your application's cache driver.

However, to properly prune stale cache tag entries, Laravel's new `cache:prune-stale-tags` Artisan command should be [scheduled](/docs/{{version}}/scheduling) in your application's `App\Console\Kernel` class:

$schedule->command('cache:prune-stale-tags')->hourly();
Usage of `Cache::tags()` is only recommended for applications using Memcached. If you are using Redis as your application's cache driver, you should consider moving to Memcached or using an alternative solution.

### Database

Expand Down
2 changes: 1 addition & 1 deletion translation-ja/dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
使用を開始するには、[Google Chrome](https://www.google.com/chrome)をインストールして、プロジェクトに`Laravel/Dusk` Composer依存パッケージを追加する必要があります。

```shell
composer require --dev laravel/dusk
composer require laravel/dusk --dev
```

> [!WARNING]
Expand Down
6 changes: 6 additions & 0 deletions translation-ja/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ php artisan storage:link
public_path('images') => storage_path('app/images'),
],

設定したシンボリックリンクを破棄するには、`storage:unlink` コマンドを使用します。

```shell
php artisan storage:unlink
```

<a name="driver-prerequisites"></a>
### ドライバの動作要件

Expand Down
89 changes: 87 additions & 2 deletions translation-ja/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ Laravelはさまざまな、グローバル「ヘルパ」PHP関数を用意し
[Number::currency](#method-number-currency)
[Number::fileSize](#method-number-file-size)
[Number::forHumans](#method-number-for-humans)
[Number::ordinal](#method-number-ordinal)
[Number::spell](#method-number-spell)
[Number::useLocale](#method-number-use-locale)
[Number::withLocale](#method-number-with-locale)

</div>

Expand Down Expand Up @@ -1220,6 +1224,87 @@ $classes = Arr::toCssStyles($array);

// 1.23 million

<a name="method-number-ordinal"></a>
#### `Number::ordinal()` {.collection-method}

`Number::ordinal`メソッドは、数値の序数英語表現を返します。

use Illuminate\Support\Number;

$number = Number::ordinal(1);

// 1st

$number = Number::ordinal(2);

// 2nd

$number = Number::ordinal(21);

// 21st

<a name="method-number-spell"></a>
#### `Number::spell()` {.collection-method}

Number::spell`メソッドは、指定する数字を単語の文字列へ変換します。

use Illuminate\Support\Number;

$number = Number::spell(102);

// one hundred and two

$number = Number::spell(88, locale: 'fr');

// quatre-vingt-huit


`after`引数は、これより大きい数字は文字へ変換する値を指定します。

$number = Number::spell(10, after: 10);

// 10

$number = Number::spell(11, after: 10);

// eleven

`until`引数は、これより大きい数字は文字へ変換する値を指定します。

$number = Number::spell(5, until: 10);

// five

$number = Number::spell(10, until: 10);

// 10

<a name="method-number-use-locale"></a>
#### `Number::useLocale()` {.collection-method}

`Number::useLocale`メソッドはデフォルトの数値ロケールをグローバルに指定します。この指定は、以降に実行する`Number`クラスのメソッドの数字や金額のフォーマットに影響を与えます。

use Illuminate\Support\Number;

/**
* Bootstrap any application services.
*/
public function boot(): void
{
Number::useLocale('de');
}

<a name="method-number-with-locale"></a>
#### `Number::withLocale()` {.collection-method}

`Number::withLocale`メソッドは、指定ロケールを用いてクロージャを実行し、コールバック実行後に元のロケールに戻します。

use Illuminate\Support\Number;

$number = Number::withLocale('de', function () {
return Number::format(1500);
});

<a name="paths"></a>
## パス

Expand Down Expand Up @@ -1268,7 +1353,7 @@ $classes = Arr::toCssStyles($array);

$path = lang_path('en/messages.php');

> [!NOTE]
> [!NOTE]
> Laravelアプリケーションのスケルトンは、デフォルトで`lang`ディレクトリを用意していません。Laravelの言語ファイルをカスタマイズしたい場合は、`lang:publish` Artisanコマンドでリソース公開することができます。
<a name="method-mix"></a>
Expand Down Expand Up @@ -1614,7 +1699,7 @@ dispatch_sync`関数は、指定ジョブを即時処理する[sync](/docs/{{ver

$env = env('APP_ENV', 'production');

> [!WARNING]
> [!WARNING]
> 開発手順の中で`config:cache`コマンドを実行する場合は、必ず設定ファイルの中からだけ、`env`関数を使用してください。設定ファイルがキャッシュされると、`.env`ファイルはロードされなくなり、`env`関数の呼び出しはすべて`null`を返します。
<a name="method-event"></a>
Expand Down
4 changes: 3 additions & 1 deletion translation-ja/scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ public function toSearchableArray()
}
```

また、アプリケーションの`config/scout.php`ファイルで、Typesenseコレクションのスキーマを定義する必要もあります。コレクションスキーマは、Typesenseを使い検索可能な各フィールドのデータ型を記述します。利用可能なスキーマオプションの詳細については、[Typesenseのドキュメント](https://typesense.org/docs/latest/api/collections.html#schema-parameters)を参照してください。もし、Typesense コレクションのスキーマを定義した後に変更の必要がおきたら、TypesenseのAPIを使用し、変更する必要があります。
また、アプリケーションの`config/scout.php`ファイルで、Typesenseコレクションのスキーマを定義する必要もあります。コレクションスキーマは、Typesenseを使い検索可能な各フィールドのデータ型を記述します。利用可能なスキーマオプションの詳細については、[Typesenseのドキュメント](https://typesense.org/docs/latest/api/collections.html#schema-parameters)を参照してください。

もし、Typesense コレクションのスキーマを定義後に変更する必要がある場合は、`scout:flush``scout:import` を実行し、既存のインデックス済みデータを全て削除し、スキーマを再作成します。あるいは、TypesenseのAPIを使い、インデックス済みデータを削除せずにコレクションのスキーマを変更することもできます。

Searchableなモデルがソフトデリート可能である場合、アプリケーションの`config/scout.php`設定ファイル内の、モデルに対応するTypesenseスキーマに`__soft_deleted`フィールドを定義する必要があります。

Expand Down
16 changes: 16 additions & 0 deletions translation-ja/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Laravelには、文字列値を操作する様々な関数があります。こ
[squish](#method-fluent-str-squish)
[start](#method-fluent-str-start)
[startsWith](#method-fluent-str-starts-with)
[stripTags](#method-fluent-str-strip-tags)
[studly](#method-fluent-str-studly)
[substr](#method-fluent-str-substr)
[substrReplace](#method-fluent-str-substrreplace)
Expand Down Expand Up @@ -2295,6 +2296,21 @@ The `snake` method converts the given string to `snake`メソッドは、文字

// true

<a name="method-fluent-str-strip-tags"></a>
#### `stripTags` {.collection-method}

`stripTags`メソッドは、文字列からすべてのHTMLタグとPHPタグを削除します。

use Illuminate\Support\Str;

$result = Str::of('<a href="https://laravel.com">Taylor <b>Otwell</b></a>')->stripTags();

// Taylor Otwell

$result = Str::of('<a href="https://laravel.com">Taylor <b>Otwell</b></a>')->stripTags('<b>');

// Taylor <b>Otwell</b>

<a name="method-fluent-str-studly"></a>
#### `studly` {.collection-method}

Expand Down
Loading

0 comments on commit 4b2089c

Please sign in to comment.