Skip to content

Commit

Permalink
feat: allow translations to differ in number of line-breaks.
Browse files Browse the repository at this point in the history
Some long texts require manual breaks for formatting.
  • Loading branch information
frosch123 committed Apr 30, 2024
1 parent 0f3896b commit 0382e2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ pub const COMMANDS: &'static [CommandInfo] = &[
name: "",
norm_name: None,
dialects: DNGO,
occurence: Occurence::EXACT,
occurence: Occurence::ANY,
front_only: false,
allow_case: false,
def_plural_subindex: None,
Expand Down
18 changes: 4 additions & 14 deletions src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1499,19 +1499,9 @@ mod tests {
let trans =
ParsedString::parse("{RED}{}{RED}{TRAIN}{BLUE}{TRAIN}{RIGHT_ARROW}{SHIP}").unwrap();
let val_trans = validate_string(&config, &trans, Some(&base));
assert_eq!(val_trans.len(), 5);
assert_eq!(val_trans.len(), 4);
assert_eq!(
val_trans[0],
ValidationError {
severity: Severity::Warning,
pos_begin: None,
pos_end: None,
message: String::from("String command '{}': expected 2 times, found 1 times."),
suggestion: None,
}
);
assert_eq!(
val_trans[1],
ValidationError {
severity: Severity::Warning,
pos_begin: None,
Expand All @@ -1521,7 +1511,7 @@ mod tests {
}
);
assert_eq!(
val_trans[2],
val_trans[1],
ValidationError {
severity: Severity::Warning,
pos_begin: None,
Expand All @@ -1533,7 +1523,7 @@ mod tests {
}
);
assert_eq!(
val_trans[3],
val_trans[2],
ValidationError {
severity: Severity::Warning,
pos_begin: None,
Expand All @@ -1543,7 +1533,7 @@ mod tests {
}
);
assert_eq!(
val_trans[4],
val_trans[3],
ValidationError {
severity: Severity::Warning,
pos_begin: None,
Expand Down

0 comments on commit 0382e2e

Please sign in to comment.