Skip to content

Instantly share code, notes, and snippets.

@jaygaha
Created December 21, 2023 08:39
Show Gist options
  • Save jaygaha/81e86f6da7af627ffa9d3764c4fa609f to your computer and use it in GitHub Desktop.
Save jaygaha/81e86f6da7af627ffa9d3764c4fa609f to your computer and use it in GitHub Desktop.
Laravel Japanese Default Localization #laravel10 #locale #japanese #localization
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
'failed' => 'これらの資格情報は記録と一致しません。',
'password' => '指定されたパスワードが正しくありません。',
'throttle' => 'ログイン試行が多すぎます。:seconds秒後にもう一度お試しください。',
];

Publishing The Language Files

By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:

php artisan lang:publish

Create ja directory inside lang with en directory. Copy the following files inside it.

/lang
  /ja
    auth.php
    pagination.php
    passwords.php
    validation.php

These files are translated in Laravel 10

<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'previous' => '&laquo; 前へ',
'next' => '次へ &raquo;',
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Password Reset Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
'reset' => 'あなたのパスワードはリセットされました!',
'sent' => 'パスワードリセットリンクをメールで送信しました!',
'throttled' => '再試行する前にお待ちください。',
'token' => 'このパスワードリセットトークンは無効です。',
'user' => "そのメールアドレスを持つユーザーが見つかりません。",
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
'accepted' => ':attributeを承認してください。',
'accepted_if' => ':attributeフィールドは、:otherが:valueの場合に受け入れられる必要があります。',
'active_url' => ':attributeには有効なURLを指定してください。',
'after' => ':attributeには:date以降の日付を指定してください。',
'after_or_equal' => ':attributeには:dateかそれ以降の日付を指定してください。',
'alpha' => ':attributeには英字のみからなる文字列を指定してください。',
'alpha_dash' => ':attributeには英数字・ハイフン・アンダースコアのみからなる文字列を指定してください。',
'alpha_num' => ':attributeには英数字のみからなる文字列を指定してください。',
'array' => ':attributeには配列を指定してください。',
'ascii' => ':attributeフィールドには、半角英数字と記号のみを含める必要があります。',
'before' => ':attributeには:date以前の日付を指定してください。',
'before_or_equal' => ':attributeには:dateかそれ以前の日付を指定してください。',
'between' => [
'numeric' => ':attributeには:min〜:maxまでの数値を指定してください。',
'file' => ':attributeには:min〜:max KBのファイルを指定してください。',
'string' => ':attributeには:min〜:max文字の文字列を指定してください。',
'array' => ':attributeには:min〜:max個の要素を持つ配列を指定してください。',
],
'boolean' => ':attributeには真偽値を指定してください。',
'can' => ':attributeフィールドに不正な値が含まれています。',
'confirmed' => ':attributeが確認用の値と一致しません。',
'current_password' => 'パスワードが正しくありません。',
'date' => ':attributeは有効な日付ではありません。',
'date_equals' => ':attributeは:dateと同じ日付でなければなりません。',
'date_format' => ':attributeは:format形式と一致しません。',
'decimal' => ':attributeフィールドには、:decimal小数点以下の桁数が必要です。',
'declined' => ':attributeフィールドは拒否する必要があります。',
'declined_if' => ':otherが:valueの場合、:attributeフィールドは拒否する必要があります。',
'different' => ':attributeには:otherとは異なる値を指定してください。',
'digits' => ':attributeは:digits桁の数字でなければなりません。',
'digits_between' => ':attributeは:min〜:max桁の数字である必要があります。',
'dimensions' => ':attributeの画像サイズが無効です。',
'distinct' => ':attributeに指定された値は重複しています。',
'doesnt_end_with' => ':attributeフィールドは、次のいずれかで終わってはいけません: :values。',
'doesnt_start_with' => ':attributeフィールドは、次のいずれかで始まってはなりません: :values。',
'email' => ':attributeは有効なメールアドレスでなければなりません。',
'ends_with' => ':attributeは、:valuesのいずれかで終了する必要があります。',
'enum' => '選択された:attributeは無効です。',
'exists' => '選択された:attributeは無効です。',
'extensions' => ':attribute フィールドには、次のいずれかの拡張子が必要です:values。',
'file' => ':attributeはファイルでなければなりません。',
'filled' => ':attributeには値が必要です。',
'gt' => [
'numeric' => ':attributeは:valueより大きくなければなりません。',
'file' => ':attributeは:valueキロバイトより大きくなければなりません。',
'string' => ':attributeは:value文字より大きくなければなりません。',
'array' => ':attributeには:valueより多くのアイテムが必要です。',
],
'gte' => [
'numeric' => ':attributeは:value以上でなければなりません。',
'file' => ':attributeは:valueキロバイト以上でなければなりません。',
'string' => ':attributeは:value文字以上でなければなりません。',
'array' => ':attributeには:value以上のアイテムが必要です。',
],
'hex_color' => ':attributeフィールドは有効な16進数の色でなければなりません。',
'image' => ':attributeは画像でなければなりません。',
'in' => '選択された:attributeは無効です。',
'in_array' => ':attributeは:otherに存在しません。',
'integer' => ':attributeは整数でなければなりません。',
'ip' => ':attributeは有効なIPアドレスでなければなりません。',
'ipv4' => ':attributeは有効なIPv4アドレスでなければなりません。',
'ipv6' => ':attributeは有効なIPv6アドレスでなければなりません。',
'json' => ':attributeは有効なJSON文字列でなければなりません。',
'lowercase' => ':attributeフィールドは小文字である必要があります。',
'lt' => [
'numeric' => ':attributeは:valueより小さくなければなりません。',
'file' => ':attributeは:valueキロバイトより小さくなければなりません。',
'string' => ':attributeは:value文字より小さくなければなりません。',
'array' => ':attributeには:valueより少ないアイテムが必要です。',
],
'lte' => [
'numeric' => ':attributeは:value以下でなければなりません。',
'file' => ':attributeは:valueキロバイト以下でなければなりません。',
'string' => ':attributeは:value文字以下でなければなりません。',
'array' => ':attributeには:value以下のアイテムが必要です。',
],
'mac_address' => ':attributeフィールドは有効なMACアドレスである必要があります。',
'max' => [
'numeric' => ':attributeは:maxより大きくてはいけません。',
'file' => ':attributeは:maxキロバイトを超えてはいけません。',
'string' => ':attributeは:max文字を超えてはいけません。',
'array' => ':attributeには:max個を超えるアイテムを含めることはできません。',
],
'max_digits' => ':attributeフィールドには、:max桁を超える数字を含めることはできません。',
'mimes' => ':attributeは:valuesタイプのファイルでなければなりません。',
'mimetypes' => ':attributeは:valuesタイプのファイルでなければなりません。',
'min' => [
'numeric' => ':attributeは:maxより小さくてはいけません。',
'file' => ':attributeは:maxキロバイトより小さくてはいけません。',
'string' => ':attributeは:max文字より小さくてはいけません。',
'array' => ':attributeには少なくとも:min個のアイテムが必要です。',
],
'min_digits' => ':attributeフィールドには少なくとも:min桁が必要です。',
'missing' => ':attributeフィールドが欠落している必要があります。',
'missing_if' => ':otherが:valueの場合、:attributeフィールドは省略する必要があります。',
'missing_unless' => ':otherが:valueでない限り、:attributeフィールドは省略する必要があります。',
'missing_with' => ':valuesが存在する場合、:attributeフィールドは存在しない必要があります。',
'missing_with_all' => ':valuesが存在する場合、:attributeフィールドは存在しない必要があります。',
'multiple_of' => ':attributeは:valueの倍数である必要があります。',
'not_in' => '選択された:attributeは無効です。',
'not_regex' => ':attributeは無効な形式です。',
'numeric' => ':attributeは数値でなければなりません。',
'password' => [
'letters' => ':attributeフィールドには少なくとも1つの文字が含まれている必要があります。',
'mixed' => ':attributeフィールドには、少なくとも1つの大文字と1つの小文字が含まれている必要があります。',
'numbers' => ':attributeフィールドには少なくとも1つの数字が含まれている必要があります。',
'symbols' => ':attributeフィールドには、少なくとも1つのシンボルが含まれている必要があります。',
'uncompromised' => '指定された:attributeがデータ漏洩に発生しました。 別の:attributeを選択してください。',
],
'present' => ':attributeが存在する必要があります。',
'present_if' => ':otherが:valueの場合、:attributeフィールドが存在する必要があります。',
'present_unless' => ':otherが:valueでない限り、:attributeフィールドが存在する必要があります。',
'present_with' => ':valuesが存在する場合、:attributeフィールドが存在する必要があります。',
'present_with_all' => ':valuesが存在する場合、:attributeフィールドが存在する必要があります。',
'prohibited' => ':attributeは禁止されています。',
'prohibited_if' => ':otherが:valueの場合、:attributeは禁止されています。',
'prohibited_unless' => ':otherが:valuesにない限り、:attributeは禁止されています。',
'prohibits' => ':attributeフィールドは、:otherの存在を禁止します。',
'regex' => ':attributeは無効な形式です。',
'required' => ':attributeは必須です。',
'required_array_keys' => ':attributeフィールドには、次のエントリが含まれている必要があります: :values。',
'required_if' => ':otherが:valueの場合、:attributeは必須です。',
'required_if_accepted' => ':otherが受け入れられる場合、:attributeフィールドは必須です。',
'required_unless' => ':otherが:valueではない場合、:attributeは必須です。',
'required_with' => ':valuesのうち一つでも存在する場合、:attributeは必須です。',
'required_with_all' => ':valuesのうち全て存在する場合、:attributeは必須です。',
'required_without' => ':valuesのうちどれか一つでも存在していない場合、:attributeは必須です。',
'required_without_all' => ':valuesのうち全て存在していない場合、:attributeは必須です。',
'same' => ':attributeと:otherは一致する必要があります。',
'size' => [
'numeric' => ':attributeは:sizeでなければなりません。',
'file' => ':attributeは:sizeキロバイトでなければなりません。',
'string' => ':attributeは:size文字でなければなりません。',
'array' => ':attributeには:sizeが含まれている必要があります。',
],
'starts_with' => ':attributeは:valuesのいずれかで始まる必要があります。',
'string' => ':attributeは文字列でなければなりません。',
'timezone' => ':attributeは有効なタイムゾーンでなければなりません。',
'unique' => ':attributeはすでに使用されています。',
'uploaded' => ':attributeのアップロードに失敗しました。',
'uppercase' => ':attributeフィールドは大文字である必要があります。',
'url' => ':attributeは有効なURLでなければなりません。',
'ulid' => ':attributeフィールドは有効なULIDである必要があります。',
'uuid' => ':attributeは有効なUUIDでなければなりません。',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/
'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
],
],
/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap our attribute placeholder
| with something more reader friendly such as "E-Mail Address" instead
| of "email". This simply helps us make our message more expressive.
|
*/
'attributes' => [],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment