diff --git a/podcasts-gtk/build.rs b/podcasts-gtk/build.rs index ab9e977..45d6332 100644 --- a/podcasts-gtk/build.rs +++ b/podcasts-gtk/build.rs @@ -14,20 +14,4 @@ fn main() { .current_dir("resources") .status() .unwrap(); - - // Generating build globals - let default_locales = "./podcasts-gtk/po".to_string(); - let out_dir = env::var("OUT_DIR").unwrap(); - let localedir = env::var("PODCASTS_LOCALEDIR").unwrap_or(default_locales); - let dest_path = Path::new(&out_dir).join("build_globals.rs"); - let mut f = File::create(&dest_path).unwrap(); - - let globals = format!( - " -pub(crate) static LOCALEDIR: &'static str = \"{}\"; -", - localedir - ); - - f.write_all(&globals.into_bytes()[..]).unwrap(); } diff --git a/podcasts-gtk/src/app.rs b/podcasts-gtk/src/app.rs index 8a15784..b4397c4 100644 --- a/podcasts-gtk/src/app.rs +++ b/podcasts-gtk/src/app.rs @@ -30,8 +30,6 @@ use i18n::i18n; pub(crate) const APP_ID: &str = "org.gnome.Podcasts"; -include!(concat!(env!("OUT_DIR"), "/build_globals.rs")); - /// Creates an action named `name` in the action map `T with the handler `F` fn action(thing: &T, name: &str, action: F) where @@ -377,7 +375,7 @@ impl App { pub(crate) fn run() { // Set up the textdomain for gettext setlocale(LocaleCategory::LcAll, ""); - bindtextdomain("gnome-podcasts", LOCALEDIR); + bindtextdomain("gnome-podcasts", env!("LOCALEDIR")); textdomain("gnome-podcasts"); let application = gtk::Application::new(APP_ID, gio::ApplicationFlags::empty())