Skip to content

Commit

Permalink
Query WotLK Wowhead instead of TBC
Browse files Browse the repository at this point in the history
  • Loading branch information
Molkree committed Oct 3, 2022
1 parent a7b2027 commit 0e851da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .contrib/.tools/Localization/localize_all_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from object_localization import LOCALES_DIR, LangCode, localize_objects


async def main():
async def main() -> None:
async with aiohttp.ClientSession() as session:
original_obj_names = await localize_objects(
session, f"{LOCALES_DIR}deDE.lua", LangCode.DEUTSCH
Expand Down
10 changes: 7 additions & 3 deletions .contrib/.tools/Localization/object_localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class LangCode(Enum):
class GameFlavor(Enum):
RETAIL = ""
CLASSIC = "classic"
TBC = "tbc"
# TBC = "tbc" # no live TBC realms anymore
WOTLK = "wotlk"


async def get_localized_obj_name_flavor(
Expand All @@ -49,9 +50,12 @@ async def get_localized_obj_name_flavor(
url = "https://"
if lang_code != LangCode.ENGLISH:
url += f"{lang_code.value}."
if game_flavor != GameFlavor.RETAIL:
if game_flavor == GameFlavor.CLASSIC:
url += f"{game_flavor.value}."
url += f"wowhead.com/object={obj_id}"
url += "wowhead.com/"
if game_flavor == GameFlavor.WOTLK:
url += f"{game_flavor.value}/"
url += f"object={obj_id}"
try:
async with session.get(url=url) as response:
if "ptr" in response.url.human_repr():
Expand Down

0 comments on commit 0e851da

Please sign in to comment.