ya, great, thanks, this works for me ! :

                Resources res = getResources();
                DisplayMetrics dm = res.getDisplayMetrics();
                Configuration conf = res.getConfiguration();
                conf.locale = Locale.GERMANY;
                res.updateConfiguration(conf, dm);
                firstline= res.getString(R.string.firstline);


On Jan 26, 9:09 pm, Dianne Hackborn <hack...@android.com> wrote:
> You can't just modify the structure, you need to give a new Configuration of
> new values to Resources.updateConfiguration().
>
> On Mon, Jan 26, 2009 at 11:21 AM, deepdr...@googlemail.com <
>
>
>
> deepdr...@googlemail.com> wrote:
>
> > I tried :
>
> >                Resources res = getResources();
> >                res.getConfiguration().locale = Locale.GERMANY;
> >                firstline= res.getString(R.string.firstline);
>
> > in my onCreate() . But, although I do have res/values-de/strings.xml
> > this still gives me the english string for firstline.
> > So it seems to me that there's no easy way to test different languages
> > without an actual device for that language (?)
>
> > On Jan 24, 10:28 pm, Dianne Hackborn <hack...@android.com> wrote:
> > > This isn't really supported, though you can change the language of the
> > > Configuration used by your Resources object.  This will only impact your
> > own
> > > app, though, not things displayed by others like your notifications
> > (those
> > > will still use the system's locale).
>
> > > On Fri, Jan 23, 2009 at 10:39 PM, Raja Nagendra Kumar <
>
> > > nagendra.r...@gmail.com> wrote:
>
> > > > Hi Romain,
>
> > > > Thank You Romain, a follow up to this how do I change the default
> > > > languge to choose in my application based on the menu we provide with
> > > > in the andorid application..
> > > > I may still want to keep my phone locale some thing deferent than the
> > > > application locale.
>
> > > > Regards,
> > > > Nagendra
>
> > > > On Jan 24, 11:16 am, Romain Guy <romain...@google.com> wrote:
> > > > > Hi,
>
> > > > > All you need to do is place your resources in locale specific
> > > > > directories. For instance:
>
> > > > > res\
> > > > >   drawable-en\
> > > > >   values-fr\
> > > > >   layout-jp\
>
> > > > > In your example to localize the app in English and German, you would
> > > > have:
>
> > > > > res\
> > > > >   values\
> > > > >     strings.xml
> > > > >   values-de\
> > > > >     strings.xml
>
> > > > > And Android will automatically pick up the right strings.xml at
> > > > > runtime, depending on the locale. If you want to know more about
> > > > > resources and configurations, please readhttp://
> > > > code.google.com/android/devel/resources-i18n.html
>
> > > > > On Fri, Jan 23, 2009 at 10:10 PM, Raja Nagendra Kumar
>
> > > > > <nagendra.r...@gmail.com> wrote:
>
> > > > > > Is there any good example to show how a single compiled application
> > > > > > could support both english and say germany..
>
> > > > > > The aapt approach and Resource R.java approach seems to me that, we
> > > > > > may need to have one binary for english and one for germany
> > etc..and
> > > > > > so on..
>
> > > > > > Like in J2ME, could we switch the language at runtime..
>
> > > > > > Regards,
> > > > > > Raja Nagendra Kumar,
> > > > > > C.T.O
> > > > > >www.tejasoft.com
>
> > > > > --
> > > > > Romain Guy
> > > > > Android framework engineer
> > > > > romain...@android.com
>
> > > > > Note: please don't send private questions to me, as I don't have time
> > > > > to provide private support.  All such questions should be posted on
> > > > > public forums, where I and others can see and answer them- Hide
> > quoted
> > > > text -
>
> > > > > - Show quoted text -
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support.  All such questions should be posted on public
> > > forums, where I and others can see and answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to