[i18n] Move to core:text/i18n.

This commit is contained in:
Jeroen van Rijn
2022-04-29 13:02:40 +02:00
parent 1289c96e2c
commit 2e11a8da5b
7 changed files with 3 additions and 2 deletions
@@ -2,7 +2,7 @@ package i18n_example
import "core:mem" import "core:mem"
import "core:fmt" import "core:fmt"
import "core:i18n" import "core:text/i18n"
_T :: i18n.get _T :: i18n.get
@@ -31,6 +31,7 @@ mo :: proc() {
/* /*
For ease of use, pluralized lookup can use both singular and plural form as key for the same translation. For ease of use, pluralized lookup can use both singular and plural form as key for the same translation.
This is a quirk of the GetText format which has separate keys for their different plurals.
*/ */
println("-----") println("-----")
printf(_T("There is %d leaf.\n", 1), 1) printf(_T("There is %d leaf.\n", 1), 1)
@@ -54,7 +55,7 @@ qt :: proc() {
/* /*
Parse QT file and set it as the active translation so we can omit `get`'s "catalog" parameter. Parse QT file and set it as the active translation so we can omit `get`'s "catalog" parameter.
*/ */
i18n.ACTIVE, err = i18n.parse_qt(#load("../../../tests/core/assets/XML/nl_NL-qt-ts.ts")) i18n.ACTIVE, err = i18n.parse_qt(#load("../../../../tests/core/assets/XML/nl_NL-qt-ts.ts"))
defer i18n.destroy() defer i18n.destroy()
fmt.printf("parse_qt returned %v\n", err) fmt.printf("parse_qt returned %v\n", err)