Skip to content

Commit 0382e2e

Browse files
committed
feat: allow translations to differ in number of line-breaks.
Some long texts require manual breaks for formatting.
1 parent 0f3896b commit 0382e2e

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub const COMMANDS: &'static [CommandInfo] = &[
175175
name: "",
176176
norm_name: None,
177177
dialects: DNGO,
178-
occurence: Occurence::EXACT,
178+
occurence: Occurence::ANY,
179179
front_only: false,
180180
allow_case: false,
181181
def_plural_subindex: None,

src/validate.rs

+4-14
Original file line numberDiff line numberDiff line change
@@ -1499,19 +1499,9 @@ mod tests {
14991499
let trans =
15001500
ParsedString::parse("{RED}{}{RED}{TRAIN}{BLUE}{TRAIN}{RIGHT_ARROW}{SHIP}").unwrap();
15011501
let val_trans = validate_string(&config, &trans, Some(&base));
1502-
assert_eq!(val_trans.len(), 5);
1502+
assert_eq!(val_trans.len(), 4);
15031503
assert_eq!(
15041504
val_trans[0],
1505-
ValidationError {
1506-
severity: Severity::Warning,
1507-
pos_begin: None,
1508-
pos_end: None,
1509-
message: String::from("String command '{}': expected 2 times, found 1 times."),
1510-
suggestion: None,
1511-
}
1512-
);
1513-
assert_eq!(
1514-
val_trans[1],
15151505
ValidationError {
15161506
severity: Severity::Warning,
15171507
pos_begin: None,
@@ -1521,7 +1511,7 @@ mod tests {
15211511
}
15221512
);
15231513
assert_eq!(
1524-
val_trans[2],
1514+
val_trans[1],
15251515
ValidationError {
15261516
severity: Severity::Warning,
15271517
pos_begin: None,
@@ -1533,7 +1523,7 @@ mod tests {
15331523
}
15341524
);
15351525
assert_eq!(
1536-
val_trans[3],
1526+
val_trans[2],
15371527
ValidationError {
15381528
severity: Severity::Warning,
15391529
pos_begin: None,
@@ -1543,7 +1533,7 @@ mod tests {
15431533
}
15441534
);
15451535
assert_eq!(
1546-
val_trans[4],
1536+
val_trans[3],
15471537
ValidationError {
15481538
severity: Severity::Warning,
15491539
pos_begin: None,

0 commit comments

Comments
 (0)