Files
armorpaint/Sources/arm/Locale.hx
T
2020-03-18 20:26:28 +01:00

17 lines
374 B
Haxe

package arm;
class Locale {
// Localize a string with the given placeholders replaced (format is `{placeholderName}`).
// TODO: Implement localization support.
public static function tr(id: String, ?vars: Map<String, Dynamic>): String {
if (vars != null) {
for (key => value in vars) {
id = id.replace('{$key}', Std.string(value));
}
}
return id;
}
}