Skip to content

Plural translation does not work with tr_n() and CSV translation IDs #101464

@LavandePotions

Description

@LavandePotions

Tested versions

v4.3.stable.flathub [77dcf97]

System information

Pop!_OS 22.04 LTS

Issue description

tr_n() always return Singular Translation even when number_of_coins is superior to 1.

e.g.

# This work
#%BasicLabel.text = tr_n("single coin", "more coins", number_of_coins)
	
# This does not
%BasicLabel.text = tr_n("COIN_LABEL_SINGULAR", "COIN_LABEL_PLURAL", number_of_coins)

Steps to reproduce

In a new project :

  1. Add a CSV file with at least two lines (one singular, one plural).
LABEL_SINGULAR,one
LABEL_PLURAL,many
  1. Open menu Project -> project settings... -> Localization and import .translation files.
  2. Use tr_n() with Singular and Plural Keys.
var tr_string = tr_n("LABEL_SINGULAR", "LABEL_PLURAL", 2)
  1. It will always use the Singular key whatever the int value is...

Minimal reproduction project (MRP)

link to the repo
lpGodot_tr_n_issue

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions