Actually print separation by symbol
This commit is contained in:
parent
75547dbef6
commit
8f768b92fa
25
src/orig.py
25
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='')
|
||||
|
||||
|
|
Loading…
Reference in New Issue