Skip to content

Commit

Permalink
Merge pull request #110 from LmeSzinc/dev
Browse files Browse the repository at this point in the history
Add Spanish language
  • Loading branch information
LmeSzinc authored Sep 25, 2023
2 parents 3ffc955 + 166d421 commit c1ff0bd
Show file tree
Hide file tree
Showing 44 changed files with 640 additions and 69 deletions.
Binary file added assets/share/base/page/GACHA_CHECK.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dev_tools/keyword_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from module.config.utils import deep_get, read_file
from module.logger import logger

UI_LANGUAGES = ['cn', 'cht', 'en', 'jp']
UI_LANGUAGES = ['cn', 'cht', 'en', 'jp', 'es']


def text_to_variable(text):
Expand Down
3 changes: 2 additions & 1 deletion module/config/config_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class GeneratedConfig:
'en-US': 'en',
'ja-JP': 'jp',
'zh-TW': 'cht',
'es-ES': 'es',
}


Expand Down Expand Up @@ -351,7 +352,7 @@ def deep_load(keys, default=True, words=('name', 'help')):
# deep_set(new, keys=path, value=f'[{prefix}] {_list[index]}')

# Dungeon names
if lang not in ['zh-CN', 'zh-TW', 'en-US']:
if lang not in ['zh-CN', 'zh-TW', 'en-US', 'es-ES']:
ingame_lang = gui_lang_to_ingame_lang(lang)
from tasks.dungeon.keywords import DungeonList
dailies = deep_get(self.argument, keys='Dungeon.Name.option')
Expand Down
66 changes: 42 additions & 24 deletions module/config/i18n/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
"name": "Encargos",
"help": ""
},
"DataUpdate": {
"name": "Actualizar panel",
"help": ""
},
"Rogue": {
"name": "Universo Simulado",
"help": "El Universo Simulado está en desarrollo, y no se ejecutará"
Expand Down Expand Up @@ -349,7 +353,7 @@
"Bronya": "Bronya",
"Clara": "Clara",
"DanHeng": "Dan Heng",
"DanHengImbibitorLunae": "Dan Heng Imbibitor Lunae",
"DanHengImbibitorLunae": "Dan Heng - Imbibitor Lunae",
"FuXuan": "Fu Xuan",
"Gepard": "Gepard",
"Herta": "Herta",
Expand All @@ -360,7 +364,7 @@
"Luka": "Luka",
"Luocha": "Luocha",
"Lynx": "Lynx",
"March7th": "March 7th",
"March7th": "Siete de Marzo",
"Natasha": "Natasha",
"Pela": "Pela",
"Qingque": "Qingque",
Expand Down Expand Up @@ -422,56 +426,56 @@
"not_supported": "No soportado aún"
},
"Clear_Stagnant_Shadow_1_times": {
"name": "Completa Sombra paralizada 1 vez",
"name": "Completa Sombra paralizada 1 veces",
"help": "Necesitas configurar y activar la tarea \"Mazmorra\"",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Clear_Cavern_of_Corrosion_1_times": {
"name": "Completa Caverna de la corrosión 1 vez",
"name": "Completa Caverna de la corrosión 1 veces",
"help": "Necesitas configurar y activar la tarea \"Mazmorra\"",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"In_a_single_battle_inflict_3_Weakness_Break_of_different_Types": {
"name": "En una sola batalla, inflinge 3 tipos de Ruptura de diferente tipo",
"name": "En una sola batalla, inflige 3 tipos de Ruptura de Debilidad",
"help": "Completable por defecto, se hará el desafío de Himeko",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Inflict_Weakness_Break_5_times": {
"name": "Inflinge ruptura de debilidad 5 veces",
"name": "Inflige Ruptura de Debilidad 5 veces",
"help": "Completable por defecto, se hará el desafío de Himeko",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Defeat_a_total_of_20_enemies": {
"name": "Derrota un total de 20 enemigos",
"name": "Derrota a 20 enemigos",
"help": "Completable por defecto, se hará el desafío de Himeko",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Enter_combat_by_attacking_enemy_Weakness_and_win_3_times": {
"name": "Entra en combate atacando la Debilidad de un enemigo y gana 3 veces",
"name": "Entra en combate atacando la debilidad del enemigo y gana 3 veces",
"help": "Completable por defecto, se hará el desafío de Himeko",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Use_Technique_2_times": {
"name": "Usar la Técnica 2 veces.",
"name": "Usa técnicas 2 veces",
"help": "Alcanzable por defecto, irá al abismo y usará la técnica 2 veces.",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Go_on_assignment_1_time": {
"name": "Asigna un encargo 1 vez",
"name": "Asigna un encargo",
"help": "Necesitas configurar y activar la tarea de \"Encargos\"",
"achievable": "Completable",
"not_set": "No configurado",
Expand All @@ -485,91 +489,91 @@
"not_supported": "No soportado aún"
},
"Destroy_3_destructible_objects": {
"name": "Rompe 3 objetos destructibles",
"name": "Destruye 3 objetos destruibles",
"help": "Completable por defecto, se hará el desafío de Himeko",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Complete_Forgotten_Hall_1_time": {
"name": "Completa Salón Olvidado 1 vez",
"name": "Completa el Salón olvidado 1 vez",
"help": "Completable por defecto, se seleccionarán los primeros 4 personajes y se hará el primer nivel. Por favor, asegúrate de que estos pueden hacerlo.",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Complete_Echo_of_War_1_times": {
"name": "Completa Ecos de la guerra 1 vez.",
"name": "Completa Ecos de la guerra 1 vez",
"help": "",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Complete_1_stage_in_Simulated_Universe_Any_world": {
"name": "Completa 1 nivel de Universo Simulado",
"name": "Supera 1 zona del Universo Simulado (cualquier mundo)",
"help": "",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Obtain_victory_in_combat_with_support_characters_1_time": {
"name": "Gana 1 combate con un personaje de apoyo.",
"name": "Gana 1 batalla utilizando personajes de apoyo",
"help": "Necesitas configurar la tarea de \"Mazmorra\", así como configurar a los héroes de apoyo.",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Use_an_Ultimate_to_deal_the_final_blow_1_time": {
"name": "Usa la habilidad definitiva para asestar un golpe final.",
"name": "Asesta el golpe final con una habilidad definitiva 1 vez",
"help": "Completable por defecto, se hará el desafío de Himeko",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Level_up_any_character_1_time": {
"name": "Sube de nivel cualquier personaje 1 vez.",
"name": "Mejora el nivel de cualquier personaje 1 vez",
"help": "",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Level_up_any_Light_Cone_1_time": {
"name": "Sube de nivel cualquier Cono de luz 1 vez.",
"name": "Mejora cualquier cono de luz 1 vez",
"help": "",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Level_up_any_Relic_1_time": {
"name": "Sube de nivel cualquier Reliquia 1 vez.",
"name": "Mejora cualquier artefacto 1 vez",
"help": "",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Salvage_any_Relic": {
"name": "Destruye cualquier Reliquia",
"name": "Destruye 1 artefacto",
"help": "Completable por defecto. Se destruirá la última ordenado ascendentemente por rareza.",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Synthesize_Consumable_1_time": {
"name": "Sintetiza cualqueir consumible 1 vez.",
"name": "Sintetiza consumibles 1 vez",
"help": "Completable por defecto, se sintetizará un snack.",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Synthesize_material_1_time": {
"name": "Sintetiza cualquier material 1 vez.",
"name": "Sintetiza materiales 1 vez",
"help": "Completable por defecto, se sintetizará un material de nivel bajo.",
"achievable": "Completable",
"not_set": "No configurado",
"not_supported": "No soportado aún"
},
"Use_Consumables_1_time": {
"name": "Usa consumibles 1 vez",
"name": "Usa 1 consumible",
"help": "Completable por defecto. Se sintetizará uno si no tienes ninguno.",
"achievable": "Completable",
"not_set": "No configurado",
Expand Down Expand Up @@ -698,6 +702,20 @@
"help": ""
}
},
"ItemStorage": {
"_info": {
"name": "",
"help": ""
},
"Credit": {
"name": "Crédito",
"help": ""
},
"StallerJade": {
"name": "Jade",
"help": ""
}
},
"RoguePath": {
"_info": {
"name": "Ajustes de Vía",
Expand Down Expand Up @@ -887,4 +905,4 @@
"Clear": "Limpiar"
}
}
}
}
2 changes: 1 addition & 1 deletion module/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import module.config.server as server_
from module.config.atomicwrites import atomic_write

LANGUAGES = ['zh-CN', 'en-US', 'ja-JP', 'zh-TW']
LANGUAGES = ['zh-CN', 'en-US', 'ja-JP', 'zh-TW', 'es-ES']
SERVER_TO_TIMEZONE = {
'CN-Official': timedelta(hours=8),
'CN-Bilibili': timedelta(hours=8),
Expand Down
12 changes: 12 additions & 0 deletions module/ocr/keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Keyword:
en: str
jp: str
cht: str
es: str

"""
Instance attributes and methods
Expand All @@ -47,6 +48,10 @@ def jp_parsed(self) -> str:
def cht_parsed(self) -> str:
return parse_name(self.cht)

@cached_property
def es_parsed(self) -> str:
return parse_name(self.cht)

def __str__(self):
return f'{self.__class__.__name__}({self.name})'

Expand Down Expand Up @@ -87,20 +92,27 @@ def _keywords_to_find(self, lang: str = None, ignore_punctuation=True):
return [self.cht_parsed]
else:
return [self.cht]
case 'es':
if ignore_punctuation:
return [self.es_parsed]
else:
return [self.es]
else:
if ignore_punctuation:
return [
self.cn_parsed,
self.en_parsed,
self.jp_parsed,
self.cht_parsed,
self.es_parsed,
]
else:
return [
self.cn,
self.en,
self.jp,
self.cht,
self.es,
]

"""
Expand Down
1 change: 1 addition & 0 deletions module/webui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ def set_theme(t):
{"label": "繁體中文", "value": "zh-TW"},
{"label": "English", "value": "en-US"},
{"label": "日本語", "value": "ja-JP"},
{"label": "Español", "value": "es-ES"},
],
onclick=lambda l: set_language(l),
).style("text-align: center")
Expand Down
22 changes: 17 additions & 5 deletions route/daily/HimekoTrial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from module.logger import logger
from tasks.combat.combat import Combat
from tasks.daily.assets.assets_daily_trial import START_TRIAL
from tasks.daily.assets.assets_daily_trial import INFO_CLOSE, START_TRIAL
from tasks.daily.trail import CharacterTrial
from tasks.map.control.waypoint import Waypoint
from tasks.map.keywords.plane import Jarilo_BackwaterPass
Expand All @@ -20,6 +20,11 @@ def combat_end():

return super().wait_next_skill(expected_end=combat_end, skip_first_screenshot=skip_first_screenshot)

def walk_additional(self) -> bool:
if self.appear_then_click(INFO_CLOSE, interval=2):
return True
return super().walk_additional()

def combat_execute(self, expected_end=None):
# Battle 1/3
# Enemy cleared by follow up
Expand All @@ -42,6 +47,9 @@ def combat_execute(self, expected_end=None):
# To achieve In_a_single_battle_inflict_3_Weakness_Break_of_different_Types
self.use_A()
self.wait_next_skill()
# Just whoever user A, in case Himeko Q didn't kill it, usually to be Herta
self.use_A()
self.wait_next_skill()
# Himeko Q
# To achieve Use_an_Ultimate_to_deal_the_final_blow_1_time
# May kill the enemy
Expand All @@ -57,10 +65,14 @@ def combat_execute(self, expected_end=None):

# Combat should end here, just incase
logger.warning(f'Himeko trial is not going as expected')
for _ in range(3):
for _ in range(2):
self.use_E()
if not self.wait_next_skill():
return
for _ in range(10):
self.use_A()
if not self.wait_next_skill():
return

def route_item_enemy(self):
self.enter_himeko_trial()
Expand Down Expand Up @@ -109,11 +121,11 @@ def route_enemy(self):
# Goto boss
self.clear_enemy(
# Before the corner, turn right
Waypoint((571.7, 371.3)).run_2x(),
Waypoint((571.7, 371.3)).run(),
# Go through arched door
Waypoint((581.5, 383.3)).run_2x(),
Waypoint((581.5, 383.3)).run(),
# Boss
Waypoint((613.5, 427.3)).run_2x(),
Waypoint((613.5, 427.3)),
)

def exit(self):
Expand Down
Loading

0 comments on commit c1ff0bd

Please sign in to comment.