#localization line balancer

1 messages · Page 1 of 1 (latest)

latent vigil
#

this balances a single localization line into the most "optimal" partition

  • deno run -A balance-lines.js "<your line here>"
  • if you don't have deno, replace the first three lines in the file with const lines = "<your line here>" and paste and run it in a browser console
  • it will output the top 5 results based on least variance but also prefers longer lines
  • to get longer or shorter lines, change the maxLineLength to whatever you like
  • and obviously it filters out text styling stuff like {C:blue} and #1# to get the actual length
  • i will eventually put this into a simple web app or even transpile it to lua so you can just include it in your mod, both should be simple
  • eventually an automated version that goes processes multiple lines should also be made

license: 0BSD - basically i don't care what you do with it and you don't need to credit me


example

deno run -A balance-lines.js "{C:green}#1# in #2#{} chance to debuff a random joker before scoring"

will output these

[
  [
    "{C:green}#1# in #2#{} chance to debuff a",
    "random joker before scoring"
  ],
  [
    "{C:green}#1# in #2#{}",
    "chance to",
    "debuff a",
    "random",
    "joker",
    "before",
    "scoring"
  ],
  [
    "{C:green}#1# in #2#{} chance to",
    "debuff a random",
    "joker before scoring"
  ],
  [
    "{C:green}#1# in #2#{} chance to",
    "debuff a",
    "random joker",
    "before scoring"
  ],
  [
    "{C:green}#1# in #2#{}",
    "chance",
    "to",
    "debuff a",
    "random",
    "joker",
    "before",
    "scoring"
  ]
]

variation 1 and 3 look nice, yay

#

localization line balancer

clever pollen
#

-# This is coming in handy, tbh. 👏

rich breach
#

owo

latent vigil
#

reminder that i should heavily improve the DX of this

#

"paste and run it in a browser console" is NOT it lmao