|
|
@@ -3,6 +3,7 @@
|
|
|
//! and the crate version). See the `HOST_MARKER_ATTR` constant below.
|
|
|
|
|
|
mod desktop_install;
|
|
|
+mod locale;
|
|
|
|
|
|
use std::path::PathBuf;
|
|
|
use std::sync::{Arc, Mutex};
|
|
|
@@ -993,11 +994,20 @@ fn main() -> glib::ExitCode {
|
|
|
return glib::ExitCode::from(1);
|
|
|
}
|
|
|
|
|
|
+ // Before any web view/network session exists: the first entry becomes the
|
|
|
+ // JavaScript `Intl` default locale (see `locale`).
|
|
|
+ let languages = locale::apply_to_webkit();
|
|
|
+ if !languages.is_empty() {
|
|
|
+ eprintln!("appiphany: preferred languages: {}", languages.join(", "));
|
|
|
+ }
|
|
|
+
|
|
|
let app = Application::builder()
|
|
|
.application_id(effective_app_id)
|
|
|
.flags(ApplicationFlags::HANDLES_COMMAND_LINE)
|
|
|
.build();
|
|
|
|
|
|
+ locale::watch_region_changes(&app);
|
|
|
+
|
|
|
app.connect_command_line(|app, cmdline| {
|
|
|
let raw_args: Vec<String> = match cmdline
|
|
|
.arguments()
|