i18n: Use gettext function instead of wrapper

No need to deviate from the default here.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/170>
This commit is contained in:
Sophie Herold 2023-04-11 00:02:28 +02:00 • committed by Christopher Davis
parent 695693cf74
commit f8cc9f5f84
16 changed files with 83 additions and 274 deletions

View file

@ -1,4 +1,4 @@
use crate::i18n::*;
use crate::util::gettext::*;
#[derive(Debug, Clone, Copy)]
pub struct GPSLocation {
@ -133,10 +133,10 @@ impl GPSLocation {
let coord = self.latitude;
let reference = if coord.sing {
// Translators: short for "north" in GPS coordinate
i18n("N")
gettext("N")
} else {
// Translators: short for "south" in GPS coordinate
i18n("S")
gettext("S")
};
coord.display(&reference)
@ -146,10 +146,10 @@ impl GPSLocation {
let coord = self.longitude;
let reference = if coord.sing {
// Translators: short for "east" in GPS coordinate
i18n("E")
gettext("E")
} else {
// Translators: short for "west" in GPS coordinate
i18n("W")
gettext("W")
};
coord.display(&reference)

View file

@ -9,8 +9,8 @@ mod obj;
pub use gps::GPSLocation;
pub use obj::LpImageMetadata;
use crate::i18n::*;
use crate::util;
use crate::util::gettext::*;
use gtk::glib;
@ -126,7 +126,7 @@ impl ImageMetadata {
let exposure = format!("{:.0}", 1. / rational.first()?.to_f32());
// Translators: Unit for exposure time in seconds
return Some(i18n_f("1\u{2215}{}\u{202F}s", &[&exposure]));
return Some(gettext_f("1\u{2215}{}\u{202F}s", &[&exposure]));
}
}
@ -151,7 +151,7 @@ impl ImageMetadata {
if let exif::Value::Rational(rational) = &field.value {
let length = format!("{:.0}", rational.first()?.to_f32());
// Translators: Unit for focal length in millimeters
return Some(i18n_f("{}\u{202F}mm", &[&length]));
return Some(gettext_f("{}\u{202F}mm", &[&length]));
}
}