aboutsummaryrefslogtreecommitdiff
path: root/core/text/i18n/qt_linguist.odin
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-10-29 11:29:20 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2026-02-08 12:44:11 +0100
commit586355f4ac7f308b8a304078fbb15191ffbba952 (patch)
treef03419ff8a965c26736083471c0e4f2090ad6625 /core/text/i18n/qt_linguist.odin
parentab0f1aa0c43c4b71ef1b57f9b53b1e9ec16878bb (diff)
core:text/i18n -> core:os/os2
Diffstat (limited to 'core/text/i18n/qt_linguist.odin')
-rw-r--r--core/text/i18n/qt_linguist.odin12
1 files changed, 2 insertions, 10 deletions
diff --git a/core/text/i18n/qt_linguist.odin b/core/text/i18n/qt_linguist.odin
index 2fc5efe7b..78fe2712d 100644
--- a/core/text/i18n/qt_linguist.odin
+++ b/core/text/i18n/qt_linguist.odin
@@ -11,7 +11,6 @@ package i18n
List of contributors:
Jeroen van Rijn: Initial implementation.
*/
-import "core:os"
import "core:encoding/xml"
import "core:strings"
@@ -56,9 +55,7 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI
return nil, .TS_File_Parse_Error
}
- /*
- Initalize Translation, interner and optional pluralizer.
- */
+ // Initalize Translation, interner and optional pluralizer.
translation = new(Translation)
translation.pluralize = pluralizer
strings.intern_init(&translation.intern, allocator, allocator)
@@ -69,7 +66,6 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI
child_id := get_id(value) or_return
// These should be <context>s.
-
if ts.elements[child_id].ident != "context" {
return translation, .TS_File_Expected_Context
}
@@ -159,11 +155,7 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI
}
parse_qt_linguist_file :: proc(filename: string, options := DEFAULT_PARSE_OPTIONS, pluralizer: proc(int) -> int = nil, allocator := context.allocator) -> (translation: ^Translation, err: Error) {
- context.allocator = allocator
-
- data, data_ok := os.read_entire_file(filename)
- if !data_ok { return {}, .File_Error }
-
+ data := read_file(filename, allocator) or_return
return parse_qt_linguist_from_bytes(data, options, pluralizer, allocator)
}