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