Skip to content

Commit

Permalink
stringtable - fix escaped char (&) in stringtables
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Dec 17, 2024
1 parent 65cb4e0 commit d3dd157
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/stringtable/src/rapify.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{Key, Project, ALL_LANGUAGES};
use hemtt_workspace::WorkspacePath;
use tracing::trace;
use tracing::{error, trace};

#[derive(Default, Debug)]
pub struct XmlbLayout {
Expand Down Expand Up @@ -137,7 +137,11 @@ pub fn rapify(project: &Project) -> Option<XmlbLayout> {
i32::try_from(translation.phrases.len()).expect("overflow"),
);
for phrase in &translation.phrases {
write_string(&mut translation_buffer, phrase);
let unescaped = quick_xml::escape::unescape(phrase.as_str());
if unescaped.is_err() {
error!("failed to unescape {}", phrase);
}
write_string(&mut translation_buffer, &unescaped.unwrap_or_default());
}
rolling_offset += translation_buffer.len();
data.translations.push(translation_buffer);
Expand Down

0 comments on commit d3dd157

Please sign in to comment.