mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-23 14:06:16 +02:00
Filter out “fuzzy” translations (#212)
When the source text is updated, existing translations become outdated. The `msgmerge` program will attempt to find a similar source text among the existing translations and will reuse the translation. The translation is marked “fuzzy” to signal to the translator that it needs to be proofread.
This commit is contained in:
parent
27b6165202
commit
690039fd53
@ -52,6 +52,7 @@ fn translate(text: &str, catalog: &Catalog) -> String {
|
||||
|
||||
let translated = catalog
|
||||
.find_message(paragraph)
|
||||
.filter(|msg| !msg.flags.contains("fuzzy"))
|
||||
.and_then(|msg| msg.get_msgstr().ok())
|
||||
.filter(|msgstr| !msgstr.is_empty())
|
||||
.map(|msgstr| msgstr.as_str())
|
||||
|
Loading…
x
Reference in New Issue
Block a user