Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:09:05+00:00 2026-05-17T15:09:05+00:00

Currently porting an iPhone application to Android. I’ve encountered an issue that I haven’t

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:09:05+00:00Added an answer on May 17, 2026 at 3:09 pm

    You basically just create a new values directory for every language you want to support using following naming pattern values-en for English localization and so on. It uses the two-letter ISO 639-1 standard.

    Now in every language values directory you have your strings.xml. In this XML file every string has its own ID and its value (translated string). The IDs are the same in every strings.xml in the different language directories just the string content differs.

    For an in depth read in this I recommend the Localization article on the Android developers site.

    EDIT: You can only use uppercase, lowercase, numbers and underscores as a string identifier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently porting an application to Windows Phone 7 I've encountered a problem that should
I am currently porting an application from iOS into Android and I have ran
I'm currently porting a heap of code that has previously only been compiled with
We have a xib that was currently designed for the iPhone. We are porting
im currently porting my iphone app to android. this app makes heavy use of
I'm currently porting an application from iPhone to Windows Phone. The behaviour of buttons
I'm currently porting my jruby/java2d Graph Drawing/Layouting application to macruby/cocoa. Therefore I need to
I'm porting my application from 32 bit to 64 bit. Currently, the code compiles
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
I am currently involved in porting a large and complicated VBA application to .NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.