Translatable rule errors

This commit is contained in:
M66B
2020-11-19 19:10:14 +01:00
parent b42d6bbb84
commit 1fad28dd6a
2 changed files with 8 additions and 4 deletions

View File

@@ -371,12 +371,12 @@ public class EntityRule {
case TYPE_KEYWORD:
String keyword = jargs.getString("keyword");
if (TextUtils.isEmpty(keyword))
throw new IllegalArgumentException("Keyword missing");
throw new IllegalArgumentException(context.getString(R.string.title_rule_keyword_missing));
case TYPE_MOVE:
case TYPE_COPY:
long target = jargs.optLong("target", -1);
if (target < 0)
throw new IllegalArgumentException("Folder missing");
throw new IllegalArgumentException(context.getString(R.string.title_rule_folder_missing));
EntityFolder folder = db.folder().getFolder(target);
if (folder == null)
throw new IllegalArgumentException("Folder not found");
@@ -384,14 +384,14 @@ public class EntityRule {
case TYPE_ANSWER:
long iid = jargs.optLong("identity", -1);
if (iid < 0)
throw new IllegalArgumentException("Identity missing");
throw new IllegalArgumentException(context.getString(R.string.title_rule_identity_missing));
EntityIdentity identity = db.identity().getIdentity(iid);
if (identity == null)
throw new IllegalArgumentException("Identity not found");
long aid = jargs.optLong("answer", -1);
if (aid < 0)
throw new IllegalArgumentException("Answer missing");
throw new IllegalArgumentException(context.getString(R.string.title_rule_answer_missing));
EntityAnswer answer = db.answer().getAnswer(aid);
if (answer == null)
throw new IllegalArgumentException("Answer not found");