From 9c9c2b483c93be2f6e78911d997229a4b543c66d Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Fri, 29 Apr 2022 18:41:21 +0200 Subject: [PATCH] [i18n] Enable *nix tests again. --- core/text/i18n/qt_linguist.odin | 18 +++++++++--------- tests/core/Makefile | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/text/i18n/qt_linguist.odin b/core/text/i18n/qt_linguist.odin index e23e9aef4..15a88a42f 100644 --- a/core/text/i18n/qt_linguist.odin +++ b/core/text/i18n/qt_linguist.odin @@ -92,15 +92,15 @@ parse_qt_linguist_from_slice :: proc(data: []u8, options := DEFAULT_PARSE_OPTION return translation, .TS_File_Expected_Translation } - source := ts.elements[source_id] - xlat := ts.elements[translation_id] + source := strings.intern_get(&translation.intern, ts.elements[source_id].value) + xlat := strings.intern_get(&translation.intern, ts.elements[translation_id].value) - if source.value in section { + if source in section { return translation, .Duplicate_Key } if has_plurals { - if xlat.value != "" { + if xlat != "" { return translation, .TS_File_Expected_NumerusForm } @@ -116,7 +116,7 @@ parse_qt_linguist_from_slice :: proc(data: []u8, options := DEFAULT_PARSE_OPTION if num_plurals < 2 { return translation, .TS_File_Expected_NumerusForm } - section[source.value] = make([]string, num_plurals) + section[source] = make([]string, num_plurals) num_plurals = 0 for { @@ -124,15 +124,15 @@ parse_qt_linguist_from_slice :: proc(data: []u8, options := DEFAULT_PARSE_OPTION if !numerus_found { break } - numerus := ts.elements[numerus_id] - section[source.value][num_plurals] = strings.intern_get(&translation.intern, numerus.value) + numerus := strings.intern_get(&translation.intern, ts.elements[numerus_id].value) + section[source][num_plurals] = numerus num_plurals += 1 } } else { // Single translation - section[source.value] = make([]string, 1) - section[source.value][0] = strings.intern_get(&translation.intern, xlat.value) + section[source] = make([]string, 1) + section[source][0] = xlat } nth += 1 diff --git a/tests/core/Makefile b/tests/core/Makefile index 2e1e4f78d..5c2918e30 100644 --- a/tests/core/Makefile +++ b/tests/core/Makefile @@ -2,7 +2,7 @@ ODIN=../../odin PYTHON=$(shell which python3) all: download_test_assets image_test compress_test strings_test hash_test crypto_test noise_test encoding_test \ - math_test linalg_glsl_math_test filepath_test reflect_test os_exit_test + math_test linalg_glsl_math_test filepath_test reflect_test os_exit_test i18n_test download_test_assets: $(PYTHON) download_assets.py