2021-05-29 13:41:04 +02:00
|
|
|
--- ./rust/libnewsboat/src/filterparser.rs.orig 2021-05-17 15:52:16.226226704 +0000
|
|
|
|
+++ ./rust/libnewsboat/src/filterparser.rs 2021-05-17 15:53:32.474081081 +0000
|
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},
|
2021-05-29 13:41:04 +02:00
|
|
|
@@ -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(),
|
2021-05-29 13:41:04 +02:00
|
|
|
// 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(),
|
2021-05-29 13:41:04 +02:00
|
|
|
// 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(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-29 13:41:04 +02:00
|
|
|
@@ -425,19 +424,19 @@
|
2020-10-22 00:37:58 +02:00
|
|
|
let err = match error {
|
|
|
|
Error::TrailingCharacters(pos, tail) => fmt!(
|
|
|
|
// The "%{}" thing is a number, a zero-based offset into a string.
|
|
|
|
- &gettext("Parse error: trailing characters after position %{}: %s"),
|
|
|
|
+ "Parse error: trailing characters after position %{}: %s",
|
|
|
|
PRIu64,
|
|
|
|
pos as u64,
|
|
|
|
tail
|
|
|
|
),
|
|
|
|
Error::AtPos(pos, expected) => fmt!(
|
|
|
|
// The "%{}" thing is a number, a zero-based offset into a string.
|
|
|
|
- &gettext("Parse error at position %{}: expected %s"),
|
|
|
|
+ "Parse error at position %{}: expected %s",
|
|
|
|
PRIu64,
|
|
|
|
pos as u64,
|
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)
|
|
|
|
}
|