Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Android apps for Irish speakers

Options
  • 05-02-2013 11:40am
    #1
    Registered Users Posts: 749 ✭✭✭


    Hi, I've had a request to provide my Android app in Irish and was wondering if anyone here has had any experience with doing this. I know some Samsung devices have Gaeilge as a selectable language but I'm not sure how extensive this is. Usually apps provide different languages by providing different xml resource files for that locale. However for users that don't have this language option but want to use my app in Irish this approach won't work (I think). So my questions are:

    1) For phones that support Gaeilge, what should the xml file be named so that it will be chosen at runtime?
    2) For phones that don't support Gaeilge, is there an easy way to switch between the two xml files at runtime?


Comments

  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Below presumes that the device supports Irish-Gaelic, which I believe is dependant on the OS version. The answer to question 2 may also effectively 'force' support in earlier versions, but I'd have to test it to see if it does - otherwise you'd probably have to write a big dirty hack for this purpose.
    smackyB wrote: »
    1) For phones that support Gaeilge, what should the xml file be named so that it will be chosen at runtime?
    Exactly the same as your default values resource file(s), and, however, instead of sitting in the res/values directory, it should sit in a res/values-ga directory.
    2) For phones that don't support Gaeilge, is there an easy way to switch between the two xml files at runtime?
    Your code would look something like this:
    Configuration config = new Configuration();
    Resources res = getResources();
    Locale = new Locale("ga");
    config.locale = locale;
    res.updateConfiguration(config, res.getDisplayMetrics());
    
    Of course, I wouldn't advise you to cut and paste the above anywhere, but it'll give you an idea of what's involved. Better you look at localization as a topic in the Android dev site.


  • Registered Users Posts: 749 ✭✭✭smackyB


    Savage, thanks!


Advertisement