# TODO: Check target_list, this script extract from only them.

import sys
import pathlib
import yaml
import phantom_brigade as pb

# TODO: Set the path to 'Configs' folder
root_path = pathlib.Path('C:/Program Files/Epic Games/PhantomBrigade')
ex = pb.Extractor(root_path)


target_list = [
    'Configs/DataDecomposed/InfoPages']


try:
    for t in target_list:
        target = pathlib.Path(t)
        src_list = list((root_path/target).glob('*.yaml'))
        dst_stem = str(target).replace(target._flavour.sep, '-') + '-EN'
        dst_path = pathlib.Path(dst_stem).with_suffix('.csv')

        with open(dst_path, 'w', encoding='utf-8', errors='strict') as dst:
            ver = ex.getVersion()
            print(ex.ver)
            dst.write(ex.ver + '\n')
            
            for p in src_list:
                src_path = pathlib.Path(p)    
                with open(src_path, 'r', encoding='utf-8', errors='strict') as src:
import os
import sys
import pathlib
import yaml
import csv
import phantom_brigade as pb

ex = pb.Extractor()

# TODO: Set the translation list
csv_path = pathlib.Path('PhantomBrigade-Translation-jp.csv')
root_path = pathlib.Path('PB_Translation-jp')
edit_path = root_path / 'ConfigEdits'

try:
    with open(csv_path, 'r', newline='', encoding='utf-8',
              errors='strict') as csvFile:
        csvReader = csv.DictReader(csvFile)

        folder_buff = pathlib.Path()
        file_buff = pathlib.Path()
        os.makedirs(edit_path, exist_ok=True)

        # TODO: Don't forget ', ' at every end of lines
        dst = open(root_path / 'metadata.yaml',
                   'w',
                   encoding='utf-8',
                   errors='strict')
        dst_data = yaml.load(
            "{"
            "id: PB_Translation-jp, "