Skip to content

Commit 2237318

Browse files
committed
locals: Publish and translate to he & install checkers
1 parent 1f110f9 commit 2237318

File tree

11 files changed

+619
-0
lines changed

11 files changed

+619
-0
lines changed

config/translator.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Default Translation Service
7+
|--------------------------------------------------------------------------
8+
|
9+
| This option controls the default translation service that gets used when
10+
| using this translation library. This service is used when another is
11+
| not explicitly specified when executing a given translation function.
12+
|
13+
| Supported: "google", "openai", "deepl"
14+
|
15+
*/
16+
'default' => env('DEFAULT_TRANSLATOR_SERVICE', 'free_google'),
17+
'translators' => [
18+
'free_google' => [
19+
'driver' => Bottelet\TranslationChecker\Translator\FreeGoogleTranslator::class,
20+
],
21+
'google' => [
22+
'driver' => Bottelet\TranslationChecker\Translator\GoogleTranslator::class,
23+
'type' => env('GOOGLE_TRANSLATE_TYPE', 'service_account'),
24+
'project_id' => env('GOOGLE_TRANSLATE_PROJECT_ID'),
25+
'private_key' => env('GOOGLE_TRANSLATE_PRIVATE_KEY'),
26+
'client_email' => env('GOOGLE_TRANSLATE_CLIENT_EMAIL'),
27+
'client_x509_cert_url' => env('GOOGLE_TRANSLATE_CLIENT_CERT_URL'),
28+
],
29+
'openai' => [
30+
'driver' => Bottelet\TranslationChecker\Translator\OpenAiTranslator::class,
31+
'model' => env('OPENAI_MODEL', 'gpt-4o'),
32+
'api_key' => env('OPENAI_API_KEY'),
33+
'organization_id' => env('OPENAI_ORGANIZATION'),
34+
35+
/**
36+
* Custom added prompt to enhance translation quality.
37+
*
38+
* Example:
39+
* 'prompt_extension' => 'This application translates medical terms consistently throughout.'
40+
*/
41+
'prompt_extension' => '',
42+
],
43+
'deepl' => [
44+
'driver' => Bottelet\TranslationChecker\Translator\DeeplTranslator::class,
45+
'api_key' => env('DEEPL_API_KEY'),
46+
],
47+
],
48+
'source_paths' => [
49+
base_path('app/'),
50+
base_path('resources/'),
51+
],
52+
'language_folder' => base_path('/lang'),
53+
54+
/**
55+
* Defines the function used to mark strings for translation without actually translating them.
56+
*
57+
* When this function (e.g., '__t') is used, it returns the original string unchanged. This is useful
58+
* for cases where the string should be saved in the database or processed without translation, but still
59+
* needs to be flagged for translation in the future.
60+
*
61+
* Set this to the name of the function that will act as a no-op for translation (e.g., '__t').
62+
*/
63+
'noop_translation' => '__t',
64+
65+
/**
66+
* A list of specific strings or keys that should always be included in translation files.
67+
*
68+
* These strings will remain in the translation system even if they are not actively found
69+
* during clean processes. This is useful for reserved words, fallback keys, or
70+
* any content that should be protected from deletion or always be translated.
71+
*
72+
* Add the words or keys that need to be permanently available for translators.
73+
*/
74+
'persistent_keys' => [],
75+
];

lang/en.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"auth.password": "Password",
3+
"auth.password.missing": "Password is required.",
4+
"A reset link will be sent if the account exists.": "A reset link will be sent if the account exists.",
5+
"auth.failed": "Authentication failed.",
6+
"auth.failed.missing": "Authentication failed. Please try again.",
7+
"auth.throttle": "Too many login attempts. Please try again later.",
8+
"auth.throttle.missing": "Too many login attempts. Please wait before retrying.",
9+
"!": "!",
10+
"foo": null
11+
}

lang/en/auth.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Authentication Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines are used during authentication for various
11+
| messages that we need to display to the user. You are free to modify
12+
| these language lines according to your application's requirements.
13+
|
14+
*/
15+
16+
'failed' => 'These credentials do not match our records.',
17+
'password' => 'The provided password is incorrect.',
18+
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
19+
20+
];

lang/en/pagination.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Pagination Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines are used by the paginator library to build
11+
| the simple pagination links. You are free to change them to anything
12+
| you want to customize your views to better match your application.
13+
|
14+
*/
15+
16+
'previous' => '&laquo; Previous',
17+
'next' => 'Next &raquo;',
18+
19+
];

lang/en/passwords.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Password Reset Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines are the default lines which match reasons
11+
| that are given by the password broker for a password update attempt
12+
| outcome such as failure due to an invalid password / reset token.
13+
|
14+
*/
15+
16+
'reset' => 'Your password has been reset.',
17+
'sent' => 'We have emailed your password reset link.',
18+
'throttled' => 'Please wait before retrying.',
19+
'token' => 'This password reset token is invalid.',
20+
'user' => "We can't find a user with that email address.",
21+
22+
];

lang/en/validation.php

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Validation Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines contain the default error messages used by
11+
| the validator class. Some of these rules have multiple versions such
12+
| as the size rules. Feel free to tweak each of these messages here.
13+
|
14+
*/
15+
16+
'phone' => 'The :attribute field must be a valid number.',
17+
18+
'accepted' => 'The :attribute field must be accepted.',
19+
'accepted_if' => 'The :attribute field must be accepted when :other is :value.',
20+
'active_url' => 'The :attribute field must be a valid URL.',
21+
'after' => 'The :attribute field must be a date after :date.',
22+
'after_or_equal' => 'The :attribute field must be a date after or equal to :date.',
23+
'alpha' => 'The :attribute field must only contain letters.',
24+
'alpha_dash' => 'The :attribute field must only contain letters, numbers, dashes, and underscores.',
25+
'alpha_num' => 'The :attribute field must only contain letters and numbers.',
26+
'any_of' => 'The :attribute field is invalid.',
27+
'array' => 'The :attribute field must be an array.',
28+
'ascii' => 'The :attribute field must only contain single-byte alphanumeric characters and symbols.',
29+
'before' => 'The :attribute field must be a date before :date.',
30+
'before_or_equal' => 'The :attribute field must be a date before or equal to :date.',
31+
'between' => [
32+
'array' => 'The :attribute field must have between :min and :max items.',
33+
'file' => 'The :attribute field must be between :min and :max kilobytes.',
34+
'numeric' => 'The :attribute field must be between :min and :max.',
35+
'string' => 'The :attribute field must be between :min and :max characters.',
36+
],
37+
'boolean' => 'The :attribute field must be true or false.',
38+
'can' => 'The :attribute field contains an unauthorized value.',
39+
'confirmed' => 'The :attribute field confirmation does not match.',
40+
'contains' => 'The :attribute field is missing a required value.',
41+
'current_password' => 'The password is incorrect.',
42+
'date' => 'The :attribute field must be a valid date.',
43+
'date_equals' => 'The :attribute field must be a date equal to :date.',
44+
'date_format' => 'The :attribute field must match the format :format.',
45+
'decimal' => 'The :attribute field must have :decimal decimal places.',
46+
'declined' => 'The :attribute field must be declined.',
47+
'declined_if' => 'The :attribute field must be declined when :other is :value.',
48+
'different' => 'The :attribute field and :other must be different.',
49+
'digits' => 'The :attribute field must be :digits digits.',
50+
'digits_between' => 'The :attribute field must be between :min and :max digits.',
51+
'dimensions' => 'The :attribute field has invalid image dimensions.',
52+
'distinct' => 'The :attribute field has a duplicate value.',
53+
'doesnt_end_with' => 'The :attribute field must not end with one of the following: :values.',
54+
'doesnt_start_with' => 'The :attribute field must not start with one of the following: :values.',
55+
'email' => 'The :attribute field must be a valid email address.',
56+
'ends_with' => 'The :attribute field must end with one of the following: :values.',
57+
'enum' => 'The selected :attribute is invalid.',
58+
'exists' => 'The selected :attribute is invalid.',
59+
'extensions' => 'The :attribute field must have one of the following extensions: :values.',
60+
'file' => 'The :attribute field must be a file.',
61+
'filled' => 'The :attribute field must have a value.',
62+
'gt' => [
63+
'array' => 'The :attribute field must have more than :value items.',
64+
'file' => 'The :attribute field must be greater than :value kilobytes.',
65+
'numeric' => 'The :attribute field must be greater than :value.',
66+
'string' => 'The :attribute field must be greater than :value characters.',
67+
],
68+
'gte' => [
69+
'array' => 'The :attribute field must have :value items or more.',
70+
'file' => 'The :attribute field must be greater than or equal to :value kilobytes.',
71+
'numeric' => 'The :attribute field must be greater than or equal to :value.',
72+
'string' => 'The :attribute field must be greater than or equal to :value characters.',
73+
],
74+
'hex_color' => 'The :attribute field must be a valid hexadecimal color.',
75+
'image' => 'The :attribute field must be an image.',
76+
'in' => 'The selected :attribute is invalid.',
77+
'in_array' => 'The :attribute field must exist in :other.',
78+
'in_array_keys' => 'The :attribute field must contain at least one of the following keys: :values.',
79+
'integer' => 'The :attribute field must be an integer.',
80+
'ip' => 'The :attribute field must be a valid IP address.',
81+
'ipv4' => 'The :attribute field must be a valid IPv4 address.',
82+
'ipv6' => 'The :attribute field must be a valid IPv6 address.',
83+
'json' => 'The :attribute field must be a valid JSON string.',
84+
'list' => 'The :attribute field must be a list.',
85+
'lowercase' => 'The :attribute field must be lowercase.',
86+
'lt' => [
87+
'array' => 'The :attribute field must have less than :value items.',
88+
'file' => 'The :attribute field must be less than :value kilobytes.',
89+
'numeric' => 'The :attribute field must be less than :value.',
90+
'string' => 'The :attribute field must be less than :value characters.',
91+
],
92+
'lte' => [
93+
'array' => 'The :attribute field must not have more than :value items.',
94+
'file' => 'The :attribute field must be less than or equal to :value kilobytes.',
95+
'numeric' => 'The :attribute field must be less than or equal to :value.',
96+
'string' => 'The :attribute field must be less than or equal to :value characters.',
97+
],
98+
'mac_address' => 'The :attribute field must be a valid MAC address.',
99+
'max' => [
100+
'array' => 'The :attribute field must not have more than :max items.',
101+
'file' => 'The :attribute field must not be greater than :max kilobytes.',
102+
'numeric' => 'The :attribute field must not be greater than :max.',
103+
'string' => 'The :attribute field must not be greater than :max characters.',
104+
],
105+
'max_digits' => 'The :attribute field must not have more than :max digits.',
106+
'mimes' => 'The :attribute field must be a file of type: :values.',
107+
'mimetypes' => 'The :attribute field must be a file of type: :values.',
108+
'min' => [
109+
'array' => 'The :attribute field must have at least :min items.',
110+
'file' => 'The :attribute field must be at least :min kilobytes.',
111+
'numeric' => 'The :attribute field must be at least :min.',
112+
'string' => 'The :attribute field must be at least :min characters.',
113+
],
114+
'min_digits' => 'The :attribute field must have at least :min digits.',
115+
'missing' => 'The :attribute field must be missing.',
116+
'missing_if' => 'The :attribute field must be missing when :other is :value.',
117+
'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
118+
'missing_with' => 'The :attribute field must be missing when :values is present.',
119+
'missing_with_all' => 'The :attribute field must be missing when :values are present.',
120+
'multiple_of' => 'The :attribute field must be a multiple of :value.',
121+
'not_in' => 'The selected :attribute is invalid.',
122+
'not_regex' => 'The :attribute field format is invalid.',
123+
'numeric' => 'The :attribute field must be a number.',
124+
'password' => [
125+
'letters' => 'The :attribute field must contain at least one letter.',
126+
'mixed' => 'The :attribute field must contain at least one uppercase and one lowercase letter.',
127+
'numbers' => 'The :attribute field must contain at least one number.',
128+
'symbols' => 'The :attribute field must contain at least one symbol.',
129+
'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
130+
],
131+
'present' => 'The :attribute field must be present.',
132+
'present_if' => 'The :attribute field must be present when :other is :value.',
133+
'present_unless' => 'The :attribute field must be present unless :other is :value.',
134+
'present_with' => 'The :attribute field must be present when :values is present.',
135+
'present_with_all' => 'The :attribute field must be present when :values are present.',
136+
'prohibited' => 'The :attribute field is prohibited.',
137+
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
138+
'prohibited_if_accepted' => 'The :attribute field is prohibited when :other is accepted.',
139+
'prohibited_if_declined' => 'The :attribute field is prohibited when :other is declined.',
140+
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
141+
'prohibits' => 'The :attribute field prohibits :other from being present.',
142+
'regex' => 'The :attribute field format is invalid.',
143+
'required' => 'The :attribute field is required.',
144+
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
145+
'required_if' => 'The :attribute field is required when :other is :value.',
146+
'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
147+
'required_if_declined' => 'The :attribute field is required when :other is declined.',
148+
'required_unless' => 'The :attribute field is required unless :other is in :values.',
149+
'required_with' => 'The :attribute field is required when :values is present.',
150+
'required_with_all' => 'The :attribute field is required when :values are present.',
151+
'required_without' => 'The :attribute field is required when :values is not present.',
152+
'required_without_all' => 'The :attribute field is required when none of :values are present.',
153+
'same' => 'The :attribute field must match :other.',
154+
'size' => [
155+
'array' => 'The :attribute field must contain :size items.',
156+
'file' => 'The :attribute field must be :size kilobytes.',
157+
'numeric' => 'The :attribute field must be :size.',
158+
'string' => 'The :attribute field must be :size characters.',
159+
],
160+
'starts_with' => 'The :attribute field must start with one of the following: :values.',
161+
'string' => 'The :attribute field must be a string.',
162+
'timezone' => 'The :attribute field must be a valid timezone.',
163+
'unique' => 'The :attribute has already been taken.',
164+
'uploaded' => 'The :attribute failed to upload.',
165+
'uppercase' => 'The :attribute field must be uppercase.',
166+
'url' => 'The :attribute field must be a valid URL.',
167+
'ulid' => 'The :attribute field must be a valid ULID.',
168+
'uuid' => 'The :attribute field must be a valid UUID.',
169+
170+
/*
171+
|--------------------------------------------------------------------------
172+
| Custom Validation Language Lines
173+
|--------------------------------------------------------------------------
174+
|
175+
| Here you may specify custom validation messages for attributes using the
176+
| convention "attribute.rule" to name the lines. This makes it quick to
177+
| specify a specific custom language line for a given attribute rule.
178+
|
179+
*/
180+
181+
'custom' => [
182+
'attribute-name' => [
183+
'rule-name' => 'custom-message',
184+
],
185+
],
186+
187+
/*
188+
|--------------------------------------------------------------------------
189+
| Custom Validation Attributes
190+
|--------------------------------------------------------------------------
191+
|
192+
| The following language lines are used to swap our attribute placeholder
193+
| with something more reader friendly such as "E-Mail Address" instead
194+
| of "email". This simply helps us make our message more expressive.
195+
|
196+
*/
197+
198+
'attributes' => [],
199+
200+
];

lang/he.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"A reset link will be sent if the account exists.": "קישור לאיפוס יישלח אם החשבון קיים.",
3+
"auth.failed": "האימות נכשל.",
4+
"auth.failed.missing": "האימות נכשל. אנא נסה שוב.",
5+
"auth.password": "סיסמה",
6+
"auth.password.missing": "נדרשת סיסמה.",
7+
"auth.throttle": "יותר מדי ניסיונות כניסה. אנא נסה שוב מאוחר יותר.",
8+
"auth.throttle.missing": "יותר מדי ניסיונות כניסה. אנא המתן לפני שתנסה שוב.",
9+
"foo": "foo",
10+
"!": "!"
11+
}

lang/he/auth.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Authentication Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines are used during authentication for various
11+
| messages that we need to display to the user. You are free to modify
12+
| these language lines according to your application's requirements.
13+
|
14+
*/
15+
16+
'failed' => 'פרטי ההתחברות אינם תואמים את הרשומות שלנו.',
17+
'password' => 'הסיסמה שהוזנה שגויה.',
18+
'throttle' => 'יותר מדי ניסיונות התחברות. אנא נסה שוב בעוד :seconds שניות.',
19+
20+
];

0 commit comments

Comments
 (0)