Skip to content

Commit

Permalink
Updates to v1.0.1 fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Mar 17, 2015
1 parent 309b0e5 commit e504178
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 91 deletions.
13 changes: 12 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
version 1.0.1
=============

**Date:** 17-Mar-2015

- (enh #4): Hungarian translations
- (enh #20): Croatian translations
- (enh #21): Updates to widget for v4.1.8 bootstrap-fileinput plugin
- All plugin related translations now reside in the [locales files in the plugin folder](http://github.com/kartik-v/bootstrap-fileinput/js). Pull requests for new translations or editing translations needs to be done in the plugin folder.
- The `language` property can be set at the widget level to set the language (this will default to `Yii::$app->language`).

version 1.0.0
=============

**Date:** 08-Nov-2014

- Initial release
- Sub repo split from [yii2-widgets](https://github.com/kartik-v/yii2-widgets)
- Sub repo split from [yii2-widgets](https://github.com/kartik-v/yii2-widgets)
37 changes: 20 additions & 17 deletions FileInput.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2015
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.0
* @version 1.0.1
*/

namespace kartik\file;
Expand All @@ -13,6 +13,7 @@
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\web\JsExpression;
use kartik\base\Config;

/**
* FileInput widget styled for Bootstrap 3.0 with ability to multiple file
Expand Down Expand Up @@ -88,31 +89,33 @@ protected function validateIE($content, $validation = 'lt IE 10')
{
return "<!--[if {$validation}]><br>{$content}<![endif]-->";
}

/**
* Set the default plugin option
*
* @param string $key the array key in [[pluginOptions]]
* @param string $value the value for the key in [[pluginOptions]]
* Registers the asset bundle and locale
*/
private function setPluginDefault($key, $value)
{
if (empty($this->pluginOptions[$key])) {
$this->pluginOptions[$key] = $value;
protected function registerAssetBundle() {
$view = $this->getView();
if (!empty($this->language) && substr($this->language, 0, 2) != 'en') {
$path = Yii::getAlias('@vendor/kartik-v/bootstrap-fileinput/js');
$file = "fileinput_locale_{$this->language}.js";
if (!Config::fileExists("{$path}/{$file}")) {
$file = "fileinput_locale_{$this->_lang}.js";
}
if (Config::fileExists("{$path}/{$file}")) {
FileInputAsset::register($view)->js[] = 'js/' . $file;
return;
}
}
FileInputAsset::register($view);
}

/**
* Registers the needed assets
*/
public function registerAssets()
{
$view = $this->getView();
FileInputAsset::register($view);

$this->setPluginDefault('browseLabel', Yii::t('fileinput', 'Browse') . '&hellip;');
$this->setPluginDefault('uploadLabel', Yii::t('fileinput', 'Upload'));
$this->setPluginDefault('removeLabel', Yii::t('fileinput', 'Remove'));
$this->registerAssetBundle();
$this->registerPlugin('fileinput');
}
}
4 changes: 2 additions & 2 deletions FileInputAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2015
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.0
* @version 1.0.1
*/

namespace kartik\file;
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Kartik Visweswaran
Copyright (c) 2014 - 2015, Kartik Visweswaran
Krajee.com
All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ to the ```require``` section of your `composer.json` file.

## Latest Release

> NOTE: The latest version of the module is v1.0.0 released on 08-Nov-2014. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details.
> NOTE: The latest version of the module is v1.0.1 released on 17-Mar-2015. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details.
## Demo

Expand Down
5 changes: 1 addition & 4 deletions messages/ar/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@
'Note:' => 'ملاحظة:',
'multiple file upload' => 'متعددة تحميل الملف',
'file preview and multiple file upload' => 'ملف المعاينة ومتعددة تحميل الملف',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'متصفحك لا يدعم {validation}. تجربة أي بديل أو أكثر متصفح الأخيرة للوصول إلى هذه الميزات.',
'Browse' => 'تصفح',
'Remove' => 'نزع',
'Upload' => 'تحميل',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'متصفحك لا يدعم {validation}. تجربة أي بديل أو أكثر متصفح الأخيرة للوصول إلى هذه الميزات.'
];
7 changes: 2 additions & 5 deletions messages/da/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'fil forhåndsvisning og multi fil upload',
'Note:' => 'Bemærk:',
'multiple file upload' => 'multi fil upload',
'file preview and multiple file upload' => 'fil forhåndsvisning og multi fil upload',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Din browser supporterer ikke {validation}. Prøv en alternativ eller nyere browser for at bruge disse funktioner.',
'Browse' => 'Gennemse',
'Remove' => 'Fjern',
'Upload' => 'Upload',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Din browser supporterer ikke {validation}. Prøv en alternativ eller nyere browser for at bruge disse funktioner.'
];
7 changes: 2 additions & 5 deletions messages/de/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'Datei-Vorschau und Hochladen mehrerer Dateien',
'Note:' => 'Hinweis:',
'multiple file upload' => 'Hochladen mehrerer Dateien',
'file preview and multiple file upload' => 'Datei-Vorschau und Hochladen mehrerer Dateien',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Ihr Browser unterstützt keine {validation}. Versuchen Sie, eine alternative oder neueren Browser, um diese Funktionen zugreifen.',
'Browse' => 'blättern',
'Remove' => 'entfernen',
'Upload' => 'laden',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Ihr Browser unterstützt keine {validation}. Versuchen Sie, eine alternative oder neueren Browser, um diese Funktionen zugreifen.'
];
7 changes: 2 additions & 5 deletions messages/en/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => '',
'Note:' => '',
'multiple file upload' => '',
'file preview and multiple file upload' => '',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => '',
'Browse' => '',
'Remove' => '',
'Upload' => '',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => ''
];
7 changes: 2 additions & 5 deletions messages/es/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'Vista previa de archivos y carga de varios archivos',
'Note:' => 'Nota:',
'multiple file upload' => 'carga de varios archivos',
'file preview and multiple file upload' => 'Vista previa de archivos y carga de varios archivos',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Su navegador no soporta la {validation}. Pruebe una alternativa o explorador más reciente para acceder a estas funciones.',
'Browse' => 'Navegar',
'Remove' => 'eliminar',
'Upload' => 'subir',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Su navegador no soporta la {validation}. Pruebe una alternativa o explorador más reciente para acceder a estas funciones.'
];
7 changes: 2 additions & 5 deletions messages/fr/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'Prévisualisation et dépôt de fichiers multiples',
'Note:' => 'Remarque :',
'multiple file upload' => 'Dépôt de fichiers multiples',
'file preview and multiple file upload' => 'Prévisualisation et dépôt de fichiers multiples',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Votre navigateur ne supporte pas les {validation}. Essayez un navigateur alternatif ou plus récent pour accéder à ces fonctions.',
'Browse' => 'Parcourir',
'Remove' => 'Supprimer',
'Upload' => 'Déposer',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Votre navigateur ne supporte pas les {validation}. Essayez un navigateur alternatif ou plus récent pour accéder à ces fonctions.'
];
7 changes: 2 additions & 5 deletions messages/hr/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'pregled datoteka i višestruko spremanje datoteka',
'Note:' => 'Bilješka:',
'multiple file upload' => 'višestruko spremanje datoteka',
'file preview and multiple file upload' => 'pregled datoteka i višestruko spremanje datoteka',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Vaš internet preglednik ne podupire {validation}. Pokušajte sa novijom verzijom internet preglednika.',
'Browse' => 'Odaberi',
'Remove' => 'Ukloni',
'Upload' => 'Snimi na server',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Vaš internet preglednik ne podupire {validation}. Pokušajte sa novijom verzijom internet preglednika.'
];
7 changes: 2 additions & 5 deletions messages/hu/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'fájl előnézet és multi fájlfeltöltés',
'Note:' => 'Jegyzet:',
'multiple file upload' => 'multi fájlfeltöltés',
'file preview and multiple file upload' => 'fájl előnézet és multi fájlfeltöltés',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'A böngészője sajnos nem támogatja {validation}. Kérem frissítse a jelenlegit vagy válasszon alternatív böngészőt.',
'Browse' => 'Tallózás',
'Remove' => 'Eltávolítás',
'Upload' => 'Törlés',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'A böngészője sajnos nem támogatja {validation}. Kérem frissítse a jelenlegit vagy válasszon alternatív böngészőt.'
];
7 changes: 2 additions & 5 deletions messages/it/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'anteprima file e caricamento file multipli',
'Note:' => 'Note',
'multiple file upload' => 'caricamento file multipli',
'file preview and multiple file upload' => 'anteprima file e caricamento file multipli',
'Browse' => 'Scegli',
'Upload' => 'Carica',
'Remove' => 'Rimuovi',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Il tuo browser non supporta {validation}. Provane uno alternativo o una versione aggiornata per accedere a questa caratteristica',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Il tuo browser non supporta {validation}. Provane uno alternativo o una versione aggiornata per accedere a questa caratteristica'
];
7 changes: 2 additions & 5 deletions messages/nl/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'bestand preview en uploaden meerdere bestanden',
'Note:' => 'Opmerking:',
'multiple file upload' => 'uploaden meerdere bestanden',
'file preview and multiple file upload' => 'bestand preview en uploaden meerdere bestanden',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Uw browser ondersteunt geen {validation}. Probeer een andere of nieuwere browser om deze functies te gebruiken.',
'Browse' => 'Bladeren',
'Remove' => 'Verwijderen',
'Upload' => 'Upload',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Uw browser ondersteunt geen {validation}. Probeer een andere of nieuwere browser om deze functies te gebruiken.'
];
7 changes: 2 additions & 5 deletions messages/pl/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'podglądu i przesyłania wielu plików jednocześnie',
'Note:' => 'Wskazówka:',
'multiple file upload' => 'przesyłania wielu plików jednocześnie',
'file preview and multiple file upload' => 'podglądu i przesyłania wielu plików jednocześnie',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Twoja przeglądarka nie wspiera {validation}. Wypróbuj innej lub nowszej przeglądarki, aby móc skorzystać z tych udogodnień.',
'Browse' => 'Wybierz',
'Remove' => 'Usuń',
'Upload' => 'Wyślij',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Twoja przeglądarka nie wspiera {validation}. Wypróbuj innej lub nowszej przeglądarki, aby móc skorzystać z tych udogodnień.'
];
7 changes: 2 additions & 5 deletions messages/pt/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'pré-visualização e upload de múltiplos arquivos',
'Note:' => 'Nota:',
'multiple file upload' => 'upload de múltiplos arquivos',
'file preview and multiple file upload' => 'pré-visualização e upload de múltiplos arquivos',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Seu navegador não suporta {validation}. Teste em outro navegador mais atualizado.',
'Browse' => 'Procurar',
'Remove' => 'Remover',
'Upload' => 'Upload',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Seu navegador não suporta {validation}. Teste em outro navegador mais atualizado.'
];
7 changes: 2 additions & 5 deletions messages/ru/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'предварительный просмотр и множественную загрузку файлов',
'Note:' => 'Примечание:',
'multiple file upload' => 'множественную загрузку файлов',
'file preview and multiple file upload' => 'предварительный просмотр и множественную загрузку файлов',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Ваш браузер не поддерживает {validation}. Попробуйте более новую версию или другой браузер, чтобы получить доступ к этим функциям.',
'Browse' => 'Выбрать',
'Remove' => 'Удалить',
'Upload' => 'Загрузить',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Ваш браузер не поддерживает {validation}. Попробуйте более новую версию или другой браузер, чтобы получить доступ к этим функциям.'
];
7 changes: 2 additions & 5 deletions messages/tr/fileinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'file preview and multiple file upload' => 'önizle ve dosyaları yükle',
'Note:' => 'Not:',
'multiple file upload' => 'dosyaları yükle',
'file preview and multiple file upload' => 'önizle ve dosyaları yükle',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Browserınız {validation} desteklemiyor. Bu özellikleri kullanabilmek için lütfen alternatif veya güncel bir browser ile bağlanın.',
'Browse' => 'Gözat',
'Remove' => 'Sil',
'Upload' => 'Yükle',
'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Browserınız {validation} desteklemiyor. Bu özellikleri kullanabilmek için lütfen alternatif veya güncel bir browser ile bağlanın.'
];

0 comments on commit e504178

Please sign in to comment.