1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

added a setting for language, overriding the system locale settings

Update issue 1290
This commit is contained in:
Thialfihar 2010-07-09 00:27:47 +00:00
parent f74e7dd249
commit 67b23fc797
11 changed files with 339 additions and 14 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="2903"
android:versionName="2.903" package="com.fsck.k9">
<uses-sdk
@ -7,9 +8,10 @@
android:targetSdkVersion="4"
/>
<supports-screens
largeScreens="true"
normalScreens="true"
smallScreens="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
@ -44,6 +46,7 @@
<activity
android:name="com.fsck.k9.activity.Accounts"
android:launchMode="singleInstance"
android:configChanges="locale"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -55,68 +58,81 @@
<activity
android:name="com.fsck.k9.activity.setup.Prefs"
android:label="@string/prefs_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.FontSizeSettings"
android:label="@string/font_size_settings_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupBasics"
android:label="@string/account_setup_basics_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupAccountType"
android:label="@string/account_setup_account_type_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupIncoming"
android:label="@string/account_setup_incoming_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupComposition"
android:label="@string/account_settings_composition_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupOutgoing"
android:label="@string/account_setup_outgoing_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupOptions"
android:label="@string/account_setup_options_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupNames"
android:label="@string/account_setup_names_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.ChooseFolder"
android:theme="@style/Theme.K9Dialog"
android:label="@string/choose_folder_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.ChooseIdentity"
android:theme="@style/Theme.K9Dialog"
android:label="@string/choose_identity_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.ManageIdentities"
android:label="@string/manage_identities_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.EditIdentity"
android:label="@string/edit_identity_title"
android:configChanges="locale"
>
</activity>
<!-- XXX Note: this activity is hacked to ignore config changes,
@ -124,12 +140,13 @@
<activity
android:name="com.fsck.k9.activity.setup.AccountSetupCheckSettings"
android:label="@string/account_setup_check_settings_title"
android:configChanges="keyboardHidden|orientation"
android:configChanges="keyboardHidden|orientation|locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.setup.AccountSettings"
android:label="@string/account_settings_title_fmt"
android:configChanges="locale"
>
</activity>
@ -137,12 +154,14 @@
android:name="com.fsck.k9.activity.setup.FolderSettings"
android:theme="@android:style/Theme.Dialog"
android:label="@string/folder_settings_title"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.FolderList"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:configChanges="locale"
>
<intent-filter>
<!-- This action is only to allow an entry point for launcher shortcuts -->
<action android:name="android.intent.action.MAIN" />
@ -150,11 +169,15 @@
</activity>
<activity
android:name="com.fsck.k9.activity.MessageList"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:configChanges="locale"
>
</activity>
<activity
android:name="com.fsck.k9.activity.MessageView"
android:theme="@android:style/Theme.Light">
android:theme="@android:style/Theme.Light"
android:configChanges="locale"
>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
@ -168,6 +191,7 @@
android:name="com.fsck.k9.activity.MessageCompose"
android:label="@string/app_name"
android:enabled="false"
android:configChanges="locale"
>
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
@ -194,6 +218,7 @@
<!-- Search Activity - searchable -->
<activity android:name="com.fsck.k9.activity.Search"
android:label="@string/search_action"
android:configChanges="locale"
>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
@ -202,8 +227,11 @@
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<activity android:name="com.fsck.k9.activity.LauncherShortcuts"
android:label="@string/shortcuts_title">
<activity
android:name="com.fsck.k9.activity.LauncherShortcuts"
android:label="@string/shortcuts_title"
android:configChanges="locale"
>
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT" />
<category android:name="android.intent.category.DEFAULT" />

197
res/values-es/strings.xml Normal file
View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="account_delete_dlg_instructions_fmt">La cuenta \"<xliff:g id="account">%s</xliff:g>\" se eliminará del Correo electrónico.</string>
<string name="account_delete_dlg_title">Quitar</string>
<string name="account_settings_action">Configuración de la cuenta</string>
<string name="account_settings_add_account_label">Agregar otra cuenta</string>
<string name="account_settings_default_label">Cuenta predeterminada</string>
<string name="account_settings_default_summary">Enviar correo electrónico desde esta cuenta por defecto</string>
<string name="account_settings_description_label">Nombre de cuenta</string>
<string name="account_settings_incoming_label">Configuración entrante</string>
<string name="account_settings_incoming_summary">Configurar el servidor de correo entrante</string>
<string name="account_settings_mail_check_frequency_label">Frecuencia de comprobación del correo electrónico</string>
<string name="account_settings_name_label">Nombre</string>
<string name="account_settings_notify_label">Notificaciones de correo electrónico</string>
<string name="account_settings_notify_summary">Notificar en la barra de estado cuando llegue un correo electrónico</string>
<string name="account_settings_outgoing_label">Configuración saliente</string>
<string name="account_settings_outgoing_summary">Configurar el servidor de correo saliente</string>
<string name="account_settings_show_combined_label">Mostrar bandeja de entrada combinada</string>
<string name="account_settings_title_fmt">Configuración de la cuenta</string>
<string name="account_setup_account_type_imap_action">Cuenta IMAP </string>
<string name="account_setup_account_type_instructions">¿Qué tipo de cuenta es ésta?</string>
<string name="account_setup_account_type_pop_action">Cuenta POP3</string>
<string name="account_setup_account_type_title">Agregar nueva cuenta de correo electrónico</string>
<string name="account_setup_basics_default_label">Enviar correo electrónico desde esta cuenta por defecto. </string>
<string name="account_setup_basics_email_error_duplicate_fmt"><xliff:g id="email">%s</xliff:g> ya se ha agregado.</string>
<string name="account_setup_basics_email_error_invalid_fmt"><xliff:g id="email">%s</xliff:g> no es una dirección de correo válida.</string>
<string name="account_setup_basics_email_hint">Dirección de correo electrónico</string>
<string name="account_setup_basics_instructions">Introduzca su dirección de correo electrónico:</string>
<string name="account_setup_basics_instructions2_fmt">(Puede agregar <xliff:g id="number_accounts">%d</xliff:g> más cuentas).</string>
<string name="account_setup_basics_manual_setup_action">Configuración manual</string>
<string name="account_setup_basics_password_hint">Contraseña</string>
<string name="account_setup_basics_title">Configuración de correo electrónico</string>
<string name="account_setup_check_settings_canceling_msg">Cancelar\u2026</string>
<string name="account_setup_check_settings_check_incoming_msg">Comprobar configuración del servidor entrante\u2026</string>
<string name="account_setup_check_settings_check_outgoing_msg">Comprobar configuración del servidor saliente\u2026</string>
<string name="account_setup_check_settings_finishing_msg">Finalizar\u2026</string>
<string name="account_setup_check_settings_retr_info_msg">Recuperar información de la cuenta\u2026</string>
<string name="account_setup_failed_dlg_auth_message_fmt">Nombre de usuario o contraseña incorrecto.\n(<xliff:g id="error">%s</xliff:g>)</string>
<string name="account_setup_failed_dlg_certificate_message_fmt">No se puede conectar de forma segura con el servidor.\n(<xliff:g id="error">%s</xliff:g>)</string>
<string name="account_setup_failed_dlg_edit_details_action">Editar detalles</string>
<string name="account_setup_failed_dlg_server_message_fmt">No se puede conectar al servidor.\n(<xliff:g id="error">%s</xliff:g>)</string>
<string name="account_setup_failed_dlg_title">La configuración no pudo finalizar</string>
<string name="account_setup_finished_toast">¡Su cuenta ya está configurada!\n\nRecuperar correo electrónicol\u2026</string>
<string name="account_setup_incoming_delete_policy_7days_label">Después de 7 días</string>
<string name="account_setup_incoming_delete_policy_delete_label">Al eliminar de la bandeja de entrada</string>
<string name="account_setup_incoming_delete_policy_label">Eliminar correo electrónico del servidor:</string>
<string name="account_setup_incoming_delete_policy_never_label">Nunca</string>
<string name="account_setup_incoming_imap_path_prefix_hint">Opcional</string>
<string name="account_setup_incoming_imap_path_prefix_label">Prefijo de ruta IMAP</string>
<string name="account_setup_incoming_imap_server_label">Servidor IMAP</string>
<string name="account_setup_incoming_password_label">Contraseña</string>
<string name="account_setup_incoming_pop_server_label">Servidor POP3 </string>
<string name="account_setup_incoming_port_label">Puerto</string>
<string name="account_setup_incoming_security_label">Tipo de seguridad</string>
<string name="account_setup_incoming_security_none_label">Ninguno</string>
<string name="account_setup_incoming_security_ssl_label">SSL (siempre)</string>
<string name="account_setup_incoming_security_ssl_optional_label">SSL (si está disponible)</string>
<string name="account_setup_incoming_security_tls_label">TLS (siempre)</string>
<string name="account_setup_incoming_security_tls_optional_label">TLS (de estar disponible)</string>
<string name="account_setup_incoming_title">Configuración del servidor entrante</string>
<string name="account_setup_incoming_username_label">Nombre de usuario</string>
<string name="account_setup_names_account_name_label">Asigne un nombre a esta cuenta (opcional):</string>
<string name="account_setup_names_instructions">Su cuenta se ha configurado y su correo electrónico ya está listo. </string>
<string name="account_setup_names_title">Configuración de correo electrónico</string>
<string name="account_setup_names_user_name_label">Introduzca su nombre (a mostrar en los mensajes salientes):</string>
<string name="account_setup_options_default_label">Enviar correo electrónico desde esta cuenta por defecto. </string>
<string name="account_setup_options_mail_check_frequency_10min">Cada 10 minutos</string>
<string name="account_setup_options_mail_check_frequency_15min">Cada 15 minutos</string>
<string name="account_setup_options_mail_check_frequency_1hour">Cada hora</string>
<string name="account_setup_options_mail_check_frequency_30min">Cada 30 minutos</string>
<string name="account_setup_options_mail_check_frequency_5min">Cada 5 minutos</string>
<string name="account_setup_options_mail_check_frequency_label">Frecuencia de comprobación del correo electrónico</string>
<string name="account_setup_options_mail_check_frequency_never">Nunca</string>
<string name="account_setup_options_notify_label">Avisarme cuando lleguen correos electrónicos.</string>
<string name="account_setup_options_title">Opciones de la cuenta</string>
<string name="account_setup_outgoing_authentication_basic_label">Nombre de usuario y contraseña</string>
<string name="account_setup_outgoing_authentication_basic_password_label">Contraseña</string>
<string name="account_setup_outgoing_authentication_basic_username_label">Nombre de usuario</string>
<string name="account_setup_outgoing_authentication_imap_before_smtp_label">IMAP antes de SMTP</string>
<string name="account_setup_outgoing_authentication_label">Tipo de autenticación</string>
<string name="account_setup_outgoing_authentication_pop_before_smtp_label">POP antes de SMTP</string>
<string name="account_setup_outgoing_password_label">Contraseña</string>
<string name="account_setup_outgoing_port_label">Puerto</string>
<string name="account_setup_outgoing_require_login_label">Hace falta iniciar sesión.</string>
<string name="account_setup_outgoing_security_label">Tipo de seguridad</string>
<string name="account_setup_outgoing_security_none_label">Ninguno</string>
<string name="account_setup_outgoing_security_ssl_label">SSL</string>
<string name="account_setup_outgoing_security_tls_label">TLS (siempre)</string>
<string name="account_setup_outgoing_security_tls_optional_label">TLS (de estar disponible)</string>
<string name="account_setup_outgoing_smtp_server_label">Servidor SMTP</string>
<string name="account_setup_outgoing_title">Configuración del servidor saliente</string>
<string name="account_setup_outgoing_username_label">Nombre de usuario</string>
<string name="accounts_action">Cuentas</string>
<string name="accounts_context_menu_title">Opciones de la cuenta</string>
<string name="accounts_title">Sus cuentas</string>
<string name="accounts_welcome">¡Bienvenido a la configuración del correo electrónico!\n\nUtilice cualquier cuenta con correo electrónico.\n\n¡Las cuentas de correo electrónico más habituales se pueden crear en 2 pasos!</string>
<string name="add_account_action">Agregar cuenta</string>
<string name="add_attachment_action">Agregar datos adjuntos</string>
<string name="add_cc_bcc_action">Agregar CC/CCO</string>
<string name="app_name">Correo electrónico</string>
<string name="cancel_action">Cancelar</string>
<string name="combined_inbox_label">Mensajes recientes desde todas las cuentas</string>
<string name="combined_inbox_list_title">Todos los correos de la bandeja de entrada</string>
<string name="combined_inbox_title">Todos los correos electrónicos</string>
<string name="compose_action">Redactar</string>
<string name="compose_title">Redactar</string>
<string name="continue_action">Continuar</string>
<string name="debug_title">Depuración</string>
<string name="debug_version_fmt">Versión: <xliff:g id="version">%s</xliff:g></string>
<string name="delete_action">Eliminar</string>
<string name="discard_action">Rechazar</string>
<string name="done_action">Listo</string>
<string name="dump_settings_action">Configuración de volcado</string>
<string name="edit_subject_action">Editar asunto</string>
<string name="empty_trash_action">Vaciar papelera</string>
<string name="folders_action">Carpetas</string>
<string name="forward_action">Desvío</string>
<string name="general_no_subject">(Sin asunto)</string>
<string name="mailbox_select_dlg_new_mailbox_action">Nueva carpeta</string>
<string name="mailbox_select_dlg_title">Carpetas</string>
<string name="mark_as_read_action">Marcar como leído</string>
<string name="mark_as_unread_action">Marcar como no leído</string>
<string name="message_compose_attachments_skipped_toast">Hay algunos datos adjuntos que no se pueden reenviar porque no se han descargado.</string>
<string name="message_compose_bcc_hint">CCO</string>
<string name="message_compose_cc_hint">CC</string>
<string name="message_compose_downloading_attachments_toast">Hay algunos datos adjuntos que no se han descargado. Se descargarán automáticamente antes de que se envíe este mensaje.</string>
<string name="message_compose_error_no_recipients">Debe agregar al menos un destinatario.</string>
<string name="message_compose_fwd_header_fmt">\n\n-------- Mensaje original --------\nAsunto: <xliff:g id="subject">%s</xliff:g>\nDe: <xliff:g id="sender">%s</xliff:g>\nPara: <xliff:g id="to">%s</xliff:g>\nCC: <xliff:g id="cc">%s</xliff:g>\n\n</string>
<string name="message_compose_quoted_text_label">Texto citado</string>
<string name="message_compose_reply_header_fmt">\n\n<xliff:g id="sender">%s</xliff:g> escribió:\n\n</string>
<string name="message_compose_subject_hint">Asunto</string>
<string name="message_compose_to_hint">Para</string>
<string name="message_copied_toast">Mensaje copiado.</string>
<string name="message_deleted_toast">Mensaje eliminado.</string>
<string name="message_discarded_toast">Mensaje rechazado.</string>
<string name="message_list_load_more_messages_action">Cargar más mensajes</string>
<string name="message_list_title_fmt"><xliff:g id="mailbox">%s</xliff:g> (<xliff:g id="message_count">%d</xliff:g>)</string>
<string name="message_moved_toast">Mensaje movido.</string>
<string name="message_saved_toast">Mensaje guardado como borrador.</string>
<string name="message_view_attachment_download_action">Guardar</string>
<string name="message_view_attachment_view_action">Abrir</string>
<string name="message_view_datetime_fmt">dd MMM aaaa hh:mm a</string>
<string name="message_view_fetching_attachment_toast">Recuperando datos adjuntos.</string>
<string name="message_view_prev_action">\u25BC</string>
<string name="message_view_next_action">\u25B2</string>
<string name="message_view_show_pictures_action">Mostrar imágenes</string>
<string name="message_view_show_pictures_instructions">Seleccione \"Mostrar imágenes\" para visualizar las imágenes integradas.</string>
<string name="message_view_status_attachment_not_saved">No se pueden guardar los datos adjuntos en una tarjeta SD.</string>
<string name="message_view_status_attachment_saved">Datos adjuntos guardados en tarjeta SD como <xliff:g id="filename">%s</xliff:g>.</string>
<string name="message_view_to_label">Para:</string>
<string name="move_to_action">Mover a</string>
<string name="new_mailbox_dlg_title">Nuevo nombre de carpeta</string>
<string name="next_action">Siguiente</string>
<string name="notification_new_multi_account_fmt">en <xliff:g id="number_accounts">%d</xliff:g> cuentas</string>
<string name="notification_new_one_account_fmt"><xliff:g id="unread_message_count">%d</xliff:g> Sin leer (<xliff:g id="account">%s</xliff:g>)</string>
<string name="notification_new_scrolling">Nuevo correo electrónico desde <xliff:g id="sender">%s</xliff:g></string>
<string name="notification_new_title">Nuevo correo</string>
<string name="notification_unsent_title">Mensaje no enviado</string>
<string name="okay_action">Aceptar</string>
<string name="open_action">Abrir</string>
<string name="preferences_action">Preferencias</string>
<string name="provider_note_live">Sólo algunas cuentas \"Plus\" incluyen acceso POP
que permite a este programa conectarse. Si no puede iniciar sesión con
su dirección de correo electrónico y su contraseña, quizá no tenga una cuenta
\"Plus\" pagada. Inicie el explorador Web para acceder a
estas cuentas de correo.</string>
<string name="provider_note_yahoo">Las cuentas gratuitas de Yahoo! Mail sólo funcionan a través de redes inalámbricas de T-Mobile. Los usuarios de Yahoo! Mail Plus deberían ajustar manualmente la configuración POP.</string>
<string name="read_action">Leído</string>
<string name="read_attachment_desc">Permite a esta aplicación leer los datos adjuntos del correo electrónico.</string>
<string name="read_attachment_label">leer datos adjuntos del correo electrónico</string>
<string name="refresh_action">Actualizar</string>
<string name="remove_account_action">Quitar cuenta</string>
<string name="remove_action">Quitar</string>
<string name="reply_action">Responder</string>
<string name="reply_all_action">Responder a todos</string>
<string name="retry_action">Reintentar</string>
<string name="save_draft_action">Guardar como borrador</string>
<string name="search_action">Buscar</string>
<string name="send_action">Enviar</string>
<string name="special_mailbox_name_drafts">Borradores</string>
<string name="special_mailbox_name_inbox">Bandeja de entrada</string>
<string name="special_mailbox_name_outbox">Bandeja de salida</string>
<string name="special_mailbox_name_sent">Enviado</string>
<string name="special_mailbox_name_trash">Papelera</string>
<string name="status_error">Error</string>
<string name="status_loading">Cargando\u2026</string>
<string name="status_loading_more">Cargando mensajes\u2026</string>
<string name="status_loading_more_failed">Reintentar la carga de más mensajes</string>
<string name="status_network_error">Error de conexión</string>
<string name="status_sending">Enviando\u2026</string>
<string name="view_hide_details_action">Ver/ocultar detalles</string>
<string name="account_setup_failed_dlg_invalid_certificate_title">Unrecognized Certificate</string>
<string name="account_setup_failed_dlg_invalid_certificate_accept">Accept Key</string>
<string name="account_setup_failed_dlg_invalid_certificate_reject">Reject Key</string>
</resources>

View File

@ -276,6 +276,32 @@
<item>EXPUNGE_MANUALLY</item>
</string-array>
<string-array name="settings_language_entries">
<item>@string/setting_language_system</item>
<item>@string/setting_language_chinese</item>
<item>@string/setting_language_czech</item>
<item>@string/setting_language_english</item>
<item>@string/setting_language_german</item>
<item>@string/setting_language_france</item>
<item>@string/setting_language_italian</item>
<item>@string/setting_language_polish</item>
<item>@string/setting_language_spanish</item>
<item>@string/setting_language_russian</item>
</string-array>
<string-array name="settings_language_values">
<item></item>
<item>zh</item>
<item>cs</item>
<item>en</item>
<item>de</item>
<item>fr</item>
<item>it</item>
<item>pl</item>
<item>es</item>
<item>ru</item>
</string-array>
<string-array name="settings_theme_entries">
<item>@string/setting_theme_light</item>
<item>@string/setting_theme_dark</item>

View File

@ -733,6 +733,18 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="messagelist_preferences">Message Lists</string>
<string name="messageview_preferences">Messages</string>
<string name="settings_theme_label">Theme</string>
<string name="settings_language_label">Language</string>
<string name="setting_language_system">System default</string>
<string name="setting_language_chinese">Chinese</string>
<string name="setting_language_czech">Czech</string>
<string name="setting_language_english">English</string>
<string name="setting_language_german">German</string>
<string name="setting_language_france">French</string>
<string name="setting_language_italian">Italian</string>
<string name="setting_language_polish">Polish</string>
<string name="setting_language_spanish">Spanish</string>
<string name="setting_language_russian">Russian</string>
<string name="background_ops_label">Background sync</string>
<string name="background_ops_never">Never</string>

View File

@ -18,6 +18,13 @@
<PreferenceCategory android:title="@string/display_preferences" android:key="global_preferences">
<ListPreference
android:key="language"
android:title="@string/settings_language_label"
android:entries="@array/settings_language_entries"
android:entryValues="@array/settings_language_values"
android:dialogTitle="@string/settings_language_label" />
<ListPreference
android:key="theme"
android:title="@string/settings_theme_label"

View File

@ -37,6 +37,7 @@ public class K9 extends Application
WHEN_CHECKED, ALWAYS, NEVER, WHEN_CHECKED_AUTO_SYNC
}
private static String language = "";
private static int theme = android.R.style.Theme_Light;
private static final FontSizes fontSizes = new FontSizes();
@ -313,6 +314,7 @@ public class K9 extends Application
editor.putBoolean("messageViewFixedWidthFont",mMessageViewFixedWidthFont);
editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList);
editor.putString("language", language);
editor.putInt("theme", theme);
editor.putBoolean("useGalleryBugWorkaround", useGalleryBugWorkaround);
@ -357,6 +359,7 @@ public class K9 extends Application
setBackgroundOps(BACKGROUND_OPS.WHEN_CHECKED);
}
K9.setK9Language(sprefs.getString("language", ""));
K9.setK9Theme(sprefs.getInt("theme", android.R.style.Theme_Light));
MessagingController.getInstance(this).resetVisibleLimits(prefs.getAccounts());
@ -431,6 +434,16 @@ public class K9 extends Application
}
public static String getK9Language()
{
return language;
}
public static void setK9Language(String nlanguage)
{
language = nlanguage;
}
public static int getK9Theme()
{
return theme;

View File

@ -312,6 +312,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
unreadAccount = new SearchAccount(this, false, null, null);
unreadAccount.setDescription(getString(R.string.search_all_messages_title));
unreadAccount.setEmail(getString(R.string.search_all_messages_detail));
@ -320,8 +322,6 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
integratedInboxAccount.setDescription(getString(R.string.integrated_inbox_title));
integratedInboxAccount.setEmail(getString(R.string.integrated_inbox_detail));
super.onCreate(icicle);
Account[] accounts = Preferences.getPreferences(this).getAccounts();
Intent intent = getIntent();
boolean startup = (boolean)intent.getBooleanExtra(EXTRA_STARTUP, true);

View File

@ -1,12 +1,16 @@
package com.fsck.k9.activity;
import java.util.Locale;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.widget.ScrollView;
import com.fsck.k9.K9;
@ -26,6 +30,7 @@ public class K9Activity extends Activity
public void onCreate(Bundle icicle, boolean useTheme)
{
setLanguage(this, K9.getK9Language());
if (useTheme)
{
setTheme(K9.getK9Theme());
@ -38,6 +43,23 @@ public class K9Activity extends Activity
}
public static void setLanguage(Context context, String language)
{
Locale locale;
if (language == null || language.equals(""))
{
locale = Locale.getDefault();
}
else
{
locale = new Locale(language);
}
Configuration config = new Configuration();
config.locale = locale;
context.getResources().updateConfiguration(config,
context.getResources().getDisplayMetrics());
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev)
{

View File

@ -10,6 +10,7 @@ public class K9ListActivity extends ListActivity
@Override
public void onCreate(Bundle icicle)
{
K9Activity.setLanguage(this, K9.getK9Language());
setTheme(K9.getK9Theme());
super.onCreate(icicle);
setupFormats();

View File

@ -11,6 +11,7 @@ public class K9PreferenceActivity extends PreferenceActivity
@Override
public void onCreate(Bundle icicle)
{
K9Activity.setLanguage(this, K9.getK9Language());
setTheme(K9.getK9Theme());
super.onCreate(icicle);
}

View File

@ -19,6 +19,7 @@ import com.fsck.k9.service.MailService;
public class Prefs extends K9PreferenceActivity
{
private static final String PREFERENCE_LANGUAGE = "language";
private static final String PREFERENCE_THEME = "theme";
private static final String PREFERENCE_FONT_SIZE = "font_size";
private static final String PREFERENCE_DATE_FORMAT = "dateFormat";
@ -40,6 +41,7 @@ public class Prefs extends K9PreferenceActivity
private static final String PREFERENCE_MEASURE_ACCOUNTS = "measure_accounts";
private static final String PREFERENCE_COUNT_SEARCH = "count_search";
private static final String PREFERENCE_GALLERY_BUG_WORKAROUND = "use_gallery_bug_workaround";
private ListPreference mLanguage;
private ListPreference mTheme;
private ListPreference mDateFormat;
private ListPreference mBackgroundOps;
@ -78,6 +80,21 @@ public class Prefs extends K9PreferenceActivity
addPreferencesFromResource(R.xml.global_preferences);
mLanguage = (ListPreference) findPreference(PREFERENCE_LANGUAGE);
mLanguage.setValue(K9.getK9Language());
mLanguage.setSummary(mLanguage.getEntry());
mLanguage.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
{
public boolean onPreferenceChange(Preference preference, Object newValue)
{
final String summary = newValue.toString();
int index = mLanguage.findIndexOfValue(summary);
mLanguage.setSummary(mLanguage.getEntries()[index]);
mLanguage.setValue(summary);
return false;
}
});
mTheme = (ListPreference) findPreference(PREFERENCE_THEME);
mTheme.setValue(String.valueOf(K9.getK9Theme() == android.R.style.Theme ? "dark" : "light"));
mTheme.setSummary(mTheme.getEntry());
@ -198,6 +215,7 @@ public class Prefs extends K9PreferenceActivity
private void saveSettings()
{
SharedPreferences preferences = Preferences.getPreferences(this).getPreferences();
K9.setK9Language(mLanguage.getValue());
K9.setK9Theme(mTheme.getValue().equals("dark") ? android.R.style.Theme : android.R.style.Theme_Light);
K9.DEBUG = mDebugLogging.isChecked();
K9.DEBUG_SENSITIVE = mSensitiveLogging.isChecked();