Browse Source

[i18n] Enable *nix tests again.

Jeroen van Rijn 3 years ago
parent
commit
9c9c2b483c
2 changed files with 10 additions and 10 deletions
  1. 9 9
      core/text/i18n/qt_linguist.odin
  2. 1 1
      tests/core/Makefile

+ 9 - 9
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

+ 1 - 1
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