com.github.almasb:fx-localization

JavaFX Localization Library

License

License

GroupId

GroupId

com.github.almasb
ArtifactId

ArtifactId

fx-localization
Last Version

Last Version

1
Release Date

Release Date

Type

Type

jar
Description

Description

com.github.almasb:fx-localization
JavaFX Localization Library
Project URL

Project URL

https://github.com/AlmasB/fx-localization
Source Code Management

Source Code Management

https://github.com/AlmasB/fx-localization

Download fx-localization

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.almasb/fx-localization/ -->
<dependency>
    <groupId>com.github.almasb</groupId>
    <artifactId>fx-localization</artifactId>
    <version>1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.almasb/fx-localization/
implementation 'com.github.almasb:fx-localization:1'
// https://jarcasting.com/artifacts/com.github.almasb/fx-localization/
implementation ("com.github.almasb:fx-localization:1")
'com.github.almasb:fx-localization:jar:1'
<dependency org="com.github.almasb" name="fx-localization" rev="1">
  <artifact name="fx-localization" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.almasb', module='fx-localization', version='1')
)
libraryDependencies += "com.github.almasb" % "fx-localization" % "1"
[com.github.almasb/fx-localization "1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.openjfx : javafx-base jar 15

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-engine jar 5.7.0
org.junit.jupiter : junit-jupiter-params jar 5.7.0
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

fx-localization

A tiny JavaFX library that provides localization API.

Usage

public class BasicApp extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        FXLocal local = new FXLocal(Locale.ENGLISH);
        local.addLocaleData(Locale.ENGLISH, Map.of("someKey", "someValueEnglish"));
        local.addLocaleData(Locale.FRENCH, Map.of("someKey", "someValueFrench"));
        
        Button button = new Button();
        button.textProperty().bind(local.localizedStringBinding("someKey"));
        button.setOnAction(e -> {
            local.setSelectedLocale(Locale.FRENCH);
        });

        stage.setScene(new Scene(new StackPane(button), 800, 600));
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Maven

<dependency>
    <groupId>com.github.almasb</groupId>
    <artifactId>fx-localization</artifactId>
    <version>1</version>
</dependency>

Gradle

implementation 'com.github.almasb:fx-localization:1'

Versions

Version
1