%1$s informs that %2$s...">

Android string entries in different languages

I have a string with two placeholders, with XML:

<string name="message">%1$s informs that %2$s is not feeling well today.</string>

Since it %2$sis either "he" or "she", when translated into Portuguese, we should only have the first placeholder, that is, the name of the person:

<string name="message">%1$s informa que nรฃo se sente muito bem hoje.</string>

The code compiles and works fine, but Lint complains that the String.format string does not match the XML format string

What is the best way to deal with these situations?

+4
source share
2 answers

Lint , . placeholder , , . , , .

+2
<string name="message">%1$s informa que nรฃo %2$s sente muito bem hoje.</string>

%2$s "se" ... "se":)

+2

Source: https://habr.com/ru/post/1608825/


All Articles