diff --git a/l10n_client.css b/l10n_client.css index a3c6061..ed7b2e7 100644 --- a/l10n_client.css +++ b/l10n_client.css @@ -153,9 +153,16 @@ how it wants to round. */ #l10n-client-string-editor .source .source-text { line-height:1.5em; background:#eee; - height:16em; margin:1em; padding:1em; + height:15em; margin:1em; padding:1em; + margin-bottom:0.5em; overflow:auto;} - + #l10n-client-string-editor .context { + line-height:1em; + height:1em; + font-size:0.8em; + margin:0.5em 1em 1em 1em; + padding: 0 1em 0 1em; + } #l10n-client-string-editor .translation { overflow:hidden; width:49%; float:right;} diff --git a/l10n_client.js b/l10n_client.js index df08e05..def53e7 100644 --- a/l10n_client.js +++ b/l10n_client.js @@ -114,6 +114,8 @@ Drupal.behaviors.l10nClient.attach = function (context) { $('#l10n-client-string-editor .source-text').text(Drupal.l10nClient.getString(index, 'source')); $('#l10n-client-form .translation-target').val(Drupal.l10nClient.getString(index, 'target')); $('#l10n-client-form .source-textgroup').val(Drupal.l10nClient.getString(index, 'textgroup')); + $('#l10n-client-form .source-context').val(Drupal.l10nClient.getString(index, 'context')); + $('#l10n-client-string-editor .context').text(Drupal.l10nClient.getString(index, 'context')); Drupal.l10nClient.selected = index; $('#l10n-client-form .form-submit').removeAttr("disabled"); @@ -168,6 +170,7 @@ Drupal.behaviors.l10nClient.attach = function (context) { source: $('#l10n-client-string-editor .source-text').text(), target: $('#l10n-client-form .translation-target').val(), textgroup: $('#l10n-client-form .source-textgroup').val(), + context: $('#l10n-client-string-editor .context').text(), 'form_token': $('#l10n-client-form input[name=form_token]').val() }, success: function (data) { diff --git a/l10n_client.module b/l10n_client.module index 75cf162..71811e2 100644 --- a/l10n_client.module +++ b/l10n_client.module @@ -203,8 +203,10 @@ function l10n_client_page_alter(&$page) { // If we have strings for the page language, restructure the data. $l10n_strings = array(); foreach ($page_strings as $textgroup => $group_strings) { - foreach ($group_strings as $string => $translation) { - $l10n_strings[] = array($string, $translation, $textgroup); + foreach ($group_strings as $context => $context_strings) { + foreach ($context_strings as $string => $translation) { + $l10n_strings[] = array($string, $translation, $textgroup, $context); + } } } array_multisort($l10n_strings); @@ -240,6 +242,7 @@ function l10n_client_page_alter(&$page) {