mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-06-13 05:37:41 +02:00
chore: Change localized string log to warning
This commit is contained in:
@ -24,31 +24,31 @@ class StringResource(
|
|||||||
if (value.startsWith('"') && value.endsWith('"')) {
|
if (value.startsWith('"') && value.endsWith('"')) {
|
||||||
// Raw strings allow unescaped single quote but not double quote.
|
// Raw strings allow unescaped single quote but not double quote.
|
||||||
if (!value.substring(1, value.length - 1).contains(Regex("(?<!\\\\)[\"]"))) {
|
if (!value.substring(1, value.length - 1).contains(Regex("(?<!\\\\)[\"]"))) {
|
||||||
return this;
|
return this
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (value.contains('\n')) {
|
if (value.contains('\n')) {
|
||||||
// Don't throw an exception, otherwise unnoticed mistakes
|
// Don't throw an exception, otherwise unnoticed mistakes
|
||||||
// in Crowdin can cause patching failures.
|
// in Crowdin can cause patching failures.
|
||||||
// Incorrectly escaped strings still work but do not display as intended.
|
// 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")
|
"String $name is not raw but contains encoded new line characters: $value")
|
||||||
}
|
}
|
||||||
if (!value.contains(Regex("(?<!\\\\)['\"]"))) {
|
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")
|
"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 the string is un-formatted, explicitly add the formatted attribute
|
||||||
if (!formatted) setAttribute("formatted", "false")
|
if (!formatted) setAttribute("formatted", "false")
|
||||||
|
|
||||||
textContent = value.validateAndroidStringEscaping();
|
textContent = value.validateAndroidStringEscaping()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Reference in New Issue
Block a user