Skip to content

Commit d7afb7d

Browse files
authored
[Feature] Add French translations for errors and validation (#586)
Closes #585
1 parent 981c8c6 commit d7afb7d

File tree

2 files changed

+223
-0
lines changed

2 files changed

+223
-0
lines changed

resources/lang/fr/errors.php

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<?php
2+
/**
3+
* Copyright 2020 Cloud Creativity Limited
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
return [
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Error Object Language Lines
23+
|--------------------------------------------------------------------------
24+
|
25+
| The following language lines contain the default translatable members
26+
| of JSON API error objects. According to the JSON API spec, the
27+
| `title` and `detail` members can be localized. In addition the `code`
28+
| member is also read from this package if you want to give the error
29+
| a specific code.
30+
|
31+
| Set any value to an empty string if you do not want the member to be
32+
| included in the error object.
33+
|
34+
| @see http://jsonapi.org/format/#errors
35+
*/
36+
37+
'unauthorized' => [
38+
'title' => 'Non authentifié',
39+
'detail' => '',
40+
'code' => '',
41+
],
42+
43+
'forbidden' => [
44+
'title' => 'Non autorisé',
45+
'detail' => '',
46+
'code' => '',
47+
],
48+
49+
'token_mismatch' => [
50+
'title' => 'Jeton invalide',
51+
'detail' => "Le jeton n'est pas valide.",
52+
'code' => '',
53+
],
54+
55+
'member_required' => [
56+
'title' => 'Document JSON API invalide',
57+
'detail' => 'Le membre :member est obligatoire.',
58+
'code' => '',
59+
],
60+
61+
'member_object_expected' => [
62+
'title' => 'Document JSON API invalide',
63+
'detail' => 'Le membre :member doit être un objet.',
64+
'code' => '',
65+
],
66+
67+
'member_identifier_expected' => [
68+
'title' => 'Document JSON API invalide',
69+
'detail' => 'Le membre :member doit être un identifiant de ressource.',
70+
'code' => '',
71+
],
72+
73+
'member_string_expected' => [
74+
'title' => 'Document JSON API invalide',
75+
'detail' => 'Le membre :member doit être une chaîne de caractères.',
76+
'code' => '',
77+
],
78+
79+
'member_empty' => [
80+
'title' => 'Document JSON API invalide',
81+
'detail' => 'Le membre :member ne peut être vide.',
82+
'code' => '',
83+
],
84+
85+
'member_field_not_allowed' => [
86+
'title' => 'Document JSON API invalide',
87+
'detail' => 'Le membre :member ne peut avoir de champ :field.',
88+
'code' => '',
89+
],
90+
91+
'resource_type_not_supported' => [
92+
'title' => 'Non supporté',
93+
'detail' => "Le type de ressource :type n'est pas supporté par ce endpoint.",
94+
'code' => '',
95+
],
96+
97+
'resource_type_not_recognised' => [
98+
'title' => 'Non supporté',
99+
'detail' => "Le type de ressource :type n'est pas reconnu.",
100+
'code' => '',
101+
],
102+
103+
'resource_id_not_supported' => [
104+
'title' => 'Non supporté',
105+
'detail' => "L'identifiant de ressource :id n'est pas supporté par ce endpoint.",
106+
'code' => '',
107+
],
108+
109+
'resource_client_ids_not_supported' => [
110+
'title' => 'Non supporté',
111+
'detail' => "Le type de ressource :type n'accepte pas les identifiants générés par le client.",
112+
'code' => '',
113+
],
114+
115+
'resource_exists' => [
116+
'title' => 'Conflit',
117+
'detail' => 'La ressource :id existe déjà.',
118+
'code' => '',
119+
],
120+
121+
'resource_not_found' => [
122+
'title' => 'Introuvable',
123+
'detail' => "La ressource spécifiée n'existe pas.",
124+
'code' => '',
125+
],
126+
127+
'resource_field_exists_in_attributes_and_relationships' => [
128+
'title' => "Document JSON API invalide",
129+
'detail' => 'Le champ :field ne peut être à la fois un attribut et une relation.',
130+
'code' => '',
131+
],
132+
133+
'resource_invalid' => [
134+
'title' => 'Entité non traitable',
135+
'detail' => 'Le document est correctement structuré mais contient des erreurs sémantiques.',
136+
'code' => '',
137+
],
138+
139+
'resource_cannot_be_deleted' => [
140+
'title' => 'Non supprimable',
141+
'detail' => 'La ressource ne peut être supprimée.',
142+
'code' => '',
143+
],
144+
145+
'query_invalid' => [
146+
'title' => 'Paramètre de requête invalide',
147+
'detail' => 'Les paramètres de la requête ne sont pas valides.',
148+
'code' => '',
149+
],
150+
151+
'failed_validator' => [
152+
'title' => 'Entité non traitable',
153+
'detail' => 'Le document est correctement structuré mais contient des erreurs sémantiques.',
154+
'code' => '',
155+
],
156+
];

resources/lang/fr/validation.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
/**
3+
* Copyright 2020 Cloud Creativity Limited
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
return [
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Validation Language Lines
23+
|--------------------------------------------------------------------------
24+
|
25+
| The following language lines contain the default error messages used by
26+
| the validation rules for this package.
27+
|
28+
*/
29+
30+
'allowed_field_sets' => [
31+
'default' => 'Certains champs soumis ne sont pas autorisés.',
32+
'singular' => "Le champ soumis :values n'est pas autorisé.",
33+
'plural' => 'Les champs soumis :values ne sont pas autorisés.',
34+
],
35+
36+
'allowed_filter_parameters' => [
37+
'default' => 'Certains paramètres de filtre de sont pas autorisés.',
38+
'singular' => "Le paramètre de filtre :values n'est pas autorisé.",
39+
'plural' => 'Les paramètres de filtre :values ne sont pas autorisés.',
40+
],
41+
42+
'allowed_include_paths' => [
43+
'default' => 'Certains chemins inclus ne sont pas autorisés.',
44+
'singular' => "Le chemin inclus :values n'est pas autorisé.",
45+
'plural' => 'Les chemins inclus :values ne sont pas autorisés.',
46+
],
47+
48+
'allowed_sort_parameters' => [
49+
'default' => 'Certains paramètres de tri ne sont pas autorisés.',
50+
'singular' => "Le paramètre de tri :values n'est pas autorisé.",
51+
'plural' => 'Les paramètres de tri :values ne sont pas autorisés.',
52+
],
53+
54+
'allowed_page_parameters' => [
55+
'default' => 'Certains paramètres de pagination ne sont pas autorisés.',
56+
'singular' => "Le paramètre de pagination :values n'est pas autorisé.",
57+
'plural' => 'Les paramètres de pagination :values ne sont pas autorisés.',
58+
],
59+
60+
'date_time_iso_8601' => ":attribute n'est pas au format ISO 8601 de date et heure.",
61+
62+
'disallowed_parameter' => "Le paramètre :name n'est pas autorisé.",
63+
64+
'has_one' => 'Le champ :attribute doit être une relation "to-one" contenant des ressources de type :types.',
65+
66+
'has_many' => 'Le champ :attribute doit être une relation "to-many" contenant des ressources de type :types.',
67+
];

0 commit comments

Comments
 (0)