yourWaifu / deadlock-language-tool

Tool for Deadlock game to handle more languages
0 stars 0 forks source link

Images aren't translated #2

Open yourWaifu opened 3 days ago

yourWaifu commented 3 days ago

There are a few textures with text in them that are different for each language. For the most part, they are simple enough to make them using procedural generation.

lang first_blood kill_streak killing_blow
english first_blood_english_png FIRST\n\u2001BLOOD kill_streak_english_png KILL\n\u2001STREAK killing_blow_english_png Killing Blow
korean first_blood_korean_png 선취점 kill_streak_korean_png 연속\?\?처치 killing_blow_korean_png 마지막 타격

Then there's the question of how to make the UI display them. I don't know, but if you do please reply.

yourWaifu commented 2 days ago

The following PaperScript code recreates the above text style http://sketch.paperjs.org/#V/0.12.18/S/hZRdT4MwFIb/SoM3zLAFmn0Tb9Qs0Whm3JJdiBfdKFtd15rSqdP4323LgMI+hBB6eN+elvMc+HEY2mBn6EzWWC5WjucseKzjDyRAwpmckG8MrkDfDyMRMX1pZaEUzKQSImd09zyZRkqLttD3g+uH8fg2csLcmkrB1/iGUy6MXSznyIXQ90C75wF181sDOGgHQa/baVjzJP6S5ayLJElgPK/pSmL4EzxxwuRUxW4RuTpxo1G4N0gK8rX3P5rAzdRMaaVr/Ok2+2ZHZZag1/FAt9+oWAWXSGK32T7qtIxSIJZS7YVGK0qo994qa7gfhYVU7DYblIJFJB9WxRHaELozJUvV4s0UC5Lsq1aYZpgsVxm8OaexLVOMYsKWSvNb/aADLkFl3dJYxWpFdcuMxHJl8gXd/9Ldq1JmTcK3rLKvVO6ofusf/QSoIyGUmvWGeU/5njlVD3na9FtOftumkiRkgSThWX6KE1nrJXimmTK4eT8Z90lG8AxYaAM8XglYxVgDW7MVIGtoLVsJ1OZrGY5+n2UtD5w5zzriivE0rOKzrkGCB5QO0YXq9zQXGK3fNZXUGb68/v4B image

Looks like the text size and transform needs to be adjusted dynamically for each language.

There's also the question of putting this in something that is CI friendly. Looking into it, there doesn't seem to be a way to with purely just JS in node.js, you have to either use a headless web browser or a native reimplementation of Canvas. Both aren't ideal, but it's mostly just me and my machine who will run the code.