From: <al...@us...> - 2009-09-07 08:27:03
|
Revision: 2305 http://omegat.svn.sourceforge.net/omegat/?rev=2305&view=rev Author: alex73 Date: 2009-09-07 08:26:52 +0000 (Mon, 07 Sep 2009) Log Message: ----------- Add menu for replace translation from Google Translate Modified Paths: -------------- trunk/src/org/omegat/Bundle.properties trunk/src/org/omegat/core/Core.java trunk/src/org/omegat/gui/main/MainMenuShortcuts.mac.properties trunk/src/org/omegat/gui/main/MainMenuShortcuts.properties trunk/src/org/omegat/gui/main/MainWindowMenu.java trunk/src/org/omegat/gui/main/MainWindowMenuHandler.java Modified: trunk/src/org/omegat/Bundle.properties =================================================================== --- trunk/src/org/omegat/Bundle.properties 2009-09-07 07:02:24 UTC (rev 2304) +++ trunk/src/org/omegat/Bundle.properties 2009-09-07 08:26:52 UTC (rev 2305) @@ -158,6 +158,8 @@ TF_MENU_EDIT_RECYCLE=R&eplace with Match +TF_MENU_EDIT_OVERWRITE_MACHITE_TRANSLATION=Replace with &Machine Translation + TF_MENU_EDIT_SOURCE_INSERT=I&nsert Source TF_MENU_EDIT_SOURCE_OVERWRITE=Re&place with Source Modified: trunk/src/org/omegat/core/Core.java =================================================================== --- trunk/src/org/omegat/core/Core.java 2009-09-07 07:02:24 UTC (rev 2304) +++ trunk/src/org/omegat/core/Core.java 2009-09-07 08:26:52 UTC (rev 2305) @@ -116,6 +116,10 @@ public static ISpellChecker getSpellChecker() { return spellChecker; } + + public static GoogleTranslateTextArea getGoogleTranslatePane() { + return googleTranslatePane; + } public static IAutoSave getAutoSave() { return saveThread; Modified: trunk/src/org/omegat/gui/main/MainMenuShortcuts.mac.properties =================================================================== --- trunk/src/org/omegat/gui/main/MainMenuShortcuts.mac.properties 2009-09-07 07:02:24 UTC (rev 2304) +++ trunk/src/org/omegat/gui/main/MainMenuShortcuts.mac.properties 2009-09-07 08:26:52 UTC (rev 2305) @@ -10,6 +10,7 @@ editRedoMenuItem=meta Y editOverwriteTranslationMenuItem=meta R editInsertTranslationMenuItem=meta I +editOverwriteMachineTranslationMenuItem=meta M editOverwriteSourceMenuItem=meta shift R editInsertSourceMenuItem=meta shift I editExportSelectionMenuItem=meta shift C Modified: trunk/src/org/omegat/gui/main/MainMenuShortcuts.properties =================================================================== --- trunk/src/org/omegat/gui/main/MainMenuShortcuts.properties 2009-09-07 07:02:24 UTC (rev 2304) +++ trunk/src/org/omegat/gui/main/MainMenuShortcuts.properties 2009-09-07 08:26:52 UTC (rev 2305) @@ -10,6 +10,7 @@ editRedoMenuItem=ctrl Y editOverwriteTranslationMenuItem=ctrl R editInsertTranslationMenuItem=ctrl I +editOverwriteMachineTranslationMenuItem=ctrl M editOverwriteSourceMenuItem=ctrl shift R editInsertSourceMenuItem=ctrl shift I editExportSelectionMenuItem=ctrl shift C Modified: trunk/src/org/omegat/gui/main/MainWindowMenu.java =================================================================== --- trunk/src/org/omegat/gui/main/MainWindowMenu.java 2009-09-07 07:02:24 UTC (rev 2304) +++ trunk/src/org/omegat/gui/main/MainWindowMenu.java 2009-09-07 08:26:52 UTC (rev 2305) @@ -156,6 +156,8 @@ editMenu.add(editOverwriteTranslationMenuItem = createMenuItem("TF_MENU_EDIT_RECYCLE")); editMenu.add(editInsertTranslationMenuItem = createMenuItem("TF_MENU_EDIT_INSERT")); editMenu.add(new JSeparator()); + editMenu.add(editOverwriteMachineTranslationMenuItem = createMenuItem("TF_MENU_EDIT_OVERWRITE_MACHITE_TRANSLATION")); + editMenu.add(new JSeparator()); editMenu.add(editOverwriteSourceMenuItem = createMenuItem("TF_MENU_EDIT_SOURCE_OVERWRITE")); editMenu.add(editInsertSourceMenuItem = createMenuItem("TF_MENU_EDIT_SOURCE_INSERT")); editMenu.add(new JSeparator()); @@ -365,6 +367,7 @@ JMenu editMenu; JMenuItem editOverwriteSourceMenuItem; JMenuItem editOverwriteTranslationMenuItem; + JMenuItem editOverwriteMachineTranslationMenuItem; JMenuItem editRedoMenuItem; JMenuItem editSelectFuzzy1MenuItem; JMenuItem editSelectFuzzy2MenuItem; Modified: trunk/src/org/omegat/gui/main/MainWindowMenuHandler.java =================================================================== --- trunk/src/org/omegat/gui/main/MainWindowMenuHandler.java 2009-09-07 07:02:24 UTC (rev 2304) +++ trunk/src/org/omegat/gui/main/MainWindowMenuHandler.java 2009-09-07 08:26:52 UTC (rev 2305) @@ -217,6 +217,10 @@ mainWindow.doInsertTrans(); } + public void editOverwriteMachineTranslationMenuItemActionPerformed() { + Core.getEditor().replaceEditText(Core.getGoogleTranslatePane().getText()); + } + /** * replaces entire edited segment text with a the source text of a segment * at cursor position This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |