Can someone please explain the xliff:g
for strings/localization.
I understand that xliff:g
is not supposed to translate anything inside the <>
things, but I'm confused how exactly I'd use this in code.
An example I have in my case is the practice spanish translations that I have has:
<string name="order_quantity">Cantidad: <xliff:g id="quantity" example="2">%d/xliff:g</string>
I am now trying to get localized strings with xliff:g
to work.
What is id
here and what does it do? And what does it call?
Also what is the %d
and what does it do? What is the point of example
? Also, how would I call that into code, if at all?
Why can't someone just do the following code to insert the following xml:
<string name="quant">Quantity: </string>
into java like so:
getString(R.string.quant) + quantity
so that way it concactenates the quantity variable into the getString
?