mirror of https://github.com/zlatinb/muwire
externalize strings in variuos JOptionPanes
parent
abdc33b736
commit
b3ab1557dc
|
@ -1,5 +1,5 @@
|
||||||
package com.muwire.gui
|
package com.muwire.gui
|
||||||
|
import static com.muwire.gui.Translator.trans
|
||||||
import griffon.core.GriffonApplication
|
import griffon.core.GriffonApplication
|
||||||
import griffon.core.artifact.GriffonController
|
import griffon.core.artifact.GriffonController
|
||||||
import griffon.core.controller.ControllerAction
|
import griffon.core.controller.ControllerAction
|
||||||
|
@ -175,7 +175,7 @@ class MainFrameController {
|
||||||
int selected = builder.getVariable("searches-table").getSelectedRow()
|
int selected = builder.getVariable("searches-table").getSelectedRow()
|
||||||
if (selected < 0)
|
if (selected < 0)
|
||||||
return
|
return
|
||||||
String reason = JOptionPane.showInputDialog("Enter reason (optional)")
|
String reason = JOptionPane.showInputDialog(trans("ENTER_REASON_OPTIONAL"))
|
||||||
Persona p = model.searches[selected].originator
|
Persona p = model.searches[selected].originator
|
||||||
core.eventBus.publish( new TrustEvent(persona : p, level : TrustLevel.TRUSTED, reason : reason) )
|
core.eventBus.publish( new TrustEvent(persona : p, level : TrustLevel.TRUSTED, reason : reason) )
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ class MainFrameController {
|
||||||
int selected = builder.getVariable("searches-table").getSelectedRow()
|
int selected = builder.getVariable("searches-table").getSelectedRow()
|
||||||
if (selected < 0)
|
if (selected < 0)
|
||||||
return
|
return
|
||||||
String reason = JOptionPane.showInputDialog("Enter reason (optional)")
|
String reason = JOptionPane.showInputDialog(trans("ENTER_REASON_OPTIONAL"))
|
||||||
Persona p = model.searches[selected].originator
|
Persona p = model.searches[selected].originator
|
||||||
core.eventBus.publish( new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED, reason : reason) )
|
core.eventBus.publish( new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED, reason : reason) )
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ class MainFrameController {
|
||||||
return
|
return
|
||||||
String reason = null
|
String reason = null
|
||||||
if (level != TrustLevel.NEUTRAL)
|
if (level != TrustLevel.NEUTRAL)
|
||||||
reason = JOptionPane.showInputDialog("Enter reason (optional)")
|
reason = JOptionPane.showInputDialog(trans("ENTER_REASON_OPTIONAL"))
|
||||||
builder.getVariable(tableName).model.fireTableDataChanged()
|
builder.getVariable(tableName).model.fireTableDataChanged()
|
||||||
core.eventBus.publish(new TrustEvent(persona : list[row].persona, level : level, reason : reason))
|
core.eventBus.publish(new TrustEvent(persona : list[row].persona, level : level, reason : reason))
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,7 @@ class MainFrameController {
|
||||||
view.selectedSharedFiles().each {
|
view.selectedSharedFiles().each {
|
||||||
core.eventBus.publish(new UICreateCertificateEvent(sharedFile : it))
|
core.eventBus.publish(new UICreateCertificateEvent(sharedFile : it))
|
||||||
}
|
}
|
||||||
JOptionPane.showMessageDialog(null, "Certificate(s) have been issued")
|
JOptionPane.showMessageDialog(null, trans("CERTIFICATES_ISSUED"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ class MainFrameController {
|
||||||
void showFileDetails() {
|
void showFileDetails() {
|
||||||
def selected = view.selectedSharedFiles()
|
def selected = view.selectedSharedFiles()
|
||||||
if (selected == null || selected.size() != 1) {
|
if (selected == null || selected.size() != 1) {
|
||||||
JOptionPane.showMessageDialog(null, "Please select only one file to view it's details")
|
JOptionPane.showMessageDialog(null, trans("PLEASE_SELECT_ONE_FILE_DETAILS"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
def params = [:]
|
def params = [:]
|
||||||
|
@ -483,7 +483,7 @@ class MainFrameController {
|
||||||
void openContainingFolder() {
|
void openContainingFolder() {
|
||||||
def selected = view.selectedSharedFiles()
|
def selected = view.selectedSharedFiles()
|
||||||
if (selected == null || selected.size() != 1) {
|
if (selected == null || selected.size() != 1) {
|
||||||
JOptionPane.showMessageDialog(null, "Please select only one file to open it's containing folder")
|
JOptionPane.showMessageDialog(null, trans("PLEASE_SELECT_ONE_FILE_FOLDER"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,14 +514,14 @@ class MainFrameController {
|
||||||
|
|
||||||
@ControllerAction
|
@ControllerAction
|
||||||
void connectChatServer() {
|
void connectChatServer() {
|
||||||
String address = JOptionPane.showInputDialog("Copy/paste the address of the server here")
|
String address = JOptionPane.showInputDialog(trans("COPY_PASTE_SERVER_ADDRESS"))
|
||||||
if (address == null)
|
if (address == null)
|
||||||
return
|
return
|
||||||
Persona p
|
Persona p
|
||||||
try {
|
try {
|
||||||
p = new Persona(new ByteArrayInputStream(Base64.decode(address)))
|
p = new Persona(new ByteArrayInputStream(Base64.decode(address)))
|
||||||
} catch (Exception bad) {
|
} catch (Exception bad) {
|
||||||
JOptionPane.showMessageDialog(null, "Invalid server address", "Invalid server address", JOptionPane.ERROR_MESSAGE)
|
JOptionPane.showMessageDialog(null, trans("INVALID_SERVER_ADDRESS"), trans("INVALID_SERVER_ADDRESS"), JOptionPane.ERROR_MESSAGE)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,13 @@ BROWSE_HOST=Browse Host
|
||||||
# Share files prompt
|
# Share files prompt
|
||||||
SELECT_FILES_OR_DIRECTORIES_TO_SHARE=Select files or directories to share
|
SELECT_FILES_OR_DIRECTORIES_TO_SHARE=Select files or directories to share
|
||||||
|
|
||||||
|
# various JOption prompts
|
||||||
|
ENTER_REASON_OPTIONAL=Enter reason (optional)
|
||||||
|
CERTIFICATES_ISSUED=Certificate(s) have been issued
|
||||||
|
PLEASE_SELECT_ONE_FILE_DETAILS=Please select only one file to view it's details
|
||||||
|
PLEASE_SELECT_ONE_FILE_FOLDER=Please select only one file to open it's containing folder
|
||||||
|
COPY_PASTE_SERVER_ADDRESS=Copy/paste the address of the server here
|
||||||
|
INVALID_SERVER_ADDRESS=Invalid server address
|
||||||
## Search tab
|
## Search tab
|
||||||
|
|
||||||
GROUP_BY=Group by
|
GROUP_BY=Group by
|
||||||
|
|
Loading…
Reference in New Issue