mahetab / wiktionary-android

Automatically exported from code.google.com/p/wiktionary-android
0 stars 0 forks source link

Issues with strings xml in the SimpleWiktionary #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The Lines
 <string name="template_user_agent">"%s/%s (Linux; Android)"</string>
and 
 <string name="template_wotd_title">"Wiktionary:Word of the day/%s %s"</string>

make eclipse say:

Multiple annotations found at this line:
    - error: Multiple substitutions specified in non-positional format; did you mean to add 
     the formatted="false" attribute?
    - error: Unexpected end tag string

if the double "%s/%s" is reduced to only "%s" the error does vanish... don't 
know if the widget still works then because I don't yet fully understand the 
code.

Original issue reported on code.google.com by lukes...@gmail.com on 18 Oct 2011 at 7:32

GoogleCodeExporter commented 8 years ago
it's also possible to solve with actaully adding the formatted="false" field to 
the declarations but i think that this is also wrong...
.
.
.
    <string name="template_user_agent" formatted="false" >"%s/%s (Linux; Android)"</string>
    <string name="template_wotd_title" formatted="false" >"Wiktionary:Word of the day/%s %s"</string>
.
.
.

Original comment by eladk...@gmail.com on 17 Dec 2011 at 5:13

GoogleCodeExporter commented 8 years ago
use %1$s/%2$s instead %s/%s.
http://developer.android.com/guide/topics/resources/string-resource.html

Original comment by praveen....@gmail.com on 22 Jun 2012 at 8:14