Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

jpass- Adds user-selected language feature #32

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

edimoral
Copy link
Contributor

@edimoral edimoral commented Mar 10, 2024

This PR introduces:

  • Updates GUI when user selects a language
  • Stores the language selected in jpass.properties file
  • Sets JFileChooser CANCEL button based on language selected
  • Updates README.md file
  • Adds UTs to increase code coverage

@gaborbata
Copy link
Owner

Thanks for your changes, I'll review them in the following weeks (depending on job activities).

@@ -232,8 +275,13 @@ public static JPassFrame getInstance() {

public static synchronized JPassFrame getInstance(String fileName) {
if (instance == null) {
String languageTag = Configuration.getInstance().get("language.languageSetting", "en-US");
instance = new JPassFrame(fileName, Locale.forLanguageTag(languageTag));
String languageTag = Configuration.getInstance().get(LANGUAGE_LANGUAGE_SETTING, null);
Copy link
Owner

Choose a reason for hiding this comment

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

Why don't you simply use Configuration.getInstance().get(LANGUAGE_LANGUAGE_SETTING, "en-US") here?

@@ -87,3 +90,9 @@ panel.save=Save
panel.open=Open
panel.saveModifiedQuestionMessage=The current file has been modified.\nDo you want to save the changes before closing?
panel.unencryptedDataWarningMessage=Please note that all data will be stored unencrypted.\nMake sure you keep the exported file in a secure location.

language.languageChanged=Language has changed successfully.
language.en.us=English
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think it is a good idea to store language names in language resources. Every time a new translation in introduced, then all the resources need to be updated. Maybe it would be better to hard-code them in the supported languages map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added them on the language resource because language names change on each language so they have to be actually translated. It's true that with every new language all the current languages resources needs to add this new language name but I believe it's expected.

Let me know if you want it to change it anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants