diff --git a/dev_tools/keywords/base.py b/dev_tools/keywords/base.py index c8804f49e..e44f0ac61 100644 --- a/dev_tools/keywords/base.py +++ b/dev_tools/keywords/base.py @@ -144,7 +144,10 @@ class GenerateKeyword: pass def convert_name(self, text: str, keyword: dict) -> str: - return text_to_variable(text) + return text_to_variable(replace_templates(text)) + + def convert_keyword(self, text: str, lang: str) -> str: + return replace_templates(text) def iter_rows(self) -> t.Iterable[dict]: for keyword in self.iter_keywords(): @@ -163,11 +166,12 @@ class GenerateKeyword: base.update(keyword) # Name _, name = self.find_keyword(text_id, lang='en') - name = self.convert_name(replace_templates(name), keyword=base) + name = self.convert_name(name, keyword=base) base['name'] = name # Translations for lang in UI_LANGUAGES: - value = replace_templates(self.find_keyword(text_id, lang=lang)[1]) + value = self.find_keyword(text_id, lang=lang)[1] + value = self.convert_keyword(value, lang=lang) base[lang] = value return base diff --git a/dev_tools/keywords/dungeon_list.py b/dev_tools/keywords/dungeon_list.py index 334331b4d..9711c070c 100644 --- a/dev_tools/keywords/dungeon_list.py +++ b/dev_tools/keywords/dungeon_list.py @@ -73,6 +73,14 @@ class GenerateDungeonList(GenerateKeyword): text = f'{text}_{plane.name}' return text + def convert_keyword(self, text: str, lang: str) -> str: + text = super().convert_keyword(text, lang=lang) + # Bud of Memories (Jarilo-Ⅵ) + # Use roman numbers instead + text = re.sub(r'-[VⅤ][IⅠ]', '-Ⅵ', text) + + return text + def iter_rows(self) -> t.Iterable[dict]: dungeons = list(super().iter_rows()) calyx = [] @@ -88,7 +96,6 @@ class GenerateDungeonList(GenerateKeyword): ] for keyword in order: condition = lambda x: x['name'].startswith(keyword) - print([d for d in dungeons]) calyx += [d for d in dungeons if condition(d)] dungeons = [d for d in dungeons if not condition(d)] dungeons = calyx + dungeons diff --git a/tasks/dungeon/keywords/dungeon.py b/tasks/dungeon/keywords/dungeon.py index 855bb121e..a0281f6bc 100644 --- a/tasks/dungeon/keywords/dungeon.py +++ b/tasks/dungeon/keywords/dungeon.py @@ -8,9 +8,9 @@ Calyx_Golden_Memories_Jarilo_VI = DungeonList( name='Calyx_Golden_Memories_Jarilo_VI', cn='回忆之蕾•雅利洛-Ⅵ', cht='回憶之蕾•雅利洛-Ⅵ', - en='Bud of Memories (Jarilo-VI)', - jp='回憶の蕾・ヤリーロ-VI', - es='Flor de los recuerdos (Jarilo-VI)', + en='Bud of Memories (Jarilo-Ⅵ)', + jp='回憶の蕾・ヤリーロ-Ⅵ', + es='Flor de los recuerdos (Jarilo-Ⅵ)', plane_id=2010101, ) Calyx_Golden_Aether_Jarilo_VI = DungeonList( @@ -18,9 +18,9 @@ Calyx_Golden_Aether_Jarilo_VI = DungeonList( name='Calyx_Golden_Aether_Jarilo_VI', cn='以太之蕾•雅利洛-Ⅵ', cht='乙太之蕾•雅利洛-Ⅵ', - en='Bud of Aether (Jarilo-VI)', - jp='エーテルの蕾・ヤリーロ-VI', - es='Flor de éter (Jarilo-VI)', + en='Bud of Aether (Jarilo-Ⅵ)', + jp='エーテルの蕾・ヤリーロ-Ⅵ', + es='Flor de éter (Jarilo-Ⅵ)', plane_id=2011101, ) Calyx_Golden_Treasures_Jarilo_VI = DungeonList( @@ -28,9 +28,9 @@ Calyx_Golden_Treasures_Jarilo_VI = DungeonList( name='Calyx_Golden_Treasures_Jarilo_VI', cn='藏珍之蕾•雅利洛-Ⅵ', cht='藏珍之蕾•雅利洛-Ⅵ', - en='Bud of Treasures (Jarilo-VI)', - jp='秘蔵の蕾・ヤリーロ-VI', - es='Flor de tesoros (Jarilo-VI)', + en='Bud of Treasures (Jarilo-Ⅵ)', + jp='秘蔵の蕾・ヤリーロ-Ⅵ', + es='Flor de tesoros (Jarilo-Ⅵ)', plane_id=2012101, ) Calyx_Golden_Memories_The_Xianzhou_Luofu = DungeonList( diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index ba0a14e11..d290fadc9 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -80,7 +80,7 @@ class OcrDungeonNav(Ocr): class OcrDungeonList(Ocr): def after_process(self, result): # 乙太之蕾•雅利洛-Ⅵ - result = result.replace('-VI', '-Ⅵ') + result = re.sub(r'-[VⅤ][IⅠ]', '-Ⅵ', result) result = super().after_process(result)