Adress review

1) Add NOTE about brute-force deunicode
2) Fix ut8 -> utf8 typo in comment
This commit is contained in:
juliancoffee 2022-08-19 01:46:41 +03:00
parent d26422dc29
commit f104085a85
2 changed files with 6 additions and 1 deletions

View File

@ -152,6 +152,11 @@ impl assets::Compound for Language {
let source: &raw::Resource = &*handle.read();
let src = source.src.clone();
// NOTE:
// This deunicode whole file, which mean it may break if
// we have non-ascii keys.
// I don't consider this a problem, because having
// non-ascii keys is quite exotic.
let src = if convert_utf8_to_ascii {
deunicode(&src)
} else {

View File

@ -25,7 +25,7 @@ impl crate::assets::Asset for Manifest {
//
// NOTE:
// We store String, that later converted to FluentResource.
// We can't do it at load time, because we might want to do ut8 to ascii
// We can't do it at load time, because we might want to do utf8 to ascii
// conversion and we know it only after we've loaded language manifest.
//
// Alternative solution is to make it hold Rc/Arc around FluentResource,