mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Setting correct user locale in ImageField and FileIframeField - the controller is separate from the CMS context, so wasn't initialized with i18n (see #1727)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65539 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
dc5dc6c1a2
commit
5c9f0f120b
@ -458,6 +458,21 @@ class Image_Uploader extends Controller {
|
||||
'$Action/$Class/$ID/$Field' => 'handleAction',
|
||||
);
|
||||
|
||||
function init() {
|
||||
// set language
|
||||
$member = Member::currentUser();
|
||||
if(!empty($member->Locale)) {
|
||||
i18n::set_locale($member->Locale);
|
||||
}
|
||||
|
||||
// set reading lang
|
||||
if(Translatable::is_enabled() && !Director::is_ajax()) {
|
||||
Translatable::choose_site_lang(array_keys(i18n::get_existing_content_languages('SiteTree')));
|
||||
}
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures the css is loaded for the iframe.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user