Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n Italian Translation #177

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ActiveField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion ActiveForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 2.5.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion ActiveFormAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Affix.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion AffixAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion AlertAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion AlertBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion AnimateAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion AssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
11 changes: 10 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
version 3.1.0
=============
**Date:** 10-Oct-2014

1. enh #169: Enhancement for ICU format conversion for DatePicker and DateTimePicker (enrica, kartik-v).
2. bug #172: More correct InputWidget name field parsing.
3. enh #173: Fix styling for FileInput additional line feed.
4. enh #177: Add Italian translations.

version 3.0.0
=============
**Date:** 08-Oct-2014

1. PSR4 alias change
2. enh #162: Add Russian locale and translation for DatePicker plugin.
3. enh #165, #166, #168: Various Select2 styling enhancements for Bootstrap.
4. Updated Select2 plugin version to latest.
4. Updated Select2 plugin version to latest version.

version 2.9.0
=============
Expand Down
2 changes: 1 addition & 1 deletion ColorInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion ColorInputAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
6 changes: 2 additions & 4 deletions DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down Expand Up @@ -130,9 +130,7 @@ public function init()
throw new InvalidConfigException("The 'attribute2' property must be set for a 'range' type markup and a defined 'form' property.");
}
$this->initLanguage();
if ($this->convertFormat && isset($this->pluginOptions['format'])) {
$this->pluginOptions['format'] = static::convertDateFormat($this->pluginOptions['format']);
}
$this->parseDateFormat('date');
$this->_id = ($this->type == self::TYPE_INPUT) ? 'jQuery("#' . $this->options['id'] . '")' : 'jQuery("#' . $this->options['id'] . '").parent()';
$this->registerAssets();
echo $this->renderInput();
Expand Down
2 changes: 1 addition & 1 deletion DatePickerAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
6 changes: 2 additions & 4 deletions DateTimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down Expand Up @@ -89,9 +89,7 @@ public function init()
throw new InvalidConfigException("Invalid value for the property 'type'. Must be an integer between 1 and 4.");
}
$this->initLanguage();
if ($this->convertFormat && isset($this->pluginOptions['format'])) {
$this->pluginOptions['format'] = static::convertDateFormat($this->pluginOptions['format']);
}
$this->parseDateFormat('datetime');
$this->_id = ($this->type == self::TYPE_INPUT) ? 'jQuery("#' . $this->options['id'] . '")' : 'jQuery("#' . $this->options['id'] . '").parent()';
$this->registerAssets();
echo $this->renderInput();
Expand Down
2 changes: 1 addition & 1 deletion DateTimePickerAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion DepDrop.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion DepDropAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
9 changes: 4 additions & 5 deletions FileInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand All @@ -26,8 +26,7 @@
* @see https://github.com/kartik-v/bootstrap-fileinput
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 2.0: C
*
* @since 2.0
* @see http://twitter.github.com/typeahead.js/examples
*/
class FileInput extends InputWidget
Expand Down Expand Up @@ -72,7 +71,7 @@ public function init()
$validation = ArrayHelper::getValue($this->pluginOptions, 'showPreview', true) ? 'file preview and multiple file upload' : 'multiple file upload';
$message = '<strong>' . Yii::t('fileinput', 'Note:') . '</strong> ' . Yii::t('fileinput', 'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.', ['validation' => $validation]);
$content = Html::tag('div', $message, $this->messageOptions) . "<script>{$id}.removeClass('file-loading');</script>";
$input .= "\n<br>" . $this->validateIE($content);
$input .= "\n" . $this->validateIE($content);
}
echo $input;
}
Expand All @@ -86,7 +85,7 @@ public function init()
*/
protected function validateIE($content, $validation = 'lt IE 10')
{
return "<!--[if {$validation}]>{$content}<![endif]-->";
return "<!--[if {$validation}]><br>{$content}<![endif]-->";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion FileInputAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Growl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @version 2.8.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion GrowlAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Html5Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Html5InputAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
36 changes: 33 additions & 3 deletions InputWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @version 2.9.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function init()
$this->_loadIndicator = self::LOAD_PROGRESS;
}
if ($this->hasModel()) {
$this->name = ArrayHelper::remove($this->options, 'name', Html::getInputName($this->model, $this->attribute));
$this->name = empty($this->options['name']) ? Html::getInputName($this->model, $this->attribute) : $this->options['name'];
$this->value = $this->model[Html::getAttributeName($this->attribute)];
}
$view = $this->getView();
Expand Down Expand Up @@ -273,4 +273,34 @@ protected static function convertDateFormat($format)
'Y' => 'yyyy',
]);
}
}

/**
* Parses date format based on attribute type using yii\helpers\FormatConverter
* Used only within DatePicker and DateTimePicker.
*
* @param string $type the attribute type whether date, datetime, or time
* @return mixed|string
* @throws InvalidConfigException
*/
protected function parseDateFormat($type)
{
if (!$this->convertFormat) {
return;
}
if (isset($this->pluginOptions['format'])) {
$format = static::convertDateFormat($this->pluginOptions['format']);
$this->pluginOptions['format'] = $format;
return;
}
$attrib = $type . 'Format';
$format = isset(Yii::$app->formatter->$attrib) ? Yii::$app->formatter->$attrib : '';
if (isset($this->dateFormat) && strncmp($this->dateFormat, 'php:', 4) === 0) {
$this->pluginOptions['format'] = static::convertDateFormat(substr($format, 4));
} elseif ($format != '') {
$format = FormatConverter::convertDateIcuToPhp($format, $type);
$this->pluginOptions['format'] = static::convertDateFormat($format);
} else {
throw InvalidConfigException("Error parsing '{$type}' format.");
}
}
}
2 changes: 1 addition & 1 deletion RangeInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 3.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Select2Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 3.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion SideNavAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion Spinner.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
2 changes: 1 addition & 1 deletion SpinnerAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2013
* @package yii2-widgets
* @version 1.0.0
* @version 3.1.0
*/

namespace kartik\widgets;
Expand Down
Loading