Fix typo in the Portuguese translation of 'loading textures'

master
Graham 5 years ago
parent 37abac9e48
commit a4cd83fff0
  1. 4
      bundler/src/main/java/dev/openrs2/bundler/Bundler.kt
  2. 40
      bundler/src/main/java/dev/openrs2/bundler/transform/TypoTransformer.kt

@ -13,6 +13,7 @@ import dev.openrs2.bundler.transform.PlatformDetectionTransformer
import dev.openrs2.bundler.transform.PublicKeyTransformer import dev.openrs2.bundler.transform.PublicKeyTransformer
import dev.openrs2.bundler.transform.ResourceTransformer import dev.openrs2.bundler.transform.ResourceTransformer
import dev.openrs2.bundler.transform.RightClickTransformer import dev.openrs2.bundler.transform.RightClickTransformer
import dev.openrs2.bundler.transform.TypoTransformer
import dev.openrs2.common.crypto.Pkcs12KeyStore import dev.openrs2.common.crypto.Pkcs12KeyStore
import java.nio.file.Path import java.nio.file.Path
import java.nio.file.Paths import java.nio.file.Paths
@ -132,7 +133,8 @@ class Bundler @Inject constructor(publicKeyTransformer: PublicKeyTransformer) {
MacResizeTransformer(), MacResizeTransformer(),
RightClickTransformer(), RightClickTransformer(),
LoadLibraryTransformer(), LoadLibraryTransformer(),
PlatformDetectionTransformer() PlatformDetectionTransformer(),
TypoTransformer()
) )
private val unsignedManifest = Manifest() private val unsignedManifest = Manifest()

@ -0,0 +1,40 @@
package dev.openrs2.bundler.transform
import com.github.michaelbull.logging.InlineLogger
import dev.openrs2.asm.classpath.ClassPath
import dev.openrs2.asm.classpath.Library
import dev.openrs2.asm.transform.Transformer
import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.LdcInsnNode
import org.objectweb.asm.tree.MethodNode
class TypoTransformer : Transformer() {
private var errorsFixed = 0
override fun preTransform(classPath: ClassPath) {
errorsFixed = 0
}
override fun transformCode(classPath: ClassPath, library: Library, clazz: ClassNode, method: MethodNode): Boolean {
for (insn in method.instructions) {
if (insn !is LdcInsnNode) {
continue
}
if (insn.cst == "Carregando /secure/libs_v4s/RCras - ") {
insn.cst = "Carregando texturas - "
errorsFixed++
}
}
return false
}
override fun postTransform(classPath: ClassPath) {
logger.info { "Fixed $errorsFixed typographical errors" }
}
companion object {
private val logger = InlineLogger()
}
}
Loading…
Cancel
Save