mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-03 03:32:37 +00:00
Fix i18n
This commit is contained in:
@@ -99,14 +99,14 @@ parse_mo_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTIONS, plur
|
||||
}
|
||||
|
||||
for k in keys {
|
||||
interned_key := strings.intern_get(&translation.intern, string(k))
|
||||
interned_key, _ := strings.intern_get(&translation.intern, string(k))
|
||||
|
||||
interned_vals := make([]string, len(keys))
|
||||
last_val: string
|
||||
|
||||
i := 0
|
||||
for v in vals {
|
||||
interned_vals[i] = strings.intern_get(&translation.intern, string(v))
|
||||
interned_vals[i], _ = strings.intern_get(&translation.intern, string(v))
|
||||
last_val = interned_vals[i]
|
||||
i += 1
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI
|
||||
return translation, .TS_File_Expected_Context_Name,
|
||||
}
|
||||
|
||||
section_name := strings.intern_get(&translation.intern, "")
|
||||
section_name, _ := strings.intern_get(&translation.intern, "")
|
||||
if !options.merge_sections {
|
||||
section_name = strings.intern_get(&translation.intern, ts.elements[section_name_id].value)
|
||||
section_name, _ = strings.intern_get(&translation.intern, ts.elements[section_name_id].value)
|
||||
}
|
||||
|
||||
if section_name not_in translation.k_v {
|
||||
@@ -92,8 +92,8 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI
|
||||
return translation, .TS_File_Expected_Translation
|
||||
}
|
||||
|
||||
source := strings.intern_get(&translation.intern, ts.elements[source_id].value)
|
||||
xlat := strings.intern_get(&translation.intern, ts.elements[translation_id].value)
|
||||
source, _ := strings.intern_get(&translation.intern, ts.elements[source_id].value)
|
||||
xlat, _ := strings.intern_get(&translation.intern, ts.elements[translation_id].value)
|
||||
|
||||
if source in section {
|
||||
return translation, .Duplicate_Key
|
||||
@@ -124,7 +124,7 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI
|
||||
if !numerus_found {
|
||||
break
|
||||
}
|
||||
numerus := strings.intern_get(&translation.intern, ts.elements[numerus_id].value)
|
||||
numerus, _ := strings.intern_get(&translation.intern, ts.elements[numerus_id].value)
|
||||
section[source][num_plurals] = numerus
|
||||
|
||||
num_plurals += 1
|
||||
|
||||
Reference in New Issue
Block a user