Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/menu_map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ User Pref...
Direction of the azimuth Push-To arrows. Values: Default, Reverse. Set
this to match how you read the arrows at the telescope.
Language
Interface language. Values: English, German, French, Spanish, Chinese.
Interface language. Values: English, German, French, Spanish, Chinese, Korean.
Chart...
How the Chart screen draws the sky.

Expand Down
2 changes: 1 addition & 1 deletion python/PiFinder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ def main(
rlogger.warning("using no keyboard")

if args.lang:
if args.lang.lower() not in ["en", "de", "fr", "es", "zh"]:
if args.lang.lower() not in ["en", "de", "fr", "es", "zh", "ko"]:
raise Exception(f"Unknown language '{args.lang}' passed via command line.")
else:
config.Config().set_option("language", args.lang)
Expand Down
2 changes: 1 addition & 1 deletion python/PiFinder/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def solution(self):
def server_locale():
# Try to get from user preferences, session, or accept languages
# For now, default to English
return request.accept_languages.best_match(["en", "fr", "de", "es", "zh"]) or "en"
return request.accept_languages.best_match(["en", "fr", "de", "es", "zh", "ko"]) or "en"


class Server:
Expand Down
4 changes: 2 additions & 2 deletions python/PiFinder/ui/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ def switch_language(ui_module: UIModule) -> None:
)
lang.install()
logger.info("Switch Language: %s", iso2_code)
if iso2_code == "zh":
# Chinese requires a new font, so we have to restart
if iso2_code in ("zh", "ko"):
# CJK languages require a different font, so we have to restart
restart_pifinder(ui_module)


Expand Down
14 changes: 6 additions & 8 deletions python/PiFinder/ui/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@ def __init__(
):
font_path = str(Path(utils.pifinder_dir, "fonts"))

# Check for chinese language specifically
# CJK languages (zh, ko) need a font with Han/Hangul glyphs
cfg = config.Config()
lang = cfg.get_option("language", "en")
if lang == "zh":
# Use Chinese font for Chinese language
chinesettf = str(
Path(font_path, "sarasa-mono-sc-light-nerd-font+patched.ttf")
)
boldttf = chinesettf
regularttf = chinesettf
if lang in ("zh", "ko"):
# Sarasa Mono covers both Chinese (Han) and Korean (Hangul)
cjkttf = str(Path(font_path, "sarasa-mono-sc-light-nerd-font+patched.ttf"))
boldttf = cjkttf
regularttf = cjkttf
use_layout_engine = False
else:
# Use default fonts for other languages
Expand Down
5 changes: 5 additions & 0 deletions python/PiFinder/ui/menu_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _(key: str) -> Any:
s = _("Language: es")
s = _("Language: fr")
s = _("Language: zh")
s = _("Language: ko")
s = s
del s

Expand Down Expand Up @@ -746,6 +747,10 @@ def _(key: str) -> Any:
"name": _("Chinese"),
"value": "zh",
},
{
"name": _("Korean"),
"value": "ko",
},
],
},
],
Expand Down
Binary file modified python/locale/de/LC_MESSAGES/messages.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions python/locale/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3444,3 +3444,13 @@ msgstr "Muss zwischen %(minimum)s und %(maximum)s liegen"
#, python-format
msgid "Must be %(maximum)s characters or fewer"
msgstr "Darf höchstens %(maximum)s Zeichen lang sein"

# AI-TRANSLATED (claude): needs human review
#: PiFinder/ui/menu_structure.py:36
msgid "Language: ko"
msgstr "Sprache: Koreanisch"

# AI-TRANSLATED (claude): needs human review
#: PiFinder/ui/menu_structure.py:751
msgid "Korean"
msgstr "Koreanisch"
Binary file modified python/locale/es/LC_MESSAGES/messages.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions python/locale/es/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3546,3 +3546,13 @@ msgstr "Debe estar entre %(minimum)s y %(maximum)s"
#, python-format
msgid "Must be %(maximum)s characters or fewer"
msgstr "No puede tener más de %(maximum)s caracteres"

# AI-TRANSLATED (claude): needs human review
#: PiFinder/ui/menu_structure.py:36
msgid "Language: ko"
msgstr "Idioma: Coreano"

# AI-TRANSLATED (claude): needs human review
#: PiFinder/ui/menu_structure.py:751
msgid "Korean"
msgstr "Coreano"
Binary file modified python/locale/fr/LC_MESSAGES/messages.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions python/locale/fr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3624,3 +3624,13 @@ msgstr "Doit être compris entre %(minimum)s et %(maximum)s"
#, python-format
msgid "Must be %(maximum)s characters or fewer"
msgstr "Ne doit pas dépasser %(maximum)s caractères"

# AI-TRANSLATED (claude): needs human review
#: PiFinder/ui/menu_structure.py:36
msgid "Language: ko"
msgstr "Langue: ko"

# AI-TRANSLATED (claude): needs human review
#: PiFinder/ui/menu_structure.py:751
msgid "Korean"
msgstr "Coréen"
Binary file added python/locale/ko/LC_MESSAGES/messages.mo
Binary file not shown.
Loading