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:
parent
695693cf74
commit
f8cc9f5f84
16 changed files with 83 additions and 274 deletions
|
|
@ -31,8 +31,8 @@ use crate::deps::*;
|
|||
|
||||
use crate::decoder::tiling::FrameBufferExt;
|
||||
use crate::decoder::{self, tiling, Decoder, DecoderUpdate};
|
||||
use crate::i18n::i18n;
|
||||
use crate::image_metadata::LpImageMetadata;
|
||||
use crate::util::gettext::*;
|
||||
use crate::util::Gesture;
|
||||
|
||||
use crate::util::spawn;
|
||||
|
|
@ -748,7 +748,7 @@ impl LpImage {
|
|||
self.set_file(&file);
|
||||
|
||||
if !path.is_file() {
|
||||
self.set_error(anyhow::Error::msg(i18n("File does not exist")));
|
||||
self.set_error(anyhow::Error::msg(gettext("File does not exist")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
use crate::deps::*;
|
||||
use crate::file_model::LpFileModel;
|
||||
use crate::i18n::*;
|
||||
use crate::util::gettext::*;
|
||||
use crate::util::{Direction, Position};
|
||||
use crate::widgets::{LpImage, LpImagePage, LpSlidingView};
|
||||
|
||||
|
|
@ -555,7 +555,7 @@ impl LpImageView {
|
|||
let background = self
|
||||
.current_path()
|
||||
.and_then(|p| std::fs::File::open(p).ok())
|
||||
.context(i18n("Failed to open new background image"))?;
|
||||
.context(gettext("Failed to open new background image"))?;
|
||||
let native = self.native().expect("View should have a GtkNative");
|
||||
let id = WindowIdentifier::from_native(&native).await;
|
||||
|
||||
|
|
@ -572,14 +572,14 @@ impl LpImageView {
|
|||
Ok(_) => self
|
||||
.activate_action(
|
||||
"win.show-toast",
|
||||
Some(&(i18n("Set as background."), 1).to_variant()),
|
||||
Some(&(gettext("Set as background."), 1).to_variant()),
|
||||
)
|
||||
.unwrap(),
|
||||
Err(err) => {
|
||||
if !matches!(err, Error::Response(ResponseError::Cancelled)) {
|
||||
self.activate_action(
|
||||
"win.show-toast",
|
||||
Some(&(i18n("Could not set background."), 1).to_variant()),
|
||||
Some(&(gettext("Could not set background."), 1).to_variant()),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue