Hi.
Currently porting an iPhone application to Android. I've encountered an issue that I haven't been able to overcome.
On the iPhone, translating your text is trivial. Put all your strings/text in Localizable.strings in the format: "sentence to translate" = "sentence translated"
The original string can contain any characters of any type.
Trying to reproduce something similar on Android, in the strings.xml I added all keys like: sentence translated
Then I was hoping to do something like:
int resID = getResources().getIdentifier(tmp, "strings", "com.name.app_name");
where tmp contains the string.
Once I get the resID, I can get the translated string with findresourcebyId.
Unfortunately, found out that it ain't so easy. The name of the string can't contain space, can't start with a digit and so on.
Eclipse doesn't show me anything, but when trying to run the code, I simply get a "Your project contains errors. Please fix them before running your application" and that's it. Can't see anything in the error log etc..
So, what are the restrictions in the name of a resource on Android. Or is there a way to circumvent it and easily replace one string with another. I'd like to keep the original dictionary of text I was using on the iPhone to keep things simple and not introduce any unnecessary errors.
Thanks