Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add tooltips for TM copy shortcut keys

  • Loading branch information...
commit bbdbd61bce0d4093c97510122f132d3dd5350ebc 1 parent db7678f
@davidmason davidmason authored
View
3  server/zanata-war/src/main/java/org/zanata/webtrans/client/resources/UiMessages.java
@@ -45,4 +45,7 @@
@DefaultMessage("Glossary")
String glossaryHeader();
+
+ @DefaultMessage("Copy \"{0}\" to the editor")
+ String copyLinkTooltip(String targetMessage);
}
View
11 server/zanata-war/src/main/java/org/zanata/webtrans/client/view/TransMemoryView.java
@@ -22,7 +22,6 @@
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
@@ -81,6 +80,8 @@
private List<TranslationMemoryGlossaryItem> cachedMem = new ArrayList<TranslationMemoryGlossaryItem>();
+ private UiMessages messages;
+
@Inject
public TransMemoryView(final UiMessages messages, Resources resources)
{
@@ -89,6 +90,7 @@ public TransMemoryView(final UiMessages messages, Resources resources)
phraseButton.setText(messages.phraseButtonLabel());
clearButton.setText(messages.clearButtonLabel());
searchButton.setText(messages.searchButtonLabel());
+ this.messages = messages;
}
@UiHandler("tmTextBox")
@@ -203,7 +205,12 @@ public void onClick(ClickEvent event)
}
});
resultTable.setWidget(row, ACTION_COL, copyLink);
- copyLink.setTitle("Copy \"" + targetMessage + "\" to the editor.");
+ String shortcutKeys = "";
+ if (row <= 4)
+ {
+ shortcutKeys = " (Ctrl + Shift + " + row + ")";
+ }
+ copyLink.setTitle(messages.copyLinkTooltip(targetMessage) + shortcutKeys);
}
resultTable.setCellPadding(CELL_PADDING);
}
Please sign in to comment.
Something went wrong with that request. Please try again.