summaryrefslogtreecommitdiff
path: root/modules/gallery/js/l10n_client.js
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-07-16 17:31:20 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-07-16 17:31:20 +0200
commit7f5030ac208c30a7dc576a57cd9e665022ccbde5 (patch)
tree6b23e78aa8cc2dd363def46e083217e3c9b52f1b /modules/gallery/js/l10n_client.js
parent923732ca4dca6db218f6252a7133cd72f98fa086 (diff)
parent85b0f580291e375a2c5ec21b8210e59023ee24c2 (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/js/l10n_client.js')
-rw-r--r--modules/gallery/js/l10n_client.js32
1 files changed, 29 insertions, 3 deletions
diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js
index 4936d1cc..f5be5058 100644
--- a/modules/gallery/js/l10n_client.js
+++ b/modules/gallery/js/l10n_client.js
@@ -58,7 +58,7 @@ jQuery.extend(Gallery, {
case 1:
$('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').show();
$('#l10n-client').height('22em').removeClass('hidden');
- $('#l10n-client .labels .toggle').text('X');
+ $('#l10n-client-toggler').text(MSG_CLOSE_X);
/*
* This CSS clashes with Gallery's CSS, probably due to
* YUI's grid / floats.
@@ -72,7 +72,7 @@ jQuery.extend(Gallery, {
$('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').hide();
$('#l10n-client').height('2em').addClass('hidden');
// TODO: Localize this message
- $('#l10n-client .labels .toggle').text('Translate Text');
+ $('#l10n-client-toggler').text(MSG_TRANSLATE_TEXT);
/*
if(!$.browser.msie) {
$('body').css('border-bottom', '0px');
@@ -140,6 +140,32 @@ jQuery.extend(Gallery, {
}
}
}
+
+ this.copySourceText = function() {
+ var index = Gallery.l10nClient.selected;
+ if (index >= 0) {
+ var source = Gallery.l10nClient.getString(index, 'source');
+ var is_plural = Gallery.l10nClient.isPluralMessage(source);
+ if (is_plural) {
+ if (typeof(translation) != 'object') {
+ translation = {};
+ }
+ var num_plural_forms = plural_forms.length;
+ for (var i = 0; i < num_plural_forms; i++) {
+ var form = plural_forms[i];
+ var text = source['other'];
+ if (form == 'one') {
+ text = source['one'];
+ }
+ $('#l10n-edit-plural-translation-' + form)
+ .attr('value', text);
+ }
+ } else {
+ $('#l10n-edit-translation').attr('value', source);
+ }
+
+ }
+ }
})
});
@@ -171,7 +197,7 @@ Gallery.behaviors.l10nClient = function(context) {
});
// When l10n_client window is clicked, toggle based on current state.
- $('#l10n-client .labels .toggle').click(function() {
+ $('#l10n-client-toggler').click(function() {
if($('#l10n-client').is('.hidden')) {
Gallery.l10nClient.toggle(1);
} else {