Skip to content

Commit

Permalink
Fixed empty Discord report if Discord lang not English. Fixes #272.
Browse files Browse the repository at this point in the history
  • Loading branch information
aussig committed Sep 27, 2024
1 parent cd69701 commit ea62b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes:

* The Discord report was blank if the Discord language was set to anything other than English
* INF numbers in legend / help window weren't showing the new ones implemented in v4.1.0


Expand Down
6 changes: 5 additions & 1 deletion bgstally/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ def __(string: str, lang: str) -> str:
Returns:
str: Translated string
"""
l10n_path: str = join(bgstally.globals.this.plugin_dir, l10n.LOCALISATION_DIR)
if lang == "" or lang is None: return _(string)

if appversion() < semantic_version.Version('5.12.0'):
l10n_path: str = join(bgstally.globals.this.plugin_dir, l10n.LOCALISATION_DIR)
else:
l10n_path: Path = Path(join(bgstally.globals.this.plugin_dir, l10n.LOCALISATION_DIR))

contents: dict[str, str] = l10n.Translations.contents(lang=lang, plugin_path=l10n_path)

if not contents:
Expand Down

0 comments on commit ea62b67

Please sign in to comment.