1
0
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:
Martin Geisler 2023-01-28 14:36:57 +01:00 committed by GitHub
parent 27b6165202
commit 690039fd53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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())