android-developers
[Arriba] [Todas las Listas]

[android-developers] Qué es la manera mejor de cambiar la lengua de mi

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: [android-developers] Qué es la manera mejor de cambiar la lengua de mi app en runtime?
From: Sergio Bra <sergio.bra88@xxxxxxxxx>
Date: Sat, 5 Aug 2017 08:20:39 -0700 (PDT)
Delivery-date: Sat, 05 Aug 2017 11:21:59 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=l732JsIIxvBUxwYgghv8u/GlusJHvyU0s72Y4sukfLk=; b=XUNp4NO8jiwqwnQFvybhbroLKa8HY+2TpBlFWynLdxDYHNeqrvlbukzgo4tUaE8emt 4VbVckPWvePeTtutqTLj/W21/kVRd7Tqyv66p7QykQFNGVMTj+vB6hMh8mSXBPloy1qY Gj8sfcQFFN8GefBpJpdLhNDZLvj0RBc8kkZtoZoL8Ssx/fkTpgq2vpMSOBDKRxrvDx7c jGRxh1W4t1INaVSQR3m2bsssseDc7jcB6ciRUwDeTa1V5/JIx/+KkW+o6QcFGYNaDOaw zCIJqlgaD1B/jAJqrzVMPVWTPcIu+/i1BVDukPF70XvTRslzwq7MFwKXXLT6vYDGoSnk ZIsQ==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=l732JsIIxvBUxwYgghv8u/GlusJHvyU0s72Y4sukfLk=; b=uQHk4iCdQTcBxlGpKyfKKVHgV1MsYpOCXyp8guHytcEx2xuwUW70kM+O0Blvxa9lNV 1sgQ0zyH48Wt/uss/kM454yK6wz8hALTseM7Cab8kPoFJyZCf7JvUcm8VF0aQp0q2wl8 xEg2eqgQB0f/6IH+BpxaBcO41Um3WyC3hJKAlUKE6A7sPW5PnwN3WFS2GoH5xsj8mdcP oM+fhIQZIXVRMQi2Wa9/TFQvQ29CQQOTwspgZ8uUTRgZJJaFaPGCtH/olNvQBALwKT6H ECuCF5bgNWbmX/pLGdf+N+QCkSAhYHPlZubcS5w5CPD0ooAwkThdIqXVUp6MhYZlVPjx pxUQ==
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <https://groups.google.com/group/android-developer>
List-help: <https://groups.google.com/support/>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <https://groups.google.com/group/android-developers/post>, <mailto:android-developers@googlegroups.com>
List-subscribe: <https://groups.google.com/group/android-developers/subscribe>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <mailto:googlegroups-manage+364598216046+unsubscribe@googlegroups.com>, <https://groups.google.com/group/android-developers/subscribe>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
*Hi, estoy desarrollando un *app y añadí un *settings pantalla para dejar usuarios para 
cambiar la lengua de las cadenas *literals del *app.

En el *onCreate método de las actividades utilizo el siguiendo código:

*SharedPreferences *settings = *getSharedPreferences(*PREFS_ARCHIVO, 0);
lengua de Cadena = *settings.*getString(*PREF_LENGUA, "*en");

*Locale *locale = nuevo *Locale(lengua);
*Locale.*setDefault(*locale);

Configuración *config = Configuración nueva();

*config.*locale = *locale;

*getResources().*updateConfiguration(*config, *getResources().*getDisplayMetrics());


Pero *config.*locale Y *getResources().*updateConfiguration Es *deprecated. 
Cómo tener que implemento que funcionalidad?

*Thanks Anticipadamente

-- 
recibiste este mensaje porque eres *subscribed al *Google Grupos "*Android *Developers" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx.
Visita este grupo en *https://grupos.*google.*com/Grupo/*android-*developers.
Para ver esta discusión en la visita de web *https://grupos.*google.*com/*d/*msgid/*android-*developers/*d149*b1*f9-64*e2-4*b8*d-8944-*dada7*e7*b9*c12%40*googlegroups.*com.
Para más opciones, visita *https://grupos.*google.*com/*d/*optout.
Hi, I'm developing an app and I added a settings screen to allow users to 
change the language of the strings literals of the app.

In the onCreate method of the activities I use the following code:

SharedPreferences settings = getSharedPreferences(PREFS_FILE, 0);
String language = settings.getString(PREF_LANGUAGE, "en");

Locale locale = new Locale(language);
Locale.setDefault(locale);

Configuration config = new Configuration();

config.locale = locale;

getResources().updateConfiguration(config, getResources().getDisplayMetrics());


but config.locale and getResources().updateConfiguration are deprecated. 
How should I implement that functionality?

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/d149b1f9-64e2-4b8d-8944-dada7e7b9c12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Anterior por Tema] Tema Actual [Siguiente por Tema>
  • [android-developers] Qué es la manera mejor de cambiar la lengua de mi app en runtime?, Sergio Bra <=