Skip to content

Dynamic menus and translates TypedServerCommand. #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add translations to TypedServerCommand.
  • Loading branch information
CookStar committed May 8, 2020
commit 44bf1750261fccd0a8ecbdacfcd07811aba262be
6 changes: 6 additions & 0 deletions addons/source-python/packages/source-python/commands/typed.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from messages import SayText2
from messages import TextMsg
from messages import HudDestination
# Translations
from translations.strings import TranslationStrings


# =============================================================================
Expand Down Expand Up @@ -644,6 +646,10 @@ class TypedServerCommand(_TypedCommand):

@staticmethod
def send_message(command_info, message):
# Translate the message if it's a :class:`TranslationStrings` object.
if isinstance(message, TranslationStrings):
message = message.get_string()

logger.log_message(message)

@classmethod
Expand Down