Actually print separation by symbol

This commit is contained in:
Dusk 2024-02-18 21:03:55 +01:00
parent 75547dbef6
commit 8f768b92fa
1 changed files with 13 additions and 12 deletions

View File

@ -64,6 +64,10 @@ def get_symbols(line: str) -> list[str]:
continue
symbol = line[x:i]
# The i is going to get incremented
# later, gotta have to account that
i -= 1
break
elif line[i] == '!':
raise Exception('Unhandled symbol', line)
@ -72,7 +76,7 @@ def get_symbols(line: str) -> list[str]:
i += 1
continue
# Only reaches this if it's a
# Only reaches this if it's a symbol
if inbetween > 0:
res.append(symbol)
else:
@ -107,29 +111,26 @@ def write_translated(outfile, origfile, translation_file_paths):
amount = line.count("@") + line.count("¥") + line.count('/')
symbols = get_symbols(line)
print(symbols, line, end='')
continue
print("\n-", transfilepath, symbols)
outfile.write('`')
_printed_line = ""
while True:
if amount <= 0:
break
if structure[0].type == 'Line_ContinueAfterTyping':
amount += 1
_printed_line += structure[0].text_jp
outfile.write(
unidecode(structure.pop(0).text_en).replace("\\", "¥")
unidecode(structure.pop(0).text_en)
)
amount -= 1
if len(symbols) > 0:
_printed_line += symbols[0]
outfile.write(symbols.pop(0))
if len(symbols) <= 0:
break
outfile.write('\n')
print("\n-", transfilepath)
print(">", _printed_line)
print("<", line, end='')