mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-23 21:01:22 +02:00
splited .po files for cards, levels and some one
This commit is contained in:
parent
e80596219a
commit
c2e0eaffb6
10 changed files with 583 additions and 165 deletions
|
@ -13,7 +13,7 @@ func load(path):
|
|||
|
||||
var level_names = []
|
||||
var dir = Directory.new()
|
||||
dir.open("res://levels/" + game.os_lang + "/%s" % slug)
|
||||
dir.open("res://levels/%s" % slug)
|
||||
dir.list_dir_begin()
|
||||
|
||||
while true:
|
||||
|
@ -28,7 +28,7 @@ func load(path):
|
|||
|
||||
var final_level_sequence = []
|
||||
|
||||
var level_sequence = Array(helpers.read_file("res://levels/" + game.os_lang + "/%s/sequence" % slug, "").split("\n"))
|
||||
var level_sequence = Array(helpers.read_file("res://levels/%s/sequence" % slug, "").split("\n"))
|
||||
|
||||
for level in level_sequence:
|
||||
if level == "":
|
||||
|
@ -42,7 +42,7 @@ func load(path):
|
|||
|
||||
for l in final_level_sequence:
|
||||
var level = Level.new()
|
||||
level.load("res://levels/" + game.os_lang + "/%s/%s" % [slug, l])
|
||||
level.load("res://levels/%s/%s" % [slug, l])
|
||||
levels.push_back(level)
|
||||
|
||||
func _to_string():
|
||||
|
|
|
@ -20,9 +20,9 @@ func load(path):
|
|||
# This is a new-style level.
|
||||
var config = helpers.parse(path)
|
||||
|
||||
title = config.get("title", slug)
|
||||
print(tr(title))
|
||||
title = tr(config.get("title", slug))
|
||||
description = config.get("description", "(no description)")
|
||||
description = tr(description.replace("\"", "\'"))
|
||||
|
||||
# Surround all lines indented with four spaces with [code] tags.
|
||||
var monospace_regex = RegEx.new()
|
||||
|
@ -31,9 +31,11 @@ func load(path):
|
|||
description = description.split("---")
|
||||
|
||||
var cli_hints = config.get("cli", "")
|
||||
cli_hints = tr(cli_hints.replace("\"", "\'"))
|
||||
# Also do this substitution in the CLI hints.
|
||||
cli_hints = monospace_regex.sub(cli_hints, "\n [code][color=#bbbb5d]$1[/color][/code]", true)
|
||||
|
||||
|
||||
# Also replace `code` with [code] tags.
|
||||
var monospace_inline_regex = RegEx.new()
|
||||
monospace_inline_regex.compile("`([^`]+)`")
|
||||
|
@ -43,7 +45,9 @@ func load(path):
|
|||
if cli_hints != "":
|
||||
description[0] = description[0] + "\n\n[color=#787878]"+cli_hints+"[/color]"
|
||||
|
||||
congrats = config.get("congrats", tr("Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next level'."))
|
||||
congrats = config.get("congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next level'.")
|
||||
congrats = congrats.replace("\"", "\'")
|
||||
congrats = tr(congrats)
|
||||
cards = Array(config.get("cards", "").split(" "))
|
||||
if cards == [""]:
|
||||
cards = []
|
||||
|
|
|
@ -3,14 +3,13 @@ extends Node
|
|||
var chapters
|
||||
|
||||
func _ready():
|
||||
var lang = game.os_lang
|
||||
reload()
|
||||
|
||||
func reload():
|
||||
chapters = []
|
||||
|
||||
var dir = Directory.new()
|
||||
dir.open("res://levels/" + game.os_lang)
|
||||
dir.open("res://levels/")
|
||||
dir.list_dir_begin()
|
||||
|
||||
var chapter_names = []
|
||||
|
@ -27,7 +26,7 @@ func reload():
|
|||
|
||||
var final_chapter_sequence = []
|
||||
|
||||
var chapter_sequence = Array(helpers.read_file("res://levels/" + game.os_lang + "/sequence", "").split("\n"))
|
||||
var chapter_sequence = Array(helpers.read_file("res://levels/sequence", "").split("\n"))
|
||||
|
||||
for chapter in chapter_sequence:
|
||||
if chapter == "":
|
||||
|
@ -41,5 +40,5 @@ func reload():
|
|||
|
||||
for c in final_chapter_sequence:
|
||||
var chapter = Chapter.new()
|
||||
chapter.load("res://levels/" + game.os_lang + "/%s" % c)
|
||||
chapter.load("res://levels/%s" % c)
|
||||
chapters.push_back(chapter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue