Skip to content

Commit

Permalink
Translation / API response improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
catbref committed Mar 19, 2020
1 parent 51fd177 commit 2d18dd6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ public TransactionData decodeTransaction(String rawBytes58, @QueryParam("ignoreV

public static ApiException createTransactionInvalidException(HttpServletRequest request, ValidationResult result) {
String translatedResult = Translator.INSTANCE.translate("TransactionValidity", request.getLocale().getLanguage(), result.name());
return ApiExceptionFactory.INSTANCE.createException(request, ApiError.TRANSACTION_INVALID, null, translatedResult);
return ApiExceptionFactory.INSTANCE.createException(request, ApiError.TRANSACTION_INVALID, null, translatedResult, result.name());
}

}
2 changes: 1 addition & 1 deletion src/main/resources/i18n/ApiError_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PUBLIC_KEY_NOT_FOUND = public key not found

REPOSITORY_ISSUE = repository error

TRANSACTION_INVALID = transaction invalid: %s
TRANSACTION_INVALID = transaction invalid: %s (%s)

TRANSACTION_UNKNOWN = transaction unknown

Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/i18n/TransactionValidity_en.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

ACCOUNT_ALREADY_EXISTS = account already exists

ACCOUNT_CANNOT_REWARD_SHARE = account cannot reward-share

ALREADY_GROUP_ADMIN = already group admin
Expand Down Expand Up @@ -139,7 +141,7 @@ NOT_YET_RELEASED = NOT_YET_RELEASED

NO_BALANCE = NO_BALANCE

NO_BLOCKCHAIN_LOCK = NO_BLOCKCHAIN_LOCK
NO_BLOCKCHAIN_LOCK = node's blockchain currently busy
NO_FLAG_PERMISSION = NO_FLAG_PERMISSION
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/org/qortal/test/apps/CheckTranslations.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public class CheckTranslations {

private static final String[] SUPPORTED_LANGS = new String[] { "en", "de", "zh", "ru" };
private static final Set<String> SYSTRAY_KEYS = Set.of("BLOCK_HEIGHT", "CHECK_TIME_ACCURACY", "CONNECTION", "CONNECTIONS",
"EXIT", "MINTING_DISABLED", "MINTING_ENABLED", "OPEN_UI", "SYNCHRONIZE_CLOCK", "SYNCHRONIZING_CLOCK");
"EXIT", "MINTING_DISABLED", "MINTING_ENABLED", "NTP_NAG_CAPTION", "NTP_NAG_TEXT_UNIX", "NTP_NAG_TEXT_WINDOWS",
"OPEN_UI", "SYNCHRONIZE_CLOCK", "SYNCHRONIZING_BLOCKCHAIN", "SYNCHRONIZING_CLOCK");

private static String failurePrefix;

Expand Down

0 comments on commit 2d18dd6

Please sign in to comment.