Skip to content

Commit d1eb7d6

Browse files
authored
fix: hide mnemonics on macOS (#856)
1 parent 880ca07 commit d1eb7d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tagstudio/qt/translations.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from collections import defaultdict
22
from pathlib import Path
3+
from platform import system
34
from typing import Any
45

56
import structlog
@@ -28,6 +29,11 @@ def __get_translation_dict(self, lang: str) -> dict[str, str]:
2829
def change_language(self, lang: str):
2930
self._lang = lang
3031
self._strings = self.__get_translation_dict(lang)
32+
if system() == "Darwin":
33+
for k, v in self._strings.items():
34+
self._strings[k] = (
35+
v.replace("&&", "<ESC_AMP>").replace("&", "", 1).replace("<ESC_AMP>", "&&")
36+
)
3137

3238
def __format(self, text: str, **kwargs) -> str:
3339
try:

0 commit comments

Comments
 (0)