Skip to content

Commit

Permalink
Merge pull request #49 from EmmanuelVella/locale
Browse files Browse the repository at this point in the history
Use request locale as default
  • Loading branch information
helios-ag committed Oct 23, 2013
2 parents 96a8b42 + bd2d992 commit 3854589
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Controller/ElfinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function showAction()
{
$parameters = $this->container->getParameter('fm_elfinder');
$editor = $parameters['editor'];
$locale = $parameters['locale'];
$locale = $parameters['locale'] ?: $this->getRequest()->getLocale();
$fullscreen = $parameters['fullscreen'];
$includeAssets = $parameters['include_assets'];
$compression = $parameters['compression'];
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getConfigTreeBuilder()

$rootNode
->children()
->scalarNode('locale')->defaultValue('en_US.UTF8')->end()
->scalarNode('locale')->defaultNull()->end()
->booleanNode('showhidden')->defaultValue(false)->end()
->scalarNode('editor')->defaultValue('simple')->end()
->booleanNode('compression')->defaultValue(false)->end()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ app/console assetic:dump --env=prod

```
fm_elfinder:
locale: %locale%
locale: %locale% # defaults to current request locale
editor: ckeditor # other choices are tinymce or simple
showhidden: false # defaults to false
fullscreen: true # defaults true, applies to simple and ckeditor editors
Expand All @@ -150,7 +150,7 @@ fm_elfinder:
* path - define root directory for the files inside web/ directory, default is "uploads". Make sure to set proper write/read permissions to this directory.
* url - url to be prefixed to image path, for displaying. Can be either absolute or relative. If relative, it will be prefixed with the applications base-url. If left blank, url will be the base-url, appened with the value of the 'path' parameter
* driver - can be LocalFileSystem, FTP or MySQL2, currently supported only LocalFileSystem, default is LocalFileSystem
* locale - locale determines, which language, ElFinder will use, to translate user interface, default is en_US.UTF8
* locale - locale determines, which language, ElFinder will use, to translate user interface, default is current request locale
* editor - determines what template to render, to be compatible with WYSIWYG web editor, currently supported options are:
"ckeditor", "tinymce" and "simple". How to configure CKEDitor and TinyMCE to work with this bundle, will be explained further in this document.
"simple" can be used as standalone filebrowser for managing and uploading files.
Expand Down
4 changes: 2 additions & 2 deletions Tests/DependencyInjection/FMElfinderExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testDefault()

$parameters = $container->getParameter('fm_elfinder');

$this->assertEquals('en_US.UTF8', $parameters['locale']);
$this->assertNull($parameters['locale']);
$this->assertEquals('simple', $parameters['editor']);

$this->assertArrayHasKey('connector', $parameters);
Expand All @@ -31,4 +31,4 @@ public function testDefault()
$this->assertArrayHasKey('roots', $parameters['connector']);
$this->assertCount(0, $parameters['connector']['roots']);
}
}
}

0 comments on commit 3854589

Please sign in to comment.