-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jpass- Adds user-selected language feature #32
base: master
Are you sure you want to change the base?
Conversation
@@ -215,7 +258,7 @@ private JPassFrame(String fileName, Locale locale) { | |||
|
|||
setJMenuBar(this.jpassMenuBar); | |||
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); | |||
setSize(450, 400); | |||
setSize(490, 400); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaborbata Increases width to allow long string for some JMenu to be displayed. Let me know what you think about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, however it can be a bit wider (plese check with other languages).
@@ -1,6 +1,7 @@ | |||
menuBar.fileMenu=Fájl | |||
menuBar.editMenu=Szerkesztés | |||
menuBar.toolsMenu=Eszközök | |||
menuBar.settingsMenu=Settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaborbata can you also please help to translate these to Hungarian language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, it is called Beállítások
in Hungarian
@@ -87,3 +90,9 @@ panel.save=Salva | |||
panel.open=Apri | |||
panel.saveModifiedQuestionMessage=Il file attuale è stato modificato.\nVuoi salvare le modifiche prima della chiusura? | |||
panel.unencryptedDataWarningMessage=Nota che tutti i dati verranno archiviati non crittografati.\nAssicurati di conservare il file esportato in un luogo sicuro. | |||
|
|||
language.languageChanged=Language has changed successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bovirus If you have some time, can you please suggest the correct translation to Italian for these strings added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
language.languageChanged=Impostazione lingua completata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the input, @bovirus . Can you also please check the other new strings added to this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where can I get the latest Italian language (i see until line 89)?
@@ -98,6 +101,20 @@ public String get(String key, String defaultValue) { | |||
return properties.getProperty(key, defaultValue); | |||
} | |||
|
|||
public void set(String key, String value) { | |||
properties.setProperty(key, value); | |||
saveProperties(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the feature to stores the user-selected language hence next time JPass is opened up will be using the language selected. Let me know what you think about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Unfortunately, comments are not saved.
SUPPORTED_LANGUAGES.forEach((key, value) -> { | ||
JMenuItem language = new JMenuItem(localizedMessages.getString(key)); | ||
if (Objects.equals(getCurrentLanguage(), value)) { | ||
language.setIcon(getIcon("check_mark")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added two new icons. Let me know if these ones are ok or what should be the process to add new ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @edimoral, could you please use symbolic icons from https://github.com/elementary/icons ?
Also, please make sure every icon has two versions in the resources:
- one without a postfix e.g.
world.svg
with fill colorfill='#666'
(this is for the light theme) - one with the
_dark
postfix e.g.world_dark.svg
with fill colorfill='#999'
(this is for dark theme)
Thanks for your changes, I'll review them in the following weeks (depending on job activities). |
@@ -2,6 +2,7 @@ | |||
menuBar.fileMenu=File | |||
menuBar.editMenu=Modifica | |||
menuBar.toolsMenu=Strumenti | |||
menuBar.settingsMenu=Settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bovirus here
@@ -35,6 +36,8 @@ editMenu.findEntry=Trova elemento | |||
|
|||
toolsMenu.generatePassword=Genera password... | |||
|
|||
settingsMenu.language=Language |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bovirus here
@@ -87,3 +90,9 @@ panel.save=Salva | |||
panel.open=Apri | |||
panel.saveModifiedQuestionMessage=Il file attuale è stato modificato.\nVuoi salvare le modifiche prima della chiusura? | |||
panel.unencryptedDataWarningMessage=Nota che tutti i dati verranno archiviati non crittografati.\nAssicurati di conservare il file esportato in un luogo sicuro. | |||
|
|||
language.languageChanged=Language has changed successfully. | |||
language.en.us=Inglese |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And those from L:95 to L:98
@bovirus here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see this line (n. 95) in
src/main/resources/resources/languages/languages_it_IT.properties
The file has 89 lines.
@@ -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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
This PR introduces: