From b93a88e64197b04f0c68016e865e1fb18d0acb41 Mon Sep 17 00:00:00 2001 From: stussak Date: Mon, 20 Jul 2015 13:56:51 +0000 Subject: [PATCH] switch language by selecting language endonyms, not ISO-631-2 language codes new binary git-svn-id: svn+ssh://hausach.mfo.de/localhome/imaginar/svn/imaginary/jsurfer/branches/JFXSurfer@795 4beaa02c-d2ff-4d45-9dad-6a4a666722bb --- .../fxgui/FXAlgebraicExpressionButtonPanel.fx | 21 ++++++++----------- .../jsurfer/fxgui/MessagesBundle.properties | 1 + 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/de/mfo/jsurfer/fxgui/FXAlgebraicExpressionButtonPanel.fx b/src/de/mfo/jsurfer/fxgui/FXAlgebraicExpressionButtonPanel.fx index ee37010..096c731 100644 --- a/src/de/mfo/jsurfer/fxgui/FXAlgebraicExpressionButtonPanel.fx +++ b/src/de/mfo/jsurfer/fxgui/FXAlgebraicExpressionButtonPanel.fx @@ -394,8 +394,6 @@ public class FXAlgebraicExpressionButtonPanel } after langButtonList[ 0 ]; } - - var font : Font = Globals.getJavaFXFont( 30 ); popUp = VBox { blocksMouse: true; } var langButtonListWithText : Node[] = []; @@ -403,7 +401,8 @@ public class FXAlgebraicExpressionButtonPanel { // add language code var code = knownLangs_ISO2[ i ]; - var t = Text { content: code font: font }; + var messageBundleForCode = java.util.ResourceBundle.getBundle( "de.mfo.jsurfer.fxgui.MessagesBundle", new Locale( code ) ); + var t = Text { content: messageBundleForCode.getString( "language" ) font: javafx.scene.text.Font.font( "Arial", 24 ) }; var b : FXButton = langButtonList[ i ] as FXButton; b.action = function() { language=new java.util.Locale( code );popUp.visible=false; } insert Stack { content: [ b, t ] } into langButtonListWithText; @@ -456,21 +455,19 @@ public class FXAlgebraicExpressionButtonPanel { content: [ - javafx.scene.text.Text - { - //x:0.2*fxdLayoutFile.getNode("Button_Language").boundsInLocal.width - y:0.7*fxdLayoutFile.getNode("Button_Language").boundsInLocal.height - font: javafx.scene.text.Font { size: fxdLayoutFile.getNode("Button_Language").boundsInLocal.height * 0.8 } - textAlignment:javafx.scene.text.TextAlignment.CENTER - content: bind language.getLanguage() + javafx.scene.shape.SVGPath { + content: "M654 458q-1 -3 -12.5 0.5t-31.5 11.5l-20 9q-44 20 -87 49q-7 5 -41 31.5t-38 28.5q-67 -103 -134 -181q-81 -95 -105 -110q-4 -2 -19.5 -4t-18.5 0q6 4 82 92q21 24 85.5 115t78.5 118q17 30 51 98.5t36 77.5q-8 1 -110 -33q-8 -2 -27.5 -7.5t-34.5 -9.5t-17 -5 q-2 -2 -2 -10.5t-1 -9.5q-5 -10 -31 -15q-23 -7 -47 0q-18 4 -28 21q-4 6 -5 23q6 2 24.5 5t29.5 6q58 16 105 32q100 35 102 35q10 2 43 19.5t44 21.5q9 3 21.5 8t14.5 5.5t6 -0.5q2 -12 -1 -33q0 -2 -12.5 -27t-26.5 -53.5t-17 -33.5q-25 -50 -77 -131l64 -28 q12 -6 74.5 -32t67.5 -28q4 -1 10.5 -25.5t4.5 -30.5zM449 944q3 -15 -4 -28q-12 -23 -50 -38q-30 -12 -60 -12q-26 3 -49 26q-14 15 -18 41l1 3q3 -3 19.5 -5t26.5 0t58 16q36 12 55 14q17 0 21 -17zM1147 815l63 -227l-139 42zM39 15l694 232v1032l-694 -233v-1031z M1280 332l102 -31l-181 657l-100 31l-216 -536l102 -31l45 110l211 -65zM777 1294l573 -184v380zM1088 -29l158 -13l-54 -160l-40 66q-130 -83 -276 -108q-58 -12 -91 -12h-84q-79 0 -199.5 39t-183.5 85q-8 7 -8 16q0 8 5 13.5t13 5.5q4 0 18 -7.5t30.5 -16.5t20.5 -11 q73 -37 159.5 -61.5t157.5 -24.5q95 0 167 14.5t157 50.5q15 7 30.5 15.5t34 19t28.5 16.5zM1536 1050v-1079l-774 246q-14 -6 -375 -127.5t-368 -121.5q-13 0 -18 13q0 1 -1 3v1078q3 9 4 10q5 6 20 11q106 35 149 50v384l558 -198q2 0 160.5 55t316 108.5t161.5 53.5 q20 0 20 -21v-418z", + scaleX: 0.020, + scaleY: -0.020, + translateX: -755, + translateY: -614 } ] - //translateX: bind fxdLayoutFile.getNode("Button_Language").boundsInLocal.minX+fxdLayoutFile.getNode("Button_Language").boundsInLocal.width/2-languageText.boundsInLocal.width/2; translateX: bind fxdLayoutFile.getNode("Button_Language").boundsInLocal.minX+fxdLayoutFile.getNode("Button_Language").translateX+fxdLayoutFile.getNode("Button_Language").boundsInLocal.width/2-languageText.boundsInLocal.width/2.5 translateY: fxdLayoutFile.getNode("Button_Language").boundsInLocal.minY; } } - + function setTextField2() { keyboardTextParameters=javafx.scene.Group diff --git a/src/de/mfo/jsurfer/fxgui/MessagesBundle.properties b/src/de/mfo/jsurfer/fxgui/MessagesBundle.properties index 29024a7..0333389 100755 --- a/src/de/mfo/jsurfer/fxgui/MessagesBundle.properties +++ b/src/de/mfo/jsurfer/fxgui/MessagesBundle.properties @@ -1,3 +1,4 @@ +language=fallback (en) variables=Variables arithmeticOperations=Arithmetic operations parameters=Parameters