Jump to content

PS syntax


Recommended Posts

They are v1.5 translation dynamic data place holders, modeled after PHP's sprintf. Where you see d an integer is expected and s, a string. The "%d" and "%s" you see will be dynamically populated during the output of the expression, so do not remove them from the translation. Changing their position within the translated expression is OK. E.g. "there are %d items in the cart" => "pu'chaj buSlaH ngotlhwI %d'; translated into Klingon. Read to be translated expression as if it contains a number and then replace that number with %d in translated expression. Likewise for 's'

Edited by phrasespot (see edit history)
  • Like 1
Link to comment
Share on other sites

They are v1.5 translation dynamic data place holders, modeled after PHPs sprintf. Where you see d an integer is expected and s, a string. The "%d" and "%s" you see will be dynamically populated during the output of the expression, so do not remove them from the translation. Changing their position within the translated expression is OK. E.g. "there are %d items in the cart" => "pu'chaj buSlaH ngotlhwI %d'; translated into Klingon

So, if I understand you correctly, %d used for integer number and %s for any string?

And what is %1$s?

Link to comment
Share on other sites

Argument swapping/position specifier. But at least have the courtesy of looking at the documentation link I posted before asking another question. It is all explained there in detail. %1$s is the first place holder that is a string. %2$s, the second and so on. There is more to it. It will be to your benefit to read the documentation.

Edited by phrasespot (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...