/** * Import country translates from external source. * This command load and parse countryinfo csv data file. * * @throws Exception if the path argument is invalid. */ public function actionCountries($language) { if (!in_array($language, Module::getInstance()->translateLanguages)) { $this->stdout("Not supported language code, available codes: [" . implode(', ', Module::getInstance()->translateLanguages) . "].\n", Console::FG_RED); return self::EXIT_CODE_ERROR; } $this->module->importer->run('CountryTranslateRunner', ['language' => $language]); $this->stdout(Module::t('common', 'Country translates has been imported') . "!\n", Console::FG_YELLOW); }
<?php use filsh\geonames\Module; /** * @var yii\widgets\ActiveForm $form * @var filsh\geonames\models\Timezone $model */ ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <?php foreach (Module::getInstance()->translateLanguages as $language) { echo $form->field($model->translate($language), "[{$language}]title")->textInput(['maxlength' => true]); } ?> <?php echo $form->field($model, 'country')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'timezone')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'offset_gmt')->textInput(['maxlength' => true]); ?>