From ec7e75a57fc6376242089c7747203ac630c9bc1a Mon Sep 17 00:00:00 2001 From: "Maurizio M. Gavioli" Date: Fri, 19 Apr 2024 08:23:28 +0200 Subject: [PATCH] Fix #3451 - `core:text/i18n` default `number` value in `get_*_section` proc. In the to procs `get_single_section()` and `get_by_section()` the `number` parameter should have a default of `1` rather than `0`. See the issue for more details. --- core/text/i18n/i18n.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/text/i18n/i18n.odin b/core/text/i18n/i18n.odin index 151f9e129..64593c4e8 100644 --- a/core/text/i18n/i18n.odin +++ b/core/text/i18n/i18n.odin @@ -90,7 +90,7 @@ DEFAULT_PARSE_OPTIONS :: Parse_Options{ - get(key, number), which returns the appropriate plural from the active catalog, or - get(key, number, catalog) to grab text from a specific one. */ -get_single_section :: proc(key: string, number := 0, catalog: ^Translation = ACTIVE) -> (value: string) { +get_single_section :: proc(key: string, number := 1, catalog: ^Translation = ACTIVE) -> (value: string) { /* A lot of languages use singular for 1 item and plural for 0 or more than 1 items. This is our default pluralize rule. */ @@ -108,7 +108,7 @@ get_single_section :: proc(key: string, number := 0, catalog: ^Translation = ACT - get(section, key, number), which returns the appropriate plural from the active catalog, or - get(section, key, number, catalog) to grab text from a specific one. */ -get_by_section :: proc(section, key: string, number := 0, catalog: ^Translation = ACTIVE) -> (value: string) { +get_by_section :: proc(section, key: string, number := 1, catalog: ^Translation = ACTIVE) -> (value: string) { /* A lot of languages use singular for 1 item and plural for 0 or more than 1 items. This is our default pluralize rule. */