termux-packages/packages/newsboat/rust-libnewsboat-src-filter...

47 lines
2.2 KiB
Diff
Raw Normal View History

2022-05-05 03:32:57 +02:00
--- a/rust/libnewsboat/src/filterparser.rs
+++ b/rust/libnewsboat/src/filterparser.rs
2020-10-22 00:37:58 +02:00
@@ -1,6 +1,5 @@
//! Parses filter expressions.
-use gettextrs::gettext;
use nom::{
branch::alt,
2021-01-07 15:18:15 +01:00
bytes::complete::{escaped, is_not, tag, take, take_while, take_while1},
@@ -126,11 +125,11 @@
2021-01-07 15:18:15 +01:00
/// indicating the thing thah was expected.
fn translate_expected(expected: Expected) -> String {
match expected {
- Expected::AttributeName => gettext("attribute name"),
+ Expected::AttributeName => "attribute name".to_string(),
// Don't translate "between" -- it's a keyword, not an English word.
- Expected::Operators => gettext("one of: =~, ==, =, !~, !=, <=, >=, <, >, between, #, !#"),
2021-01-07 15:18:15 +01:00
+ Expected::Operators => "one of: =~, ==, =, !~, !=, <=, >=, <, >, between, #, !#".to_string(),
// The options ("quoted string" etc.) are not keywords, so please translate them.
- Expected::Value => gettext("one of: quoted string, range, number"),
2021-01-07 15:18:15 +01:00
+ Expected::Value => "one of: quoted string, range, number".to_string(),
}
}
2022-05-05 03:32:57 +02:00
@@ -423,18 +422,18 @@
2020-10-22 00:37:58 +02:00
Error::TrailingCharacters(pos, tail) => fmt!(
2022-05-05 03:32:57 +02:00
// The first %s is an integer offset at which trailing characters start, the
// second %s is the tail itself.
- &gettext("Parse error: trailing characters after position %s: %s"),
+ "Parse error: trailing characters after position %s: %s",
&pos.to_string(),
2020-10-22 00:37:58 +02:00
tail
),
Error::AtPos(pos, expected) => fmt!(
2022-05-05 03:32:57 +02:00
// The first %s is a zero-based offset into the string, the second %s is the
// description of what the program expected at that point.
- &gettext("Parse error at position %s: expected %s"),
+ "Parse error at position %s: expected %s",
&pos.to_string(),
2021-01-07 15:18:15 +01:00
&translate_expected(expected)
2020-10-22 00:37:58 +02:00
),
- Error::Internal => fmt!(&gettext("Internal parse error")),
+ Error::Internal => fmt!("Internal parse error"),
};
Err(err)
}