@@ -92,6 +92,8 @@ A more complex example including database table with multilingual support is bel
92
92
'translatemanager' => [
93
93
'class' => 'lajax\translatemanager\Module',
94
94
'root' => '@app', // The root directory of the project scan.
95
+ 'scanRootParentDirectory' => true, // Whether scan the defined `root` parent directory, or the folder itself.
96
+ // IMPORTANT: for detailed instructions read the chapter about root configuration.
95
97
'layout' => 'language', // Name of the used layout. If using own layout use 'null'.
96
98
'allowedIPs' => ['127.0.0.1'], // IP addresses from which the translation interface is accessible.
97
99
'roles' => ['@'], // For setting access levels to the translating interface.
@@ -118,7 +120,25 @@ A more complex example including database table with multilingual support is bel
118
120
],
119
121
```
120
122
121
- IMPORTANT: If you want to modify the value of roles (in other words to start using user roles) you need to enable authManager in the common config.
123
+ #### Configuring the scan root
124
+
125
+ The file scanner will scan the configured folders for translatable elements. The following two options
126
+ determine the scan root directory: ` root ` , and ` scanRootParentDirectory ` . These options are defaults to
127
+ values that works with the Yii 2 advanced project template. If you are using basic template, you have to modify
128
+ these settings.
129
+
130
+ The ` root ` options tells which is the root folder for project scan. However if ` scanRootParentDirectory ` is set to ` true `
131
+ (which is the default value), the scan will run on the parent directory. This is desired behavior on advanced template,
132
+ because the ` @app ` is the root for the current app, which is a subfolder inside the project (so the entire root of the
133
+ project is the parent directory of ` @app ` ).
134
+
135
+ For basic template the ` @app ` is also the root for the entire project. Because of this with the default value
136
+ of ` scanRootParentDirectory ` , the scan runs outside the project folder. This is not desired behavior, and
137
+ changing the value to ` false ` solves this.
138
+
139
+ ** IMPORTANT: Changing the ` scanRootParentDirectory ` from ` true ` to ` false ` could cause loss of translated items,
140
+ as optimize action removes the missing items.** Changing the root folder can cause also loss, so be sure to
141
+ double check your configuration!
122
142
123
143
Using of [ authManager] ( http://www.yiiframework.com/doc-2.0/guide-security-authorization.html ) .
124
144
0 commit comments