Skip to content

Commit 5fed83c

Browse files
committed
Fix logic for which languages to process
1 parent 48c6bf9 commit 5fed83c

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

ExcelMessageController.php

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ class ExcelMessageController extends Controller
2424

2525
/**
2626
* @var string Comma separated list of languages to process.
27+
* Default are all languages listed in the messages config file.
2728
*/
2829
public $languages;
2930

3031
/**
3132
* @var string Comma separated list of categories to process.
33+
* Default are all categories.
3234
*/
3335
public $categories;
3436

@@ -45,9 +47,10 @@ class ExcelMessageController extends Controller
4547
public $ignoreCategories;
4648

4749
/**
48-
* @var null|string The line height to set on created Excel files.
49-
* By default the line height is set to auto, but this is broken for LibreOffice Calc.
50-
* You can try values like `50` here to set a fixed line height instead.
50+
* @var null|string The line height to set on created Excel files. By
51+
* default the line height is set to auto, but this is broken for
52+
* LibreOffice Calc. You can try values like `50` here to set a fixed line
53+
* height instead.
5154
*/
5255
public $lineHeight;
5356

@@ -66,13 +69,17 @@ public function options($actionID)
6669
/**
6770
* Creates Excel files with translations from PHP message files.
6871
*
69-
* By default this command will go through all configured PHP message files and
70-
* check for new translations. It will then write those missing translations
71-
* to an Excel file, using one file per language and one sheet per category.
72+
* By default this command will go through all configured PHP message files
73+
* and check for new translations. It will then write those missing
74+
* translations to an Excel file, using one file per language and one sheet
75+
* per category.
7276
*
73-
* @param string $configFile The path or alias of the message configuration file.
74-
* @param string $excelDir The path or alias to the output directory for the Excel files.
75-
* @param string $type The type of messages to include. Either 'new' (default) or 'all'.
77+
* @param string $configFile The path or alias of the message configuration
78+
* file.
79+
* @param string $excelDir The path or alias to the output directory for
80+
* the Excel files.
81+
* @param string $type The type of messages to include. Either 'new'
82+
* (default) or 'all'.
7683
* @throws Exception on failure.
7784
*/
7885
public function actionExport($configFile, $excelDir, $type = 'new')
@@ -120,14 +127,17 @@ public function actionExport($configFile, $excelDir, $type = 'new')
120127
/**
121128
* Import the translations from Excel files into PHP message files.
122129
*
123-
* By default this command will go through all found Excel files in the given directory,
124-
* read out the non-empty translations and update the respective PHP message files. The
125-
* files must be in the same structure as created by the export command: One file per
126-
* language, with the language code as filename, one sheet per category, source is in
127-
* column A, translation in column B. The first line gets ignored.
130+
* By default this command will go through all found Excel files in the
131+
* given directory, read out the non-empty translations and update the
132+
* respective PHP message files. The files must be in the same structure as
133+
* created by the export command: One file per language, with the language
134+
* code as filename, one sheet per category, source is in column A,
135+
* translation in column B. The first line gets ignored.
128136
*
129-
* @param string $configFile The path or alias of the message configuration file.
130-
* @param string $excelDir The path or alias to the input directory for the Excel files.
137+
* @param string $configFile The path or alias of the message configuration
138+
* file.
139+
* @param string $excelDir The path or alias to the input directory for the
140+
* Excel files.
131141
* @param string $extension The Excel file extension. Default is 'xlsx'.
132142
* @return void
133143
*/
@@ -168,11 +178,12 @@ public function actionImport($configFile, $excelDir, $extension = 'xlsx')
168178
}
169179

170180
/**
171-
* Check whether arguments are valid
181+
* Check whether arguments and config file are valid
172182
*
173183
* @param string $configFile the path or alias of the configuration file.
174-
* @param string $excelDir the path or alias to the directory of the Excel files
175-
* @return void
184+
* @param string $excelDir the path or alias to the directory of the Excel
185+
* files
186+
* @return array the configuration from the config file
176187
*/
177188
protected function checkArgs($configFile, $excelDir)
178189
{

0 commit comments

Comments
 (0)