tests: run tests with different lang settings
fix: parsing subscriber count on channel search itms fix: add warnings for all date and numstr parsing fix: error parsing search suggestions
This commit is contained in:
parent
6a99540ef5
commit
b88faa9d05
32 changed files with 6501 additions and 214 deletions
|
|
@ -5571,17 +5571,19 @@ pub(crate) fn entry(lang: Language) -> Entry {
|
|||
timeago_tokens: ::phf::Map {
|
||||
key: 15467950696543387533,
|
||||
disps: &[
|
||||
(3, 5),
|
||||
(0, 0),
|
||||
(0, 1),
|
||||
(2, 0),
|
||||
],
|
||||
entries: &[
|
||||
("ว\u{e34}นาท\u{e35}ท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Second) }),
|
||||
("ว\u{e31}นท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Day) }),
|
||||
("นาท\u{e35}ท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Minute) }),
|
||||
("ช\u{e31}\u{e48}วโมงท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Hour) }),
|
||||
("ส\u{e31}ปดาห\u{e4c}ท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Week) }),
|
||||
("ป\u{e35}ท\u{e35}\u{e48}แล\u{e49}ว", TaToken { n: 1, unit: Some(TimeUnit::Year) }),
|
||||
("เด\u{e37}อนท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Month) }),
|
||||
("ช\u{e31}\u{e48}วโมงท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Hour) }),
|
||||
("นาท\u{e35}", TaToken { n: 1, unit: Some(TimeUnit::Minute) }),
|
||||
("ว\u{e31}นท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Day) }),
|
||||
("ส\u{e31}ปดาห\u{e4c}ท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Week) }),
|
||||
("ว\u{e34}นาท\u{e35}", TaToken { n: 1, unit: Some(TimeUnit::Second) }),
|
||||
("ว\u{e34}นาท\u{e35}ท\u{e35}\u{e48}ผ\u{e48}านมา", TaToken { n: 1, unit: Some(TimeUnit::Second) }),
|
||||
],
|
||||
},
|
||||
date_order: &[DateCmp::D, DateCmp::Y],
|
||||
|
|
|
|||
|
|
@ -328,6 +328,21 @@ where
|
|||
.ok()
|
||||
}
|
||||
|
||||
pub fn parse_large_numstr_or_warn<F>(
|
||||
string: &str,
|
||||
lang: Language,
|
||||
warnings: &mut Vec<String>,
|
||||
) -> Option<F>
|
||||
where
|
||||
F: TryFrom<u64>,
|
||||
{
|
||||
let res = parse_large_numstr::<F>(string, lang);
|
||||
if res.is_none() {
|
||||
warnings.push(format!("could not parse numstr `{string}`"));
|
||||
}
|
||||
res
|
||||
}
|
||||
|
||||
/// Replace all html control characters to make a string safe for inserting into HTML.
|
||||
pub fn escape_html(input: &str) -> String {
|
||||
let mut buf = String::with_capacity(input.len());
|
||||
|
|
|
|||
Reference in a new issue