Commit 5dc29881 authored by adalovegirls's avatar adalovegirls
Browse files

Progress...

parent 6e4bbabd
Pipeline #258464914 failed with stages
in 4 minutes and 44 seconds
......@@ -85,6 +85,8 @@ pub struct Localization {
pub fonts: Fonts,
pub metadata: LanguageMetadata,
pub use_english_fallback: bool,
}
/// Store internationalization maps
......@@ -170,6 +172,10 @@ impl Localization {
);
}
}
pub fn set_english_fallback(&mut self, use_english_fallback: bool) {
self.use_english_fallback = use_english_fallback;
}
}
impl From<RawLocalization> for Localization {
fn from(raw: RawLocalization) -> Self {
......@@ -182,6 +188,7 @@ impl From<RawLocalization> for Localization {
convert_utf8_to_ascii: raw.convert_utf8_to_ascii,
fonts: raw.fonts,
metadata: raw.metadata,
use_english_fallback: true,
}
}
}
......
......@@ -168,6 +168,7 @@ fn main() {
Localization::load_expect(&i18n_asset_key(&settings.language.selected_language))
});
i18n.read().log_missing_entries();
i18n.read().set_english_fallback(settings.i18n.use_english_fallback);
// Create window
let (window, event_loop) = Window::new(&settings).expect("Failed to create window!");
......
......@@ -56,7 +56,7 @@ impl From<ControlSettingsSerde> for ControlSettings {
}
/// Since Macbook trackpads lack middle click, on OS X we default to LShift
/// instead It is an imperfect heuristic, but hopefully it will be a slightly
/// instead. It is an imperfect heuristic, but hopefully it will be a slightly
/// better default, and the two places we default to middle click currently
/// (roll and wall jump) are both situations where you cannot glide (the other
/// default mapping for LShift).
......@@ -742,6 +742,20 @@ impl Default for LanguageSettings {
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct I18nSettings {
pub use_english_fallback: bool,
}
impl Default for I18nSettings {
fn default() -> Self {
Self {
use_english_fallback: true,
}
}
}
/// `Settings` contains everything that can be configured in the settings.ron
/// file.
#[derive(Clone, Debug, Serialize, Deserialize)]
......@@ -758,6 +772,7 @@ pub struct Settings {
// TODO: Remove at a later date, for dev testing
pub logon_commands: Vec<String>,
pub language: LanguageSettings,
pub i18n: I18nSettings,
pub screenshots_path: PathBuf,
pub controller: GamepadSettings,
}
......@@ -792,6 +807,7 @@ impl Default for Settings {
send_logon_commands: false,
logon_commands: Vec::new(),
language: LanguageSettings::default(),
i18n: I18nSettings::default(),
screenshots_path,
controller: GamepadSettings::default(),
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment