import-log: switch to flags instead of statuses for result int

This commit is contained in:
Vincent Breitmoser 2014-06-10 16:24:04 +02:00
parent e41e6ea0de
commit f38556cab1
16 changed files with 204 additions and 159 deletions

View File

@ -33,9 +33,9 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.OperationResultParcel;
import org.sufficientlysecure.keychain.service.OperationResultParcel.OperationLog;
import org.sufficientlysecure.keychain.service.OperationResults.ImportResult;
import org.sufficientlysecure.keychain.service.OperationResults.SaveKeyringResult;
import org.sufficientlysecure.keychain.util.Log;
import java.io.ByteArrayOutputStream;
@ -152,9 +152,12 @@ public class PgpImportExport {
}
}
OperationResultParcel result = mProviderHelper.savePublicKeyRing(key);
newKeys += 1;
SaveKeyringResult result = mProviderHelper.savePublicKeyRing(key);
if (result.updated()) {
newKeys += 1;
} else {
oldKeys += 1;
}
} catch (PgpGeneralException e) {
Log.e(Constants.TAG, "Encountered bad key on import!", e);
@ -166,23 +169,26 @@ public class PgpImportExport {
}
OperationLog log = mProviderHelper.getLog();
int resultType;
// Any key imported - overall success
if (newKeys > 0 || oldKeys > 0) {
if (badKeys > 0) {
resultType = ImportResult.RESULT_PARTIAL_WITH_ERRORS;
} else if (newKeys > 0 && oldKeys > 0) {
resultType = ImportResult.RESULT_OK_BOTHKEYS;
} else if (newKeys > 0) {
resultType = ImportResult.RESULT_OK_NEWKEYS;
} else {
resultType = ImportResult.RESULT_OK_UPDATED;
}
// No keys imported, overall failure
} else if (badKeys > 0) {
resultType = ImportResult.RESULT_FAIL_ERROR;
} else {
int resultType = 0;
// special return case: no new keys at all
if (badKeys == 0 && newKeys == 0 && oldKeys == 0) {
resultType = ImportResult.RESULT_FAIL_NOTHING;
} else {
if (newKeys > 0) {
resultType |= ImportResult.RESULT_OK_NEWKEYS;
}
if (oldKeys > 0) {
resultType |= ImportResult.RESULT_OK_UPDATED;
}
if (badKeys > 0) {
resultType |= ImportResult.RESULT_WITH_ERRORS;
if (newKeys == 0 && oldKeys == 0) {
resultType |= ImportResult.RESULT_ERROR;
}
}
if (log.containsWarnings()) {
resultType |= ImportResult.RESULT_WITH_WARNINGS;
}
}
return new ImportResult(resultType, log, newKeys, oldKeys, badKeys);

View File

@ -49,6 +49,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
import org.sufficientlysecure.keychain.remote.AccountSettings;
import org.sufficientlysecure.keychain.remote.AppSettings;
import org.sufficientlysecure.keychain.service.OperationResults.SaveKeyringResult;
import org.sufficientlysecure.keychain.util.IterableIterator;
import org.sufficientlysecure.keychain.util.Log;
@ -267,12 +268,15 @@ public class ProviderHelper {
* Saves PGPPublicKeyRing with its keys and userIds in DB
*/
@SuppressWarnings("unchecked")
public OperationResultParcel savePublicKeyRing(UncachedKeyRing keyRing) {
public SaveKeyringResult savePublicKeyRing(UncachedKeyRing keyRing) {
if (keyRing.isSecret()) {
log(LogLevel.ERROR, LogType.MSG_IP_BAD_TYPE_SECRET);
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
}
// start with ok result
int result = SaveKeyringResult.SAVED_PUBLIC;
long masterKeyId = keyRing.getMasterKeyId();
log(LogLevel.START, LogType.MSG_IP,
new String[]{ PgpKeyHelper.convertKeyIdToHex(masterKeyId) });
@ -296,6 +300,7 @@ public class ProviderHelper {
try {
mContentResolver.delete(KeyRingData.buildPublicKeyRingUri(Long.toString(masterKeyId)), null, null);
log(LogLevel.DEBUG, LogType.MSG_IP_DELETE_OLD_OK);
result |= SaveKeyringResult.UPDATED;
} catch (UnsupportedOperationException e) {
Log.e(Constants.TAG, "Key could not be deleted! Maybe we are creating a new one!", e);
log(LogLevel.DEBUG, LogType.MSG_IP_DELETE_OLD_FAIL);
@ -315,7 +320,7 @@ public class ProviderHelper {
values.put(KeyRingData.KEY_RING_DATA, keyRing.getEncoded());
} catch (IOException e) {
log(LogLevel.ERROR, LogType.MSG_IP_ENCODE_FAIL);
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
}
Uri uri = KeyRingData.buildPublicKeyRingUri(Long.toString(masterKeyId));
@ -371,7 +376,7 @@ public class ProviderHelper {
log(LogLevel.ERROR, LogType.MSG_IP_SUBKEY_FUTURE, new String[] {
creation.toString()
});
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
}
Date expiryDate = key.getExpiryTime();
if (expiryDate != null) {
@ -436,7 +441,7 @@ public class ProviderHelper {
if (!cert.verifySignature(masterKey, userId)) {
// Bad self certification? That's kinda bad...
log(LogLevel.ERROR, LogType.MSG_IP_UID_SELF_BAD);
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
}
// if we already have a cert..
@ -526,17 +531,17 @@ public class ProviderHelper {
log(LogLevel.ERROR, LogType.MSG_IP_FAIL_IO_EXC);
Log.e(Constants.TAG, "IOException during import", e);
mIndent -= 1;
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
} catch (RemoteException e) {
log(LogLevel.ERROR, LogType.MSG_IP_FAIL_REMOTE_EX);
Log.e(Constants.TAG, "RemoteException during import", e);
mIndent -= 1;
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
} catch (OperationApplicationException e) {
log(LogLevel.ERROR, LogType.MSG_IP_FAIL_OP_EX);
Log.e(Constants.TAG, "OperationApplicationException during import", e);
mIndent -= 1;
return new OperationResultParcel(1, mLog);
return new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, mLog);
}
// Save the saved keyring (if any)
@ -544,12 +549,13 @@ public class ProviderHelper {
log(LogLevel.DEBUG, LogType.MSG_IP_REINSERT_SECRET);
mIndent += 1;
saveSecretKeyRing(secretRing);
result |= SaveKeyringResult.SAVED_SECRET;
mIndent -= 1;
}
log(LogLevel.OK, LogType.MSG_IP_SUCCESS);
mIndent -= 1;
return new OperationResultParcel(0, mLog);
return new SaveKeyringResult(result, mLog);
}

View File

@ -18,12 +18,13 @@ import java.util.ArrayList;
*
*/
public class OperationResultParcel implements Parcelable {
/** Holds the overall result, the number specifying varying degrees of success.
* Values smaller than 100 are considered an overall success. */
/** Holds the overall result, the number specifying varying degrees of success. The first bit
* is 0 on overall success, 1 on overall failure. All other bits may be used for more specific
* conditions. */
final int mResult;
public static final int RESULT_OK = 0;
public static final int RESULT_ERROR = 100;
public static final int RESULT_ERROR = 1;
/// A list of log entries tied to the operation result.
final OperationLog mLog;
@ -44,7 +45,7 @@ public class OperationResultParcel implements Parcelable {
}
public boolean isSuccessful() {
return mResult < 100;
return (mResult & 1) == 1;
}
public OperationLog getLog() {

View File

@ -8,20 +8,31 @@ public abstract class OperationResults {
public final int mNewKeys, mUpdatedKeys, mBadKeys;
// Operation ok, at least one new key (no warnings)
public static final int RESULT_OK_NEWKEYS = 1;
// Operation ok, at least one new and one updated key (no warnings)
public static final int RESULT_OK_BOTHKEYS = 2;
// Operation ok, no new keys but upated ones (no warnings)
public static final int RESULT_OK_UPDATED = 3;
// At least one new key
public static final int RESULT_OK_NEWKEYS = 2;
// At least one updated key
public static final int RESULT_OK_UPDATED = 4;
// At least one key failed (might still be an overall success)
public static final int RESULT_WITH_ERRORS = 8;
// There are warnings in the log
public static final int RESULT_WITH_WARNINGS = 16;
// Operation partially ok, but at least one key failed!
public static final int RESULT_PARTIAL_WITH_ERRORS = 50;
// No keys to import...
public static final int RESULT_FAIL_NOTHING = 32 +1;
// Operation failed, errors thrown and no new keys imported
public static final int RESULT_FAIL_ERROR = 100;
// Operation failed, no keys to import...
public static final int RESULT_FAIL_NOTHING = 101;
public boolean isOkBoth() {
return (mResult & (RESULT_OK_NEWKEYS | RESULT_OK_UPDATED))
== (RESULT_OK_NEWKEYS | RESULT_OK_UPDATED);
}
public boolean isOkNew() {
return (mResult & RESULT_OK_NEWKEYS) > 0;
}
public boolean isOkUpdated() {
return (mResult & RESULT_OK_UPDATED) > 0;
}
public boolean isFailNothing() {
return (mResult & RESULT_FAIL_NOTHING) > 0;
}
public ImportResult(Parcel source) {
super(source);
@ -58,4 +69,24 @@ public abstract class OperationResults {
}
public static class SaveKeyringResult extends OperationResultParcel {
public SaveKeyringResult(int result, OperationLog log) {
super(result, log);
}
// Some old key was updated
public static final int UPDATED = 2;
// Public key was saved
public static final int SAVED_PUBLIC = 8;
// Secret key was saved (not exclusive with public!)
public static final int SAVED_SECRET = 16;
public boolean updated() {
return (mResult & UPDATED) == UPDATED;
}
}
}

View File

@ -378,55 +378,54 @@ public class ImportKeysActivity extends ActionBarActivity implements ActionBar.O
final ImportResult result =
returnData.<ImportResult>getParcelable(KeychainIntentService.RESULT);
String str = "";
boolean hasWarnings = result.getLog().containsWarnings();
int duration = 0, color = hasWarnings ? Style.ORANGE : Style.GREEN;
String withWarnings = hasWarnings
? getResources().getString(R.string.with_warnings) : "";
int resultType = result.getResult();
switch(result.getResult()) {
case ImportResult.RESULT_OK_NEWKEYS:
if (!hasWarnings) {
duration = SuperToast.Duration.LONG;
}
str = getResources().getQuantityString(
R.plurals.keys_added, result.mNewKeys, result.mNewKeys, withWarnings);
break;
String str;
int duration, color;
case ImportResult.RESULT_OK_UPDATED:
if (!hasWarnings) {
duration = SuperToast.Duration.LONG;
}
str = getResources().getQuantityString(
R.plurals.keys_updated, result.mNewKeys, result.mNewKeys, withWarnings);
break;
// Not an overall failure
if ((resultType & ImportResult.RESULT_ERROR) == 0) {
String withWarnings;
case ImportResult.RESULT_OK_BOTHKEYS:
if (!hasWarnings) {
duration = SuperToast.Duration.LONG;
}
str = getResources().getQuantityString(
R.plurals.keys_added_and_updated_1, result.mNewKeys, result.mNewKeys);
str += getResources().getQuantityString(
R.plurals.keys_added_and_updated_2, result.mUpdatedKeys, result.mUpdatedKeys, withWarnings);
break;
case ImportResult.RESULT_PARTIAL_WITH_ERRORS:
str = "partial with errors";
// Any warnings?
if ((resultType & ImportResult.RESULT_WITH_WARNINGS) > 0) {
duration = 0;
color = Style.ORANGE;
break;
withWarnings = getResources().getString(R.string.import_with_warnings);
} else {
duration = SuperToast.Duration.LONG;
color = Style.GREEN;
withWarnings = "";
}
case ImportResult.RESULT_FAIL_ERROR:
str = "fail error";
// New and updated keys
if (result.isOkBoth()) {
str = getResources().getQuantityString(
R.plurals.import_keys_added_and_updated_1, result.mNewKeys, result.mNewKeys);
str += getResources().getQuantityString(
R.plurals.import_keys_added_and_updated_2, result.mUpdatedKeys, result.mUpdatedKeys, withWarnings);
} else if (result.isOkNew()) {
str = getResources().getQuantityString(
R.plurals.import_keys_added, result.mNewKeys, result.mNewKeys, withWarnings);
} else if (result.isOkUpdated()) {
str = getResources().getQuantityString(
R.plurals.import_keys_updated, result.mUpdatedKeys, result.mUpdatedKeys, withWarnings);
} else {
duration = 0;
color = Style.RED;
break;
case ImportResult.RESULT_FAIL_NOTHING:
str = getString(R.string.no_keys_added_or_updated);
color = Style.RED;
break;
str = "internal error";
}
} else {
duration = 0;
color = Style.RED;
if (result.isFailNothing()) {
str = getString(R.string.import_error_nothing);
} else {
str = getString(R.string.import_error);
}
}
SuperCardToast toast = new SuperCardToast(ImportKeysActivity.this,
SuperToast.Type.BUTTON, Style.getStyle(color, SuperToast.Animations.POPUP));
toast.setText(str);
@ -434,9 +433,9 @@ public class ImportKeysActivity extends ActionBarActivity implements ActionBar.O
toast.setIndeterminate(duration == 0);
toast.setSwipeToDismiss(true);
toast.setButtonIcon(R.drawable.ic_action_view_as_list,
getResources().getString(R.string.view_log));
toast.setButtonTextColor(R.color.emphasis_dark);
toast.setTextColor(R.color.emphasis_dark);
getResources().getString(R.string.import_view_log));
toast.setButtonTextColor(getResources().getColor(R.color.black));
toast.setTextColor(getResources().getColor(R.color.black));
toast.setOnClickWrapper(new OnClickWrapper("supercardtoast",
new SuperToast.OnClickListener() {
@Override

View File

@ -206,23 +206,23 @@
<string name="ask_empty_id_ok">Es wurde eine leere Identität hinzugefügt. Wirklich fortfahren?</string>
<string name="public_key_deletetion_confirmation">Soll der öffentliche Schlüssel \'%s\' wirklich gelöscht werden?\nDies kann nicht rückgängig gemacht werden! </string>
<string name="also_export_secret_keys">Private Schlüssel auch exportieren</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">%d Schlüssel erfolgreich hinzugefügt</item>
<item quantity="other">%d Schlüssel erfolgreich hinzugefügt</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">und %d Schlüssel erfolgreich aktualisiert.</item>
<item quantity="other">und %d Schlüssel erfolgreich aktualisiert.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">%d Schlüssel erfolgreich hinzugefügt.</item>
<item quantity="other">%d Schlüssel erfolgreich hinzugefügt.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">%d Schlüssel erfolgreich aktualisiert.</item>
<item quantity="other">%d Schlüssel erfolgreich aktualisiert.</item>
</plurals>
<string name="no_keys_added_or_updated">Keine Schlüssel hinzugefügt oder aktualisiert.</string>
<string name="import_error_nothing">Keine Schlüssel hinzugefügt oder aktualisiert.</string>
<string name="key_exported">1 Schlüssel erfolgreich exportiert.</string>
<string name="keys_exported">%d Schlüssel erfolgreich exportiert.</string>
<string name="no_keys_exported">Keine Schlüssel exportiert.</string>

View File

@ -206,23 +206,23 @@
<string name="ask_empty_id_ok">Ha añadido una identidad vacía, ¿está seguro de que quiere continuar?</string>
<string name="public_key_deletetion_confirmation">¿De veras quiere borrar la clave pública \'%s\'?\n¡No puede deshacer esto!</string>
<string name="also_export_secret_keys">¿Exportar también las claves secretas?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">%d clave añadida satisfactoriamente</item>
<item quantity="other">%d claves añadidas satisfactoriamente</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">y actualizada %d clave.</item>
<item quantity="other">y actualizadas %d claves.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">%d clave añadida satisfactoriamente.</item>
<item quantity="other">%d claves añadidas satisfactoriamente.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">%d clave actualizada satisfactoriamente.</item>
<item quantity="other">%d claves actualizadas satisfactoriamente.</item>
</plurals>
<string name="no_keys_added_or_updated">No se han añadido o actualizado claves.</string>
<string name="import_error_nothing">No se han añadido o actualizado claves.</string>
<string name="key_exported">Se ha exportado 1 clave satisfactoriamente.</string>
<string name="keys_exported">%d claves exportadas satisfactoriamente.</string>
<string name="no_keys_exported">No se han exportado claves.</string>

View File

@ -206,23 +206,23 @@
<string name="ask_empty_id_ok">Vous avez ajouté une identité vide, êtes-vous certain de vouloir continuer ?</string>
<string name="public_key_deletetion_confirmation">Voulez-vous vraiment supprimer la clef publique %s ?\nCeci est irréversible !</string>
<string name="also_export_secret_keys">Exporter aussi les clefs secrètes ?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">%d clef ajoutée avec succès</item>
<item quantity="other">%d clefs ajoutées avec succès</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">et %d clef mise à jour.</item>
<item quantity="other">et %d clefs mises à jour.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">%d clef ajoutée avec succès.</item>
<item quantity="other">%d clefs ajoutées avec succès.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">%d clef mise à jour avec succès.</item>
<item quantity="other">%d clefs mises à jour avec succès.</item>
</plurals>
<string name="no_keys_added_or_updated">Aucune clef ajoutée ou mise à jour.</string>
<string name="import_error_nothing">Aucune clef ajoutée ou mise à jour.</string>
<string name="key_exported">1 clef exportée avec succès.</string>
<string name="keys_exported">%d clefs exportées avec succès.</string>
<string name="no_keys_exported">Aucune clef exportée.</string>

View File

@ -206,23 +206,23 @@
<string name="ask_empty_id_ok">Hai aggiunto una identità vuota, sei sicuro di voler continuare?</string>
<string name="public_key_deletetion_confirmation">Vuoi veramente eliminare la chiave pubblica \'%s\'?\nNon potrai annullare!</string>
<string name="also_export_secret_keys">Esportare anche le chiavi segrete?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">%d chiave aggiunta correttamente</item>
<item quantity="other">%d chiavi aggiunte correttamente</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">e %d chiave aggiornata.</item>
<item quantity="other">e %d chiavi aggiornate.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">%d chiave aggiunta correttamente.</item>
<item quantity="other">%d chiavi aggiunte correttamente.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">%d chiave aggiornata correttamente.</item>
<item quantity="other">%d chiavi aggiornate correttamente.</item>
</plurals>
<string name="no_keys_added_or_updated">Nessuna chiave aggiunta o aggiornata.</string>
<string name="import_error_nothing">Nessuna chiave aggiunta o aggiornata.</string>
<string name="key_exported">1 chiave esportata correttamente.</string>
<string name="keys_exported">%d chiavi esportate correttamente.</string>
<string name="no_keys_exported">Nessuna chiave esportata.</string>

View File

@ -203,19 +203,19 @@
<string name="ask_empty_id_ok">あなたは空のユーザIDを追加しました、このまま続けますか?</string>
<string name="public_key_deletetion_confirmation">公開鍵\'%s\'を本当に削除してもよいですか?\nこれは元に戻せません!</string>
<string name="also_export_secret_keys">秘密鍵もエクスポートしますか?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="other">%d の鍵を追加しました</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="other">そして %d の鍵をアップロードしました。</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="other">%d の鍵を追加しました。</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="other">%d の鍵をアップロードしました。</item>
</plurals>
<string name="no_keys_added_or_updated">鍵の追加もしくは更新はありませんでした。</string>
<string name="import_error_nothing">鍵の追加もしくは更新はありませんでした。</string>
<string name="key_exported">1つの鍵をエクスポートしました。</string>
<string name="keys_exported">%d の鍵をエクスポートしました。</string>
<string name="no_keys_exported">鍵をエクスポートしていません。</string>

View File

@ -206,23 +206,23 @@
<string name="ask_empty_id_ok">U heeft een lege identiteit toegevoegd, weet u zeker dat u wilt doorgaan?</string>
<string name="public_key_deletetion_confirmation">Wilt u echt de publieke sleutel \'%s\' verwijderen?\nDit kunt u niet ongedaan maken!</string>
<string name="also_export_secret_keys">Ook geheime sleutels exporteren?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">Succesvol %d sleutel toegevoegd</item>
<item quantity="other">Succesvol %d sleutels toegevoegd</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">en %d sleutel bijgewerkt.</item>
<item quantity="other">en %d sleutels bijgewerkt.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">Succesvol %d sleutel toegevoegd.</item>
<item quantity="other">Succesvol %d sleutels toegevoegd.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">Succesvol %d sleutel bijgewerkt.</item>
<item quantity="other">Succesvol %d sleutels bijgewerkt.</item>
</plurals>
<string name="no_keys_added_or_updated">Geen sleutels toegevoegd of bijgewerkt.</string>
<string name="import_error_nothing">Geen sleutels toegevoegd of bijgewerkt.</string>
<string name="key_exported">1 sleutel succesvol geëxporteerd.</string>
<string name="keys_exported">Succesvol %d sleutels geëxporteerd.</string>
<string name="no_keys_exported">Geen sleutels geëxporteerd.</string>

View File

@ -191,27 +191,27 @@
<string name="ask_save_changed_key">Zostały dokonane zmiany w pęku kluczy, czy chcesz je zachować?</string>
<string name="public_key_deletetion_confirmation">Czy na pewno chcesz usunąć klucz publiczny \'%s\'?\nNie można cofnąć tej operacji!</string>
<string name="also_export_secret_keys">Czy wyeksportować również klucze prywatne?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">Pomyślnie dodano %d klucz</item>
<item quantity="few">Pomyślnie dodano %d kluczy</item>
<item quantity="other">Pomyślnie dodano %d kluczy</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">i zaktualizowano %d klucz.</item>
<item quantity="few">i zaktualizowano %d kluczy.</item>
<item quantity="other">i zaktualizowano %d kluczy.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">Pomyślnie dodano %d klucz.</item>
<item quantity="few">Pomyślnie dodano %d kluczy.</item>
<item quantity="other">Pomyślnie dodano %d kluczy.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">Pomyślnie zaktualizowano %d klucz.</item>
<item quantity="few">Pomyślnie zaktualizowano %d kluczy.</item>
<item quantity="other">Pomyślnie zaktualizowano %d kluczy.</item>
</plurals>
<string name="no_keys_added_or_updated">Nie dodano ani zaktualizowano żadnych kluczy.</string>
<string name="import_error_nothing">Nie dodano ani zaktualizowano żadnych kluczy.</string>
<string name="key_exported">Pomyślnie wyeksportowano 1 klucz.</string>
<string name="keys_exported">Pomyślnie wyeksportowano %d kluczy.</string>
<string name="no_keys_exported">Nie wyeksportowano żadnych kluczy.</string>

View File

@ -206,27 +206,27 @@
<string name="ask_empty_id_ok">Вы добавили пустой идентификатор. Вы уверены, что хотите продолжить?</string>
<string name="public_key_deletetion_confirmation">Вы правда хотите удалить публичный ключ \'%s\'?\nЭто действие нельзя отменить!</string>
<string name="also_export_secret_keys">Экспортировать секретные ключи?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">Успешно добавлено %d ключ</item>
<item quantity="few">Успешно добавлено %d ключей</item>
<item quantity="other">Успешно добавлено %d ключей</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">и обновлен %d ключ.</item>
<item quantity="few">и обновлено %d ключей.</item>
<item quantity="other">и обновлено %d ключей.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">Добавлен %d ключ</item>
<item quantity="few">Добавлено %d ключей</item>
<item quantity="other">Добавлено %d ключей</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">Обновлен %d ключ.</item>
<item quantity="few">Обновлено %d ключей.</item>
<item quantity="other">Обновлено %d ключей.</item>
</plurals>
<string name="no_keys_added_or_updated">Нет обновленных или добавленных ключей</string>
<string name="import_error_nothing">Нет обновленных или добавленных ключей</string>
<string name="key_exported">Успешный экспорт 1 ключа.</string>
<string name="keys_exported">Экспортировано %d ключей.</string>
<string name="no_keys_exported">Ключи не были экспортированы.</string>

View File

@ -212,31 +212,31 @@
<string name="ask_empty_id_ok">Dodali ste prazno identiteto, ali res želite nadaljevati?</string>
<string name="public_key_deletetion_confirmation">Ali res želite izbrisati javni ključ \'%s\'?\nTega koraka ne boste mogli preklicati!</string>
<string name="also_export_secret_keys">Želite izvoziti tudi zasebne ključe?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">Uspešno dodan %d ključ</item>
<item quantity="two">Uspešno dodana %d ključa</item>
<item quantity="few">Uspešno dodani %d ključi</item>
<item quantity="other">Uspešno dodanih %d ključev</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">in posodbljen %d.</item>
<item quantity="two">in posodobljena %d.</item>
<item quantity="few">in posodobljeni %d.</item>
<item quantity="other">in posodobljenih %d.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">Uspešno dodan %d ključ.</item>
<item quantity="two">Uspešno dodana %d ključa.</item>
<item quantity="few">Uspešno dodani %d ključi.</item>
<item quantity="other">Uspešno dodanih %d ključev.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">Uspešno posodobljen %d ključ.</item>
<item quantity="two">Uspešno posodobljena %d ključa.</item>
<item quantity="few">Uspešno posodobljeni %d ključi.</item>
<item quantity="other">Uspešno posodobljenih %d ključev.</item>
</plurals>
<string name="no_keys_added_or_updated">Noben ključ ni bil dodan ali posodobljen.</string>
<string name="import_error_nothing">Noben ključ ni bil dodan ali posodobljen.</string>
<string name="key_exported">Uspešno izvožen 1 ključ.</string>
<string name="keys_exported">Uspešno izvoženih ključev: %d</string>
<string name="no_keys_exported">Noben ključ ni bil izvožen.</string>

View File

@ -209,27 +209,27 @@
<string name="ask_empty_id_ok">Ви вже додали порожню сутність. Ви справді хочете продовжити?</string>
<string name="public_key_deletetion_confirmation">Ви справді хочете вилучити відкритий ключ \'%s\'?\nВи не зможете це відмінити!</string>
<string name="also_export_secret_keys">Також експортувати секретні ключі?</string>
<plurals name="keys_added_and_updated_1">
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">Успішно додано %d ключ</item>
<item quantity="few">Успішно додано %d ключі</item>
<item quantity="other">Успішно додано %d ключів</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<plurals name="import_keys_added_and_updated_2">
<item quantity="one">і оновлено %d ключ.</item>
<item quantity="few">і оновлено %d ключі.</item>
<item quantity="other">і оновлено %d ключів.</item>
</plurals>
<plurals name="keys_added">
<plurals name="import_keys_added">
<item quantity="one">Успішно додано %d ключ.</item>
<item quantity="few">Успішно додано %d ключі.</item>
<item quantity="other">Успішно додано %d ключів.</item>
</plurals>
<plurals name="keys_updated">
<plurals name="import_keys_updated">
<item quantity="one">Успішно оновлено %d ключ.</item>
<item quantity="few">Успішно оновлено %d ключі.</item>
<item quantity="other">Успішно оновлено %d ключів.</item>
</plurals>
<string name="no_keys_added_or_updated">Жодного ключа не додано та не оновлено.</string>
<string name="import_error_nothing">Жодного ключа не додано та не оновлено.</string>
<string name="key_exported">Успішно експортовано 1 ключ.</string>
<string name="keys_exported">Успішно експортовано %d ключів.</string>
<string name="no_keys_exported">Жодного ключа не експортовано.</string>

View File

@ -221,25 +221,6 @@
<string name="public_key_deletetion_confirmation">Do you really want to delete the public key \'%s\'?\nYou can\'t undo this!</string>
<string name="also_export_secret_keys">Also export secret keys?</string>
<plurals name="keys_added_and_updated_1">
<item quantity="one">Successfully added %1$d key</item>
<item quantity="other">Successfully added %1$d keys</item>
</plurals>
<plurals name="keys_added_and_updated_2">
<item quantity="one"> and updated %1$d key%2$s.</item>
<item quantity="other"> and updated %1$d keys%2$s.</item>
</plurals>
<plurals name="keys_added">
<item quantity="one">Successfully added %1$d key%2$s.</item>
<item quantity="other">Successfully added %1$d keys%2$s.</item>
</plurals>
<plurals name="keys_updated">
<item quantity="one">Successfully updated %1$d key%2$s.</item>
<item quantity="other">Successfully updated %1$d keys%2$s.</item>
</plurals>
<string name="no_keys_added_or_updated">No keys added or updated.</string>
<string name="with_warnings">, with warnings</string>
<string name="key_exported">Successfully exported 1 key.</string>
<string name="keys_exported">Successfully exported %d keys.</string>
<string name="no_keys_exported">No keys exported.</string>
@ -408,6 +389,28 @@
<string name="import_clipboard_button">Get key from clipboard</string>
<string name="import_keybase_button">Get key from Keybase.io</string>
<!-- Import result toast -->
<plurals name="import_keys_added_and_updated_1">
<item quantity="one">Successfully added %1$d key</item>
<item quantity="other">Successfully added %1$d keys</item>
</plurals>
<plurals name="import_keys_added_and_updated_2">
<item quantity="one"> and updated %1$d key%2$s.</item>
<item quantity="other"> and updated %1$d keys%2$s.</item>
</plurals>
<plurals name="import_keys_added">
<item quantity="one">Successfully added %1$d key%2$s.</item>
<item quantity="other">Successfully added %1$d keys%2$s.</item>
</plurals>
<plurals name="import_keys_updated">
<item quantity="one">Successfully updated %1$d key%2$s.</item>
<item quantity="other">Successfully updated %1$d keys%2$s.</item>
</plurals>
<string name="import_view_log">View Log</string>
<string name="import_error_nothing">Nothing to import.</string>
<string name="import_error">Error importing keys!</string>
<string name="import_with_warnings">, with warnings</string>
<!-- Intent labels -->
<string name="intent_decrypt_file">Decrypt File with OpenKeychain</string>
<string name="intent_import_key">Import Key with OpenKeychain</string>
@ -579,6 +582,5 @@
<string name="can_sign_not">cannot sign</string>
<string name="error_encoding">Encoding error</string>
<string name="error_no_encrypt_subkey">No encryption subkey available!</string>
<string name="view_log">View Log</string>
</resources>