1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Use resource strings instead of hardcoding things

This commit is contained in:
cketti 2011-10-14 03:42:04 +02:00
parent b146fcb2fd
commit 5b81dbc2ed
2 changed files with 15 additions and 14 deletions

View File

@ -1037,6 +1037,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="settings_import_dialog_title">Import</string>
<string name="settings_export_dialog_title">Export</string>
<string name="settings_import">Import settings</string>
<string name="settings_import_selection">Import selection</string>
<string name="settings_import_global_settings">Global settings</string>
<string name="settings_exporting">Exporting settings...</string>
<string name="settings_importing">Importing settings...</string>
<string name="settings_import_scanning_file">Scanning file...</string>
@ -1046,8 +1048,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<item quantity="one">1 account</item>
<item quantity="other"><xliff:g id="numAccounts">%s</xliff:g> accounts</item>
</plurals>
<string name="settings_export_failure">Failed to export settings: <xliff:g id="reason">%s</xliff:g></string>
<string name="settings_import_failure">Failed to import settings from <xliff:g id="filename">%s</xliff:g>: <xliff:g id="reason">%s</xliff:g></string>
<string name="settings_export_failure">Failed to export settings</string>
<string name="settings_import_failure">Failed to import any settings from <xliff:g id="filename">%s</xliff:g></string>
<string name="settings_export_success_header">Export succeeded</string>
<string name="settings_export_failed_header">Export failed</string>
<string name="settings_import_success_header">Import succeeded</string>

View File

@ -1010,8 +1010,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
List<String> contents = new ArrayList<String>();
if (mImportContents.globalSettings) {
//TODO: read from resources
contents.add("Global settings");
contents.add(activity.getString(R.string.settings_import_global_settings));
}
for (AccountDescription account : mImportContents.accounts) {
@ -1043,8 +1042,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
//TODO: listview footer: "Overwrite existing accounts?" checkbox
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
//TODO: read from resources
builder.setTitle("Import selection");
builder.setTitle(activity.getString(R.string.settings_import_selection));
builder.setView(importSelectionView);
builder.setInverseBackgroundForced(true);
builder.setPositiveButton(R.string.okay_action,
@ -1383,9 +1381,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
activity.showSimpleDialog(R.string.settings_export_success_header,
R.string.settings_export_success, mFileName);
} else {
//TODO: make the exporter return an error code; translate that error code to a localized string here
//TODO: better error messages
activity.showSimpleDialog(R.string.settings_export_failed_header,
R.string.settings_export_failure, "Something went wrong");
R.string.settings_export_failure);
}
}
}
@ -1450,19 +1448,19 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
removeProgressDialog();
String filename = mUri.getLastPathSegment();
if (success) {
int imported = mImportResults.importedAccounts.size();
//TODO: display names of imported accounts (name from file *and* possibly new name)
activity.showSimpleDialog(R.string.settings_import_success_header,
//FIXME: use correct file name
R.string.settings_import_success, imported, "filename");
R.string.settings_import_success, imported, filename);
activity.refresh();
} else {
//TODO: make the importer return an error code; translate that error code to a localized string here
//TODO: better error messages
activity.showSimpleDialog(R.string.settings_import_failed_header,
R.string.settings_import_failure, "unknown", "Something went wrong");
R.string.settings_import_failure, filename);
}
}
}
@ -1522,9 +1520,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
if (success) {
activity.showImportSelectionDialog(mImportContents, mUri, mEncryptionKey);
} else {
//TODO: make the importer return an error code; translate that error code to a localized string here
String filename = mUri.getLastPathSegment();
//TODO: better error messages
activity.showSimpleDialog(R.string.settings_import_failed_header,
R.string.settings_import_failure, "unknown", "Something went wrong");
R.string.settings_import_failure, filename);
}
}
}