Skip to content

Conversation

@Ramona2021
Copy link

added language en, de, fr and public possibilty to switch

matchesLabel.setText(matchCount + " matches");
}
pageLabel.setText(getTranslation("Page", (item.getPageNumber() + 1)));
matchesLabel.setText(getTranslation("Matches", item.getItems().size()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not handle the same situations as the original code. I explicitly want to write "1 match" and "2 matches" (singular, plural).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw the resource bundle. I didn't know that this is possible. So you can specify this to use either singular or plural translation? If so then I learned something new today :-)

}
}

public void loadLanguageProperties(String language) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know any JavaFX controls that explicitly add methods for translating the control. This should happen automatically. The control should pickup the required language bundle based on the language currently used by the JVM. If you need to be able to switch languages at runtime then you need to subclass the control and add the feature there.

…class to enable translations in PDFView and PDFViewSkin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants