diff --git a/code/model/Translatable.php b/code/model/Translatable.php
index 02154c7..6e3e052 100755
--- a/code/model/Translatable.php
+++ b/code/model/Translatable.php
@@ -241,6 +241,9 @@ class Translatable extends DataExtension implements PermissionProvider {
if((isset($_GET['locale']) && !$langsAvailable) || (isset($_GET['locale']) && in_array($_GET['locale'], $langsAvailable))) {
// get from GET parameter
self::set_current_locale($_GET['locale']);
+ } else if((isset($_POST['Locale']) && !$langsAvailable) || (isset($_POST['Locale']) && in_array($_POST['Locale'], $langsAvailable))) {
+ // get from POST parameter
+ self::set_current_locale($_POST['Locale']);
} else {
self::set_current_locale(self::default_locale());
}
@@ -933,7 +936,13 @@ class Translatable extends DataExtension implements PermissionProvider {
$existingTransHTML = '
';
foreach($alreadyTranslatedLocales as $langCode) {
$existingTranslation = $this->owner->getTranslation($langCode);
- if($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
+ if ($existingTranslation && $this->owner->ClassName == "SiteConfig") {
+ $existingTransHTML .= sprintf('- %s
',
+ sprintf('%s/?locale=%s', Director::baseURL()."admin/settings", $langCode),
+ i18n::get_locale_name($langCode)
+ );
+ }
+ else if($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
$existingTransHTML .= sprintf('- %s
',
sprintf('%s/?locale=%s', $existingTranslation->CMSEditLink(), $langCode),
i18n::get_locale_name($langCode)
diff --git a/javascript/CMSMain.Translatable.js b/javascript/CMSMain.Translatable.js
index e73bf8a..e5fded5 100755
--- a/javascript/CMSMain.Translatable.js
+++ b/javascript/CMSMain.Translatable.js
@@ -60,5 +60,16 @@
return false;
}
});
+
+ /* for adding siteconfig translations */
+ $('.CMSSettingsController :input[name=action_createtranslation]').entwine({
+ onclick: function(e) {
+ var newurl = document.location.href.split("?");
+ newurl = newurl[0];
+ document.location = newurl+"?locale="+$('select.languagedropdown').val()
+ e.preventDefault();
+ return false;
+ }
+ });
});
}(jQuery));
\ No newline at end of file