Install any skill in seconds. Free to start, no credit card required.
Get Started Free →johannesrabauer/javafx-localization-runtime-language
Localize JavaFX applications with resource bundles, locale-aware formatting, and runtime language switching.
Passed 22 of 22 test cases with the skill, and 19 of 22 without it.
3 fixed19 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
When invoking `Bindings.createStringBinding(Callable<String> func, Observable... dependencies)` to localize a JavaFX control text property, what observable object must be passed into `dependencies`?
| Checked | Without skill | With skill |
|---|---|---|
| Passes the observable Locale property as the dependency argument in Bindings.createStringBinding. | Missed | Passed |
The instructions your model reads when the skill loads.
Use this skill when the UI must support multiple locales, runtime language switching, or locale-sensitive formatting. Libraries such as Language Manager show that dynamic switching is a meaningful JavaFX use case beyond startup-only resource bundles.
import java.util.Locale;
import java.util.ResourceBundle;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
public class LocalizedView extends VBox {
private final ObjectProperty<Locale> locale = new SimpleObjectProperty<>(Locale.ENGLISH);
public LocalizedView() {
var label = new Label();
var switchButton = new Button();
label.textProperty().bind(Bindings.createStringBinding(
() -> bundle().getString("greeting"),
locale
));
switchButton.textProperty().bind(Bindings.createStringBinding(
() -> bundle().getString("switchLanguage"),
locale
));
switchButton.setOnAction(event -> locale.set(
locale.get().equals(Locale.ENGLISH) ? Locale.GERMAN : Locale.ENGLISH
));
test cases passed, vs 19 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.