You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not really python-like, but inspired by it and by #18 of course.
First of all instead of capsing, like DID_DMG_HITS, we can use some default translation text (e.g. english text).
Secondly instead of %L we can use function style: L(player, "He did {damage:d} damage to you with {hits:d} hit(s)\nand still has {health:d}hp and {armor:d}ap.")
This simplifies localization process of plugin that doesn't support it. Look:
Format("He did {damage:d} damage to you with {hits:d} hit(s)\nand still has {health:d}hp and {armor:d}ap."
, FmtArg("damage", damage)
, FmtArg("hits", hits)
, FmtArg("health", player.Health)
, FmtArg("armor", player.Armor)
);
Becomes:
Format(L(player, "He did {damage:d} damage to you with {hits:d} hit(s)\nand still has {health:d}hp and {armor:d}ap.")
, FmtArg("damage", damage)
, FmtArg("hits", hits)
, FmtArg("health", player.Health)
, FmtArg("armor", player.Armor)
);
Just adding L(player, and )!
TODO:
Plurals
SetLanguageContext(player); to remove repetitive player's index in L for localized arguments or using last passed player's index if it isn't passed
Translation file auto-creation, on runtime or maybe some source code analyze tool
FMTARG macro that will expand FMTARG(var) to FmtArg("var", var)
Something that i forgot or don't know about python-like localization
The text was updated successfully, but these errors were encountered:
Not really python-like, but inspired by it and by #18 of course.
First of all instead of capsing, like
DID_DMG_HITS
, we can use some default translation text (e.g. english text).Secondly instead of
%L
we can use function style:L(player, "He did {damage:d} damage to you with {hits:d} hit(s)\nand still has {health:d}hp and {armor:d}ap.")
This simplifies localization process of plugin that doesn't support it. Look:
Becomes:
Just adding
L(player,
and)
!TODO:
SetLanguageContext(player);
to remove repetitive player's index inL
for localized arguments or using last passed player's index if it isn't passedFMTARG
macro that will expandFMTARG(var)
toFmtArg("var", var)
The text was updated successfully, but these errors were encountered: