Skip to content

Commit

Permalink
Added checkbox to hide warning that language is not translated. (#2261)
Browse files Browse the repository at this point in the history
  • Loading branch information
breiler committed Jul 19, 2023
1 parent 4c902d3 commit 9443115
Show file tree
Hide file tree
Showing 25 changed files with 86 additions and 252 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jetty.version>9.4.41.v20210516</jetty.version>
<jersey.version>2.29.1</jersey.version>
<gluegen.version>2.4.0</gluegen.version>
<jogl.version>2.4.0</jogl.version>
<gluegen.version>2.5.0-rc-20230523</gluegen.version>
<jogl.version>2.5.0-rc-20230523</jogl.version>
<miglayout.version>3.7.4</miglayout.version>
<guava.version>28.1-jre</guava.version>
<jssc.version>2.8.0</jssc.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static void displayErrorDialog(final String errorMessage, boolean modal)
// Localization.getString("error"), JOptionPane.ERROR_MESSAGE);
NarrowOptionPane.showNarrowDialog(250, errorMessage.replaceAll("\\.\\.", "\\."),
Localization.getString("error"),
JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
JOptionPane.ERROR_MESSAGE);
};

if (modal) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2016 Will Winder
Copyright 2016-2023 Will Winder
This file is part of Universal Gcode Sender (UGS).
Expand All @@ -18,31 +18,31 @@ This file is part of Universal Gcode Sender (UGS).
*/
package com.willwinder.universalgcodesender.utils;

import java.awt.Component;
import java.awt.HeadlessException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

/**
*
* @author wwinder
*/
public class NarrowOptionPane extends JOptionPane
{
public static String pattern =
public class NarrowOptionPane extends JOptionPane {
public static String pattern =
"<html><body><p style='width: %dpx;'>%s</p></body></html>";

public static void showNarrowDialog(int textWidthInPixels,
String message, String title, int optionType, int messageType)
String message, String title, int messageType)
throws HeadlessException {
JOptionPane.showMessageDialog(new JFrame(),
String.format(pattern, textWidthInPixels, message.replaceAll("\n", "<br>")),
String.format(pattern, textWidthInPixels, message.replaceAll("\n", "<br>")),
title, messageType);
}

public static int showNarrowConfirmDialog(int textWidthInPixels,
String message, String title, int optionType, int messageType)
String message, String title, int optionType, int messageType)
throws HeadlessException {
return JOptionPane.showConfirmDialog(
new JPanel(),
Expand All @@ -51,4 +51,17 @@ public static int showNarrowConfirmDialog(int textWidthInPixels,
optionType,
messageType);
}

public static int showNarrowDialog(int textWidthInPixels, String message, Object[] params, String title, int optionType, int messageType) {
List<Object> paramsList = new ArrayList<>();
paramsList.add(String.format(pattern, textWidthInPixels, message.replaceAll("\n", "<br>")));
paramsList.addAll(Arrays.asList(params));

return JOptionPane.showConfirmDialog(
new JPanel(),
paramsList.toArray(),
title,
optionType,
messageType);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2014-2021 Will Winder
Copyright 2014-2023 Will Winder
This file is part of Universal Gcode Sender (UGS).
Expand Down Expand Up @@ -114,6 +114,12 @@ public class Settings {
*/
private boolean invertMouseZoom = false;

/**
* Should show an information dialog if the current language isn't
* fully translated
*/
private boolean showTranslationsWarning = true;

/**
* The GSON deserialization doesn't do anything beyond initialize what's in the json document. Call finalizeInitialization() before using the Settings.
*/
Expand Down Expand Up @@ -539,6 +545,14 @@ public void setInvertMouseZoom(boolean invertMouseZoom) {
changed();
}

public boolean isShowTranslationsWarning() {
return showTranslationsWarning;
}

public void setShowTranslationsWarning(boolean showTranslationsWarning) {
this.showTranslationsWarning = showTranslationsWarning;
}

public static class AutoLevelSettings {
// Setting window
public double autoLevelProbeZeroHeight = 0;
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_ca_ES.properties
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ VisualizerCanvas.width = amplada
platform.menu.jog.size = Mida del pas
platform.menu.actions = Accions
platform.menu.machine = Màquina
incomplete.localization = Universal Gcode Sender no està totalment traduït per a aquest idioma.\nVisiteu http\://winder.github.io/ugs_website/contributing/\#translations per veure com podeu ajudar.
incomplete.localization = Universal Gcode Sender no està totalment traduït per a aquest idioma.\nVisiteu https://translate.universalgcodesender.com per veure com podeu ajudar.
mainWindow.swing.softReset = Reinici
mainWindow.swing.resetX = Restableix l'eix X
mainWindow.swing.resetY = Restableix l'eix Y
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_cs_CZ.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ platform.menu.actions = Akce
platform.menu.macros = Makra
platform.menu.machine = Stroj
platform.actions.homing.disabled.tooltip = V nastavení firmwaru musí být povolen homing
incomplete.localization = Universal Gcode Sender není pro tento jazyk plně lokalizován.\nNavštivte prosím http\://winder.github.io/ugs_website/contributing/\#translations a zjistěte, jak můžete pomoci.
incomplete.localization = Universal Gcode Sender není pro tento jazyk plně lokalizován.\nNavštivte prosím https://translate.universalgcodesender.com a zjistěte, jak můžete pomoci.
mainWindow.swing.softReset = měkký restart
mainWindow.swing.resetX = Resetování osy X
mainWindow.swing.resetY = Resetování osy Y
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ platform.menu.actions = Aktionen
platform.menu.macros = Makros
platform.menu.machine = Maschine
platform.actions.homing.disabled.tooltip = Homing muss in den Firmwareinstellungen aktiviert werden
incomplete.localization = Universal Gcode Sender ist für diese Sprache nicht vollständig übersetzt.\n<br>\nBitte besuchen Sie\n<br>\nhttp\://winder.github.io/ugs_website/contrib/translation/\n<br>\num beim Übersetzen zu helfen.
incomplete.localization = Universal Gcode Sender ist für diese Sprache nicht vollständig übersetzt.\n\nBitte besuchen Sie\n\nhttps://translate.universalgcodesender.com\n\num beim Übersetzen zu helfen.
mainWindow.swing.resetX = Reset X Achse
mainWindow.swing.resetY = Reset Y Achse
mainWindow.swing.resetZ = Reset Z Achse
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_el_GR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ platform.menu.actions = Ενέργειες
platform.menu.macros = Μακροεντολές
platform.menu.machine = Μηχανή
platform.actions.homing.disabled.tooltip = Το Homing πρέπει να είναι ενεργοποιημένο στις ρυθμίσεις υλικολογισμικού
incomplete.localization = Το Universal Gcode Sender δεν είναι πλήρως προσαρμοσμένο σε αυτήν τη γλώσσα.\nΕπισκεφθείτε τη διεύθυνση http\://winder.github.io/ugs_website/contribution/\#translations για να δείτε πώς μπορείτε να βοηθήσετε.
incomplete.localization = Το Universal Gcode Sender δεν είναι πλήρως προσαρμοσμένο σε αυτήν τη γλώσσα.\nΕπισκεφθείτε τη διεύθυνση https://translate.universalgcodesender.com για να δείτε πώς μπορείτε να βοηθήσετε.
mainWindow.swing.softReset = Απαλή επαναφορά
mainWindow.swing.resetX = Επαναφορά X άξονα
mainWindow.swing.resetY = Επαναφορά Y άξονα
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ platform.menu.actions = Actions
platform.menu.macros = Macros
platform.menu.machine = Machine
platform.actions.homing.disabled.tooltip = Homing needs to be enabled in the firmware settings
incomplete.localization = Universal Gcode Sender is not fully localized for this language. \nPlease visit http\://winder.github.io/ugs_website/contributing/#translations to see how you can help.
incomplete.localization = Universal Gcode Sender is not fully localized for this language. \nPlease visit https://translate.universalgcodesender.com to see how you can help.
mainWindow.swing.softReset = Soft Reset
mainWindow.swing.resetX = Reset X Axis
mainWindow.swing.resetY = Reset Y Axis
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_es_ES.properties
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ platform.menu.jog.size = Tamaño del paso
platform.menu.actions = Acciones
platform.menu.macros = Macros
platform.menu.machine = Máquina
incomplete.localization = Universal Gcode Sender no está totalmente localizado para este idioma.\nPor favor, visite\nhttp\://winder.github.io/ugs_website/contributing/\#translations, para ver cómo puede ayudar.
incomplete.localization = Universal Gcode Sender no está totalmente localizado para este idioma.\nPor favor, visite\nhttps://translate.universalgcodesender.com, para ver cómo puede ayudar.
mainWindow.swing.softReset = Reinicio de software
mainWindow.swing.resetX = Reinicio del eje X
mainWindow.swing.resetY = Reinicio del eje Y
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ VisualizerCanvas.width = largeur
platform.menu.jog = Joystick
platform.menu.jog.size = Taille du pas
platform.actions.homing.disabled.tooltip = Le référencement doit être activé avec les paramètres du firmware
incomplete.localization = Universal Gcode Sender n'est pas complétement traduit dans ce language. N'hésitez pas a consulter http\://winder.github.io/ugs_website/contrib/translation/ pour voir comment aider.
incomplete.localization = Universal Gcode Sender n'est pas complétement traduit dans ce language. N'hésitez pas a consulter https://translate.universalgcodesender.com pour voir comment aider.
mainWindow.swing.softReset = Réinitialiser le logiciel
mainWindow.swing.resetX = Réinitialiser l'axe X
mainWindow.swing.resetY = Réinitialiser l'axe Y
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_it_IT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ platform.menu.actions = Azioni
platform.menu.macros = Macro
platform.menu.machine = Macchina
platform.actions.homing.disabled.tooltip = L'homing deve essere abilitato nelle impostazioni del firmware
incomplete.localization = Universal Gcode Sender non è completamente tradotto in questa lingua.\nPer favore visita http\://winder.github.io/ugs_website/contrib/translation/ per vedere come puoi contribuire alla traduzione
incomplete.localization = Universal Gcode Sender non è completamente tradotto in questa lingua.\nPer favore visita https://translate.universalgcodesender.com per vedere come puoi contribuire alla traduzione
mainWindow.swing.softReset = Resetta software
mainWindow.swing.resetX = Resetta Asse X
mainWindow.swing.resetY = Resetta Asse Y
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_ja_JP.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ platform.menu.jog.size = ステップ間隔
platform.menu.actions = アクション
platform.menu.macros = マクロ
platform.menu.machine = マシン
incomplete.localization = Universal Gcode Sender is not fully localized for this language. \nPlease visit http\://winder.github.io/ugs_website/contrib/translation/ to see how you can help.
incomplete.localization = Universal Gcode Sender is not fully localized for this language. \nPlease visit https://translate.universalgcodesender.com to see how you can help.
mainWindow.swing.softReset = ソフトリセット
mainWindow.swing.resetX = リセット X軸
mainWindow.swing.resetY = リセット Y軸
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_lt_LT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ platform.menu.jog.size = Žingsnio dydis
platform.menu.actions = Veiksmai
platform.menu.macros = Makro komandos
platform.menu.machine = Staklės
incomplete.localization = Universal Gcode Sender is not fully localized for this language. \nPlease visit http\://winder.github.io/ugs_website/contrib/translation/ to see how you can help.
incomplete.localization = Universal Gcode Sender is not fully localized for this language. \nPlease visit https://translate.universalgcodesender.com to see how you can help.
mainWindow.swing.softReset = Perkrauti vald.
mainWindow.swing.resetX = Atstatyti X ašį
mainWindow.swing.resetY = Atstatyti Y ašį
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_nl_NL.properties
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ platform.menu.jog = jog
platform.menu.jog.size = Stapgrootte
platform.menu.actions = Akties
platform.actions.homing.disabled.tooltip = platform.actions.homing.disabled.tooltip
incomplete.localization = Universal Gcode Sender is niet volledig vertaald in deze taal.\nBezoek http\://winder.github.io/ugs_website/contrib/translation/ voor uw bijdrage
incomplete.localization = Universal Gcode Sender is niet volledig vertaald in deze taal.\nBezoek https://translate.universalgcodesender.com voor uw bijdrage
mainWindow.swing.softReset = Soft reset
mainWindow.swing.resetX = Reset X as
mainWindow.swing.resetY = Reset Y as
Expand Down
2 changes: 1 addition & 1 deletion ugs-core/src/resources/MessagesBundle_nn_NO.properties
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ platform.menu.jog.size = Stegstorleik
platform.menu.actions = Handlingar
platform.menu.macros = Makroar
platform.menu.machine = Maskin
incomplete.localization = Universal Gkode sender er ikkje ferdig lokalisert for denne språket.\nBesøk http\://winder.github.io/ugs_website/contrib/translation/ for å sjå korleis du kan hjelpa til.
incomplete.localization = Universal Gkode sender er ikkje ferdig lokalisert for denne språket.\nBesøk https://translate.universalgcodesender.com for å sjå korleis du kan hjelpa til.
mainWindow.swing.softReset = Mjuk tilbakestilling
mainWindow.swing.resetX = Tilbakestill X Akse
mainWindow.swing.resetY = Tilbakestill Y Akse
Expand Down

0 comments on commit 9443115

Please sign in to comment.