Use resource bundle string for context menu
This commit is contained in:
parent
ac182c10c0
commit
cfaff6c6b9
@ -1,18 +1,21 @@
|
|||||||
package com.marvinelsen.willow.ui.util
|
package com.marvinelsen.willow.ui.util
|
||||||
|
|
||||||
|
import com.marvinelsen.willow.WillowApplication
|
||||||
import com.marvinelsen.willow.ui.DictionaryEntryFx
|
import com.marvinelsen.willow.ui.DictionaryEntryFx
|
||||||
import javafx.event.EventHandler
|
import javafx.event.EventHandler
|
||||||
import javafx.scene.control.ContextMenu
|
import javafx.scene.control.ContextMenu
|
||||||
import javafx.scene.control.MenuItem
|
import javafx.scene.control.MenuItem
|
||||||
|
|
||||||
fun createContextMenuForEntry(entry: DictionaryEntryFx) = ContextMenu().apply {
|
fun createContextMenuForEntry(entry: DictionaryEntryFx) = ContextMenu().apply {
|
||||||
val menuItemCopyHeadword = MenuItem("Copy Headword").apply {
|
val menuItemCopyHeadword =
|
||||||
onAction = EventHandler { ClipboardHelper.copyHeadword(entry) }
|
MenuItem(WillowApplication.resourceBundle.getString("menubar.edit.copy.headword")).apply {
|
||||||
}
|
onAction = EventHandler { ClipboardHelper.copyHeadword(entry) }
|
||||||
|
}
|
||||||
|
|
||||||
val menuItemCopyPronunciation = MenuItem("Copy Pronunciation").apply {
|
val menuItemCopyPronunciation =
|
||||||
onAction = EventHandler { ClipboardHelper.copyPronunciation(entry) }
|
MenuItem(WillowApplication.resourceBundle.getString("menubar.edit.copy.pronunciation")).apply {
|
||||||
}
|
onAction = EventHandler { ClipboardHelper.copyPronunciation(entry) }
|
||||||
|
}
|
||||||
|
|
||||||
items.addAll(menuItemCopyHeadword, menuItemCopyPronunciation)
|
items.addAll(menuItemCopyHeadword, menuItemCopyPronunciation)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user