Post #58: Godot’s Pluralization
To extend on top of yesterday’s post abut internationalization, Godot supports “pluralization”.
For example, take this code snippet from the docs:
var num_apples = 5
label.text = tr_n("There is %d apple", "There are %d apples", num_apples) % num_apples
When you need to change grammar based on context, to decide if certain words need to be plural or not, you can rely on Godot’s built in pluralization support to help! This is much cleaner and more consistent than adding a bunch of if statements to check if a number is 1 or not, and changing the grammar based on it.