Skip to content

Commit

Permalink
It looks up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
mchorse committed Jul 1, 2021
1 parent 7930c20 commit bead27f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
53 changes: 53 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,57 @@ task compareLangFiles {
}
}
}
}

task copyLangStrings {
doLast {
def parse = { File file ->
def map = new HashMap()
def splits = file.text.split("\n");

for (split in splits) {
def index = split.indexOf("=")

if (index == -1) {
continue
}

map.put(split.substring(0, index), split.substring(index + 1))
}

return map
}

def help = file("src/main/resources/assets/${project.archivesBaseName}/lang/")
def en = file("${help.getAbsolutePath()}/en_US.lang")

for (file in help.listFiles())
{
if (file.name.endsWith(".lang") && !file.name.startsWith("en_"))
{
def strings = parse(file)
def splits = en.text.split("\n")

for (def i = 0; i < splits.length; i++) {
def str = splits[i];

if (str.contains("=")) {
def index = str.indexOf("=")
def key = str.substring(0, index)
def value = str.substring(index)

if (strings.containsKey(key)) {
splits[i] = key + "=" + strings.get(key)
}
}
}

file.write(splits.join("\n"))

print("Wrote to ${file.name}...")
}
}

print("Done!")
}
}
2 changes: 1 addition & 1 deletion src/main/resources/assets/chameleon/lang/ru_ru.lang
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ chameleon.gui.config.wiki=Вики

# Morph stuff
morph.section.chameleon=Chameleon (при поддержке GeckoLib)
morph.category.chameleon=Анимированные модели
morph.category.chameleon=Анимированные модели
3 changes: 1 addition & 2 deletions src/main/resources/assets/chameleon/lang/uk_ua.lang
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ chameleon.config.general.tooltip=Загальні налаштування
# GUI
chameleon.gui.editor.pick_skin=Обрати скін
chameleon.gui.editor.main=Головна панель
chameleon.gui.editor.body_part=Частини тіла
chameleon.gui.editor.create_pose=Створити позу
chameleon.gui.editor.reset_pose=Скинути позу
chameleon.gui.editor.fixed=Зафіксувати рух
Expand All @@ -36,4 +35,4 @@ chameleon.gui.config.wiki=Вікі

# Morph stuff
morph.section.chameleon=Хамелеон (за підтримки GeckoLib)
morph.category.chameleon=Анімовані моделі
morph.category.chameleon=Анімовані моделі

0 comments on commit bead27f

Please sign in to comment.