Skip to content
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

added description string to the themeloader, this is then used to dis… #5584

Merged
merged 4 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public void storeSettings() {
}

if (themeLightProperty.getValue() && !preferences.get(JabRefPreferences.FX_THEME).equals(ThemeLoader.MAIN_CSS)) {
restartWarnings.add(Localization.lang("Theme changed:") + " " + ThemeLoader.MAIN_CSS);
Copy link
Member

Choose a reason for hiding this comment

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

I would include the theme name directly in the localization: Localization.lang("Theme changed to light theme");. This way, the theme name is also translated. I would accept the two new localization strings.

restartWarnings.add(Localization.lang("Theme changed:") + " " + ThemeLoader.MAIN_DESCRIPTION);
preferences.put(JabRefPreferences.FX_THEME, ThemeLoader.MAIN_CSS);
} else if (themeDarkProperty.getValue() && !preferences.get(JabRefPreferences.FX_THEME).equals(ThemeLoader.DARK_CSS)) {
restartWarnings.add(Localization.lang("Theme changed:") + " " + ThemeLoader.DARK_CSS);
restartWarnings.add(Localization.lang("Theme changed:") + " " + ThemeLoader.DARK_DESCRIPTION);
preferences.put(JabRefPreferences.FX_THEME, ThemeLoader.DARK_CSS);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/util/ThemeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
public class ThemeLoader {

public static final String MAIN_CSS = "Base.css";
public static final String MAIN_DESCRIPTION = "Light theme";
public static final String DARK_DESCRIPTION = "Dark theme";
public static final String DARK_CSS = "Dark.css";

private static final Logger LOGGER = LoggerFactory.getLogger(ThemeLoader.class);
Expand Down