From 8f768b92fa46a3b1cf8fdf912c29e9e251dd5e7f Mon Sep 17 00:00:00 2001 From: dusk Date: Sun, 18 Feb 2024 21:03:55 +0100 Subject: [PATCH] Actually print separation by symbol --- src/orig.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/orig.py b/src/orig.py index 78b59a0..210e89a 100755 --- a/src/orig.py +++ b/src/orig.py @@ -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='')