Skip to content

Commit

Permalink
Extract strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Jun 16, 2023
1 parent 724e889 commit da9839f
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,8 @@ private JMenuBar createMenuBar() {
});
helpMenuItem.add(updateMenuItem);

final JMenuItem openLogFolderMenuItem = new JMenuItem("Open the logging folder");
final JMenuItem openLogFolderMenuItem =
new JMenuItem(Messages.getString("open.logging.folder"));
openLogFolderMenuItem.addActionListener(
e ->
GuiUtils.openSystemExplorer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ update=Update
check.for.updates=Check for Updates...
current.release.latest=The current release is already the latest release available.
submit.bug.report=Submit a Bug Report
open.logging.folder=Open the logging folder

Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public static void openSystemExplorer(Component parent, File file) {
} else if (SystemInfo.isWindows) {
openCommand("explorer", file); // NON-NLS
} else if (SystemInfo.isMacOS) {
openCommand("/usr/bin/open", file);
openCommand("/usr/bin/open", file); // NON-NLS
} else {
JOptionPane.showMessageDialog(
parent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,32 @@
import org.weasis.core.Messages;

public enum LayerItem {
ANNOTATIONS("annotations", Messages.getString("AnnotationsLayer.anno"), true),
ANNOTATIONS("annotations", Messages.getString("AnnotationsLayer.anno"), true), // NON-NLS

MIN_ANNOTATIONS("minAnnotations", Messages.getString("LayerAnnotation.min_anot"), false),
MIN_ANNOTATIONS(
"minAnnotations", Messages.getString("LayerAnnotation.min_anot"), false), // NON-NLS

ANONYM_ANNOTATIONS("anonym", Messages.getString("AnnotationsLayer.anonym"), false),
ANONYM_ANNOTATIONS("anonym", Messages.getString("AnnotationsLayer.anonym"), false), // NON-NLS

SCALE("scale", Messages.getString("AnnotationsLayer.scale"), true),
SCALE("scale", Messages.getString("AnnotationsLayer.scale"), true), // NON-NLS

LUT("lut", Messages.getString("AnnotationsLayer.lut"), false),
LUT("lut", Messages.getString("AnnotationsLayer.lut"), false), // NON-NLS

IMAGE_ORIENTATION("orientation", Messages.getString("AnnotationsLayer.or"), true),
IMAGE_ORIENTATION("orientation", Messages.getString("AnnotationsLayer.or"), true), // NON-NLS

WINDOW_LEVEL("wl", Messages.getString("AnnotationsLayer.wl"), true),
WINDOW_LEVEL("wl", Messages.getString("AnnotationsLayer.wl"), true), // NON-NLS

ZOOM("zoom", Messages.getString("AnnotationsLayer.zoom"), true),
ZOOM("zoom", Messages.getString("AnnotationsLayer.zoom"), true), // NON-NLS

ROTATION("rotation", Messages.getString("AnnotationsLayer.rot"), false),
ROTATION("rotation", Messages.getString("AnnotationsLayer.rot"), false), // NON-NLS

FRAME("frame", Messages.getString("AnnotationsLayer.fr"), true),
FRAME("frame", Messages.getString("AnnotationsLayer.fr"), true), // NON-NLS

PIXEL("pixel", Messages.getString("AnnotationsLayer.pix"), true),
PRELOADING_BAR("loading", Messages.getString("AnnotationsLayer.preload_bar"), false),
PIXEL("pixel", Messages.getString("AnnotationsLayer.pix"), true), // NON-NLS

KEY_OBJECT("ko", Messages.getString("AnnotationsLayer.ko"), true);
PRELOADING_BAR("loading", Messages.getString("AnnotationsLayer.preload_bar"), false), // NON-NLS

KEY_OBJECT("ko", Messages.getString("AnnotationsLayer.ko"), true); // NON-NLS

private final String key;
private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ public boolean applySplittingRules(Series original, MediaElement media) {
if (specialElementList == null) {
specialElementList = new CopyOnWriteArrayList<>();
initialSeries.setTag(TagW.DicomSpecialElementList, specialElementList);
if ("rt/dicom".equals(rMime)) {
if ("rt/dicom".equals(rMime)) { // NON-NLS
MediaSeriesGroup st = getParent(initialSeries, DicomModel.study);
if (st != null
&& !LangUtil.getNULLtoFalse((Boolean) st.getTagValue(TagW.StudyDicomRT))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

public class DicomSorter {
public enum SortingTime {
CHRONOLOGICAL(0, "Chronological order"),
INVERSE_CHRONOLOGICAL(1, "Reverse chronological order");
CHRONOLOGICAL(0, Messages.getString("chrono.order")),
INVERSE_CHRONOLOGICAL(1, Messages.getString("reverse.chrono.order"));

private final int id;
private final String title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,6 @@ transcode.only.uncompressed=Transcode only uncompressed
transcoding=Transcoding
generate.new.unique.identifiers=Generate new unique identifiers
enter.password=Enter a password
study.date.sorting=Study date sorting
reverse.chrono.order=Reverse chronological order
chrono.order=Chronological order
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public DicomExplorerPrefView() {
model.setValue(thumbnailSize);
add(GuiUtils.getFlowLayoutPanel(ITEM_SEPARATOR_SMALL, ITEM_SEPARATOR, thumbSize, spinner));

JLabel labelStudyDate = new JLabel("Study date sorting" + StringUtil.COLON);
JLabel labelStudyDate = new JLabel(Messages.getString("study.date.sorting") + StringUtil.COLON);
studyDateSortingComboBox.setSelectedItem(DicomSorter.getStudyDateSorting());
add(
GuiUtils.getFlowLayoutPanel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,9 @@ private void dicomQuery() {
int limit = (Integer) limitSpinner.getValue();
String message =
state.getStatus() == Status.Cancel && limit > 0
? "Query has been canceled after %s studies.\nSet the limit to 0 to avoid this constraint."
.formatted(limit)
? Messages.getString("query.canceled.limit").formatted(limit)
: state.getMessage();
LOGGER.error("Dicom cfind error: {}", message);
LOGGER.error("Dicom C-FIND error: {}", message);
JOptionPane.showMessageDialog(
this, message, null, JOptionPane.ERROR_MESSAGE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void saveSearchParameters(XMLStreamWriter writer) throws XMLStreamExcepti
}

public static void loadSearchParameters(JComboBox<SearchParameters> comboBox) {
SearchParameters emptyParameters = new SearchParameters("Empty");
SearchParameters emptyParameters = new SearchParameters(Messages.getString("empty"));
comboBox.addItem(emptyParameters);

SearchParameters todayParameters = new SearchParameters(Period.TODAY.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ enter.a.name=Enter a name
search.template=Search Template
dicom.source=DICOM Source
search.criteria=Search Criteria
query.canceled.limit=Query has been canceled after %s studies.\nSet the limit to 0 to avoid this constraint.
empty=Empty
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ overlay.color=Overlay color
open.new.tab=Open in new tab
mpr.synchronisation=MPR synchronisation
default.layout=Default layout
auto.center=Auto center axes
never=Never
only.center.hidden=Only when the center is hidden
always=Always
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public MprPrefView() {

private void initGUI() {
EventManager eventManager = EventManager.getInstance();
JLabel lblMode = new JLabel("Auto center axes" + StringUtil.COLON);
JLabel lblMode = new JLabel(Messages.getString("auto.center") + StringUtil.COLON);

comboBox3DCursorMode.addItem("Never");
comboBox3DCursorMode.addItem("Only when the center is hidden");
comboBox3DCursorMode.addItem("Always");
comboBox3DCursorMode.addItem(Messages.getString("never"));
comboBox3DCursorMode.addItem(Messages.getString("only.center.hidden"));
comboBox3DCursorMode.addItem(Messages.getString("always"));

int mode = eventManager.getOptions().getIntProperty(View2d.P_CROSSHAIR_MODE, 1);
if (mode < 0 && mode >= comboBox3DCursorMode.getModel().getSize()) {
Expand Down

0 comments on commit da9839f

Please sign in to comment.