Skip to content

Commit

Permalink
locale id defined
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Clauss <[email protected]>
  • Loading branch information
willwade and cclauss authored Nov 14, 2024
1 parent 97dc231 commit c1ad3e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyttsx3/drivers/sapi5.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def buildDriver(proxy):

def lcid_to_locale(language_code):
primary, sub = language_code.split("-")
lcid = (int(sub) << 10) | int(primary)
locale_id = (int(sub) << 10) | int(primary)
try:
return locale.windows_locale[lcid].replace("_", "-")
return locale.windows_locale[locale_id].replace("_", "-")
except KeyError:
return "Unknown Locale"
return f"Unknown Locale: {locale_id}"


# noinspection PyPep8Naming,PyShadowingNames
Expand Down

0 comments on commit c1ad3e7

Please sign in to comment.