Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fixes default language selection
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://hausach.mfo.de/localhome/imaginar/svn/imaginary/jsurfer/branches/JFXSurfer@793 4beaa02c-d2ff-4d45-9dad-6a4a666722bb
  • Loading branch information
stussak committed Jul 14, 2015
1 parent 32dc98d commit 507af06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions src/de/mfo/jsurfer/fxgui/FXAlgebraicExpressionButtonPanel.fx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class FXAlgebraicExpressionButtonPanel
return new java.util.Locale( "en" );
}

public var language:java.util.Locale=getDefaultLocale();
public var language:java.util.Locale;
var messages:java.util.ResourceBundle=bind ResourceBundle.getBundle( "de.mfo.jsurfer.fxgui.MessagesBundle", language );
public-init var getScale:function (n:Number, w:Number):Number;
public-init var showImpressum:function ():Void;
Expand All @@ -104,8 +104,8 @@ public class FXAlgebraicExpressionButtonPanel

public function set()
{
setButtons();
setPopUp();
setButtons();
setTextField();
setTextField2();

Expand Down Expand Up @@ -353,7 +353,7 @@ public class FXAlgebraicExpressionButtonPanel
}
];

var languagesTmp : String[] = de.mfo.jsurfer.gui.Options.languages.toArray() as String[];
var languagesTmp : String[] = de.mfo.jsurfer.gui.Options.languages.toArray() as String[]; // languages IDs are already trimmed
var starLanguages : String[] = knownLangs_ISO2[ l | javafx.util.Sequences.indexOf( languagesTmp, l ) == -1 ];
var languageList : java.util.LinkedList = new java.util.LinkedList();
for( l in languagesTmp )
Expand All @@ -370,9 +370,16 @@ public class FXAlgebraicExpressionButtonPanel
}
var languages : String[] = languageList.toArray() as String[];
languages = languages[ l | javafx.util.Sequences.indexOf( knownLangs_ISO2, l ) != -1 ];

if( languages.size() > 0 )
{
knownLangs_ISO2 = languages;

if( languagesTmp.size() == 1 and languagesTmp[ 0 ].trim() == "*" )
{
language = getDefaultLocale();
}
else
{
language = new java.util.Locale( knownLangs_ISO2[ 0 ] ); // use first language in list
}

Expand Down
4 changes: 2 additions & 2 deletions src/de/mfo/jsurfer/fxgui/TabField.fx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class TabField {
[
FXGalleryChooser
{
language:java.util.Locale.GERMAN
language: this.language,
width:bind R.width*getScale(sceneHeight,sceneWidth),
height:bind R.height*getScale(sceneHeight,sceneWidth),
gallery:bind pointerGallery
Expand Down Expand Up @@ -153,7 +153,7 @@ public class TabField {
[
FXGalleryMini
{
language:java.util.Locale.GERMAN
language: this.language,
width:bind G.width*getScale(sceneHeight,sceneWidth),
height:bind G.height*getScale(sceneHeight,sceneWidth),
gallerys: bind galleries,
Expand Down

0 comments on commit 507af06

Please sign in to comment.