-
Notifications
You must be signed in to change notification settings - Fork 0
/
transl.php
143 lines (130 loc) · 5.09 KB
/
transl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
declare(strict_types=1);
use Transl\Drivers\LocalFilesDriver;
use Transl\Config\Enums\BranchingConflictResolutionEnum;
use Transl\Actions\Reports\ReportMissingTranslationKeysAction;
return [
'reporting' => [
/**
* Whether translation keys used but for which
* no corresponding translation value could be
* found should be reported to Transl.
*
* Ex.: `__('nonexistent')` -> reports "nonexistent".
*
* By default, enabled only on `app()->isProduction()`.
*/
'should_report_missing_translation_keys' => null,
/**
* The class that should be used to report missing translation
* keys. The class should have either an `__invokable` or
* `execute` method.
*/
'report_missing_translation_keys_using' => ReportMissingTranslationKeysAction::class,
/**
* Whether exceptions thrown during the catching and reporting
* process should be silently discarded. Probably best to
* enable this in production environnements.
*
* By default, enabled only on `app()->isProduction()`.
*/
'silently_discard_exceptions' => null,
],
'defaults' => [
/**
* Default project options that will be used in filling
* a given project's option that hasn't been given a value.
* In other words, fallback option values for a given project.
*
* The exact same as `project.options`.
*
* @see `\Transl\Config\Values\ProjectConfigurationOptions`
*/
'project_options' => [
/**
* A local directory used to store/cache/track
* necessary informations.
*
* - If set to `null`, `storage_path('app/.transl')` will be used.
* - If set to `false`, the feature will be disabled (conflicts won't be detected).
*/
'transl_directory' => storage_path('app/.transl'),
/**
* The project's branching specific configurations.
*/
'branching' => [
/**
* The default branch name to use in contexts where
* none was provided and/or none could be determined
* either because of limitations or configurations.
*/
'default_branch_name' => 'main',
/**
* Whether local Git branches, when pushing translation
* lines to Transl, should be reflected on Transl.
*/
'mirror_current_branch' => true,
/**
* How detected conflicts should be handled.
* Check the Enum for more details and values.
*/
'conflict_resolution' => BranchingConflictResolutionEnum::MERGE_BUT_THROW->value,
],
],
],
'projects' => [
[
/**
* The project's authentication key.
* Used to both identify the project and
* the user making local and remote changes.
*
* This value should be unique per team members/bots.
* This value should be created/retrieved/refreshed from Transl.
*/
'auth_key' => env('TRANSL_KEY', 'Empty `TRANSL_KEY` environnement variable.'),
/**
* A user friendly name given to the project.
* Used when printing the project back to the user
* in console outputs, exception messages etc... .
*
* Falls back to be a truncated and redacted version
* of the authentication key.
*/
'name' => 'My first project',
/**
* The project's configuration options.
* Used to configure behaviors.
*
* Same as and merged with (overwriting) "project_options"
* in the above "defaults" key.
*
* @see `\Transl\Config\Values\ProjectConfigurationOptions`
*/
'options' => [],
/**
* The project's configuration drivers.
* Used for identifying, retrieving, updating and handling
* translation contents.
*/
'drivers' => [
/**
* A driver scanning local directories for translation files
* based on Laravel's default behavior.
*
* Check out the classe's constructor properties for a full
* list of possible params and their description.
*/
LocalFilesDriver::class => [
'language_directories' => array_filter([
/**
* Ensure the language directory is first published
* with: `php artisan lang:publish`.
*/
file_exists(lang_path()) ? lang_path() : '',
]),
],
],
],
],
];