Permalink
Browse files

Plugin editor integration with django-hvad. Gets language from hvad c…

…urrent admin language tab
  • Loading branch information...
1 parent 4605250 commit 1c9b7f1eebe582714406921caddfafa2e0f049b2 @bercab committed Aug 20, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 cms/static/cms/js/plugin_editor.js
@@ -18,6 +18,12 @@
if (!language) {
language = $('input[name=language]').attr("value");
}
+
+ // Tries to get language from django-hvad current language tab
+ if (!language) {
+ language = $('span.current').attr("title");
+ }
+
// The new placeholder branch allows adding non-language plugins!
if (!language) {
//alert("Unable to determine the correct language for this plugin! Please report the bug!");
@@ -57,6 +63,11 @@
to_language = $('input[name=language]').attr("value");
}
+ // Tries to get language from django-hvad current language tab
+ if (!to_language) {
+ to_language = $('span.current').attr("title");
+ }
+
if (!to_language) {
//alert("Unable to determine the correct language for this plugin! Please report the bug!");
}

0 comments on commit 1c9b7f1

Please sign in to comment.