add debug preference via which Translate menuitems must be enabled

This commit is contained in:
Eric House 2014-04-22 21:06:05 -07:00
parent 0a3371a82f
commit e643e9d5c0
6 changed files with 597 additions and 579 deletions

File diff suppressed because it is too large Load diff

View file

@ -114,6 +114,7 @@
<string name="key_enable_dup_invite">key_enable_dup_invite</string>
<string name="key_download_path">key_download_path</string>
<string name="key_xlations_locale">key_xlations_locale</string>
<string name="key_xlations_enabled">key_xlations_enabled</string>
<!-- Nor is my email address -->
<string name="email_author_email">xwords@eehouse.org</string>

View file

@ -2232,5 +2232,8 @@
<string name="loc_menu_xlate">Translate</string>
<string name="new_xlations_fmt">Installed %1$d new translations</string>
<string name="xlations_enabled_title">Enable local translating</string>
<string name="xlations_enabled_summary">Add option to every screen menu</string>
</resources>

View file

@ -326,6 +326,12 @@
android:title="@string/xlations_locale"
/>
<CheckBoxPreference android:key="@string/key_xlations_enabled"
android:title="@string/xlations_enabled_title"
android:summary="@string/xlations_enabled_summary"
android:defaultValue="false"
/>
<!-- For broken devices like my Blaze 4G that report a download
directory that doesn't exist, allow users to set it. Mine:
/sdcard/external_sd/download

View file

@ -434,4 +434,9 @@ public class XWPrefs {
{
return getPrefsString( context, R.string.key_xlations_locale );
}
public static boolean getXlationEnabled( Context context )
{
return getPrefsBoolean( context, R.string.key_xlations_enabled, false );
}
}

View file

@ -320,7 +320,7 @@ public class LocUtils {
}
// The caller is loc-aware, so add our menu -- at the top level!
if ( 0 == depth ) {
if ( 0 == depth && XWPrefs.getXlationEnabled( activity ) ) {
String title = getString( activity, R.string.loc_menu_xlate );
menu.add( title )
.setOnMenuItemClickListener( new OnMenuItemClickListener() {