Facepunch / sbox-issues

178 stars 12 forks source link

Resolving localization tokens manually #3938

Open BttrDrgn opened 1 year ago

BttrDrgn commented 1 year ago

What it is?

When using localization tokens as directed, ex: "#spawnmenu.props", it works as expected, it will resolve the token and print the string from the localization json.

However, trying to utilizing a token mid string results in the text and the token itself, not resolved, being printed, ex: "Hello #spawnmenu.props" will print "Hello #spawnmenu.props", and there is no way to utilize localization token outputs without resulting to reading the localization json manually.

What should it be?

Perhaps a useful addition to the Sandbox.Localization namespace could be some form of manual resolving method of a token to get the string so a user can use the output however they see fit; automatically using the detected localization language with optional manual language.

BttrDrgn commented 1 year ago

Possible duplicate of #3533

Bilbard commented 2 weeks ago

Please. I want to localize my game, but without something like this it is impossible to do efficiently.