Skip to content

Commit

Permalink
chore: Change localized string log to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Jan 20, 2025
1 parent 5086aab commit e9be637
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ class StringResource(
if (value.startsWith('"') && value.endsWith('"')) {
// Raw strings allow unescaped single quote but not double quote.
if (!value.substring(1, value.length - 1).contains(Regex("(?<!\\\\)[\"]"))) {
return this;
return this
}
} else {
if (value.contains('\n')) {
// Don't throw an exception, otherwise unnoticed mistakes
// in Crowdin can cause patching failures.
// Incorrectly escaped strings still work but do not display as intended.
Logger.getLogger(StringResource.javaClass.name).severe(
Logger.getLogger(StringResource.javaClass.name).warning(
"String $name is not raw but contains encoded new line characters: $value")
}
if (!value.contains(Regex("(?<!\\\\)['\"]"))) {
return this;
return this
}
}

Logger.getLogger(StringResource.javaClass.name).severe(
Logger.getLogger(StringResource.javaClass.name).warning(
"String $name cannot contain unescaped quotes in value: $value")

return this;
return this
}

// if the string is un-formatted, explicitly add the formatted attribute
if (!formatted) setAttribute("formatted", "false")

textContent = value.validateAndroidStringEscaping();
textContent = value.validateAndroidStringEscaping()
}

companion object {
Expand Down

0 comments on commit e9be637

Please sign in to comment.