Skip to content

Commit

Permalink
Fix translate field name confusion (#608)
Browse files Browse the repository at this point in the history
I am keeping `TranslationTag` as it is, because it is grammatically correct.
  • Loading branch information
PerchunPak authored Aug 10, 2023
1 parent d870849 commit bd74b66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mcstatus/motd/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _check_rgb(rgb: tuple[int, int, int]) -> None:
class TranslationTag:
"""Represents a ``translate`` field in server's answer.
This just exist, but is completely ignored by our transformers.
This just exists, but is completely ignored by our transformers.
You can find translation tags in :attr:`Motd.parsed <mcstatus.motd.Motd.parsed>` attribute.
.. seealso:: `Minecraft's wiki. <https://minecraft.fandom.com/wiki/Raw_JSON_text_format#Translated_Text>`__
Expand Down
4 changes: 2 additions & 2 deletions mcstatus/status_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class RawJavaResponseVersion(TypedDict):
protocol: int

class RawJavaResponseMotdWhenDict(TypedDict, total=False):
text: str # only present if translation is set
translation: str # same to the above field
text: str # only present if `translate` is set
translate: str # same to the above field
extra: list[RawJavaResponseMotdWhenDict]

color: str
Expand Down
4 changes: 2 additions & 2 deletions tests/motd/test_motd.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def test_formatting_key_set_to_false_here_without_it_being_set_to_true_before(se
Formatting.RESET,
]

def test_translation_string(self):
assert Motd.parse(RawJavaResponseMotdWhenDict(translation="the key")).parsed == [
def test_translate_string(self):
assert Motd.parse(RawJavaResponseMotdWhenDict(translate="the key")).parsed == [
TranslationTag("the key"),
Formatting.RESET,
]
Expand Down

0 comments on commit bd74b66

Please sign in to comment.