Skip to content

Commit

Permalink
Update docstrings in language.py
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Nov 8, 2023
1 parent 595cd78 commit 4e0635c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pykotor/common/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class Language(IntEnum):
GERMAN = 2
ITALIAN = 3
SPANISH = 4

# Polish might require a different KOTOR executable. It is believed the games are hardcoded to the encoding 'cp-1252', but polish requires 'cp-1250'.
# The TSL Aspyr patch did not support the Polish language which further supports this theory.
POLISH = 5

# The following languages are not used in any official KOTOR releases, however are supported in the TLK/GFF file formats.
Expand All @@ -35,6 +38,7 @@ def get_encoding(self):
"""Get the encoding for the specified language."""
if self in (Language.ENGLISH, Language.FRENCH, Language.GERMAN, Language.ITALIAN, Language.SPANISH):
return "windows-1252"

if self == Language.POLISH:
return "windows-1250"

Expand All @@ -43,7 +47,7 @@ def get_encoding(self):
if self == Language.CHINESE_TRADITIONAL:
return "big5"
if self == Language.CHINESE_SIMPLIFIED:
return "gb2312" # TODO: This encoding might not be accurate, KOTOR could easily support "gb18030" or "GBK" but would need testing. "gb2312" is the safest option.
return "gb2312" # This encoding might not be accurate. The TLK/GFF formats could easily support "gb18030" or "GBK" but would need testing. "gb2312" is the safest option when unknown.
if self == Language.JAPANESE:
return "shift_jis"
msg = f"No encoding defined for language: {self.name}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/holopatcher/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExitCode(IntEnum):
EXCEPTION_DURING_INSTALL = 7
INSTALL_COMPLETED_WITH_ERRORS = 8


# Please be careful modifying this functionality as 3rd parties depend on this syntax.
def parse_args() -> Namespace:
parser = ArgumentParser(description="HoloPatcher CLI")

Expand Down

0 comments on commit 4e0635c

Please sign in to comment.