From 40d201bbe8045ee0aa552e73720104a9f1a3016f Mon Sep 17 00:00:00 2001 From: Borys Lykah Date: Thu, 26 Sep 2024 17:11:36 -0600 Subject: [PATCH] Use format to make i18n script check happy --- katrain/core/game_node.py | 4 ++-- katrain/gui.kv | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/katrain/core/game_node.py b/katrain/core/game_node.py index 57170388..702ae34f 100644 --- a/katrain/core/game_node.py +++ b/katrain/core/game_node.py @@ -293,7 +293,7 @@ def format_score(self, score=None): score = score or self.score if score is not None: leading_player = 'B' if score >= 0 else 'W' - leading_player_color = i18n._('short color ' + leading_player) + leading_player_color = i18n._(f"short color {leading_player}") return f"{leading_player_color}+{abs(score):.1f}" @property @@ -305,7 +305,7 @@ def format_winrate(self, win_rate=None): win_rate = win_rate or self.winrate if win_rate is not None: leading_player = 'B' if win_rate > 0.5 else 'W' - leading_player_color = i18n._('short color ' + leading_player) + leading_player_color = i18n._(f"short color {leading_player}") return f"{leading_player_color} {max(win_rate,1-win_rate):.1%}" def move_policy_stats(self) -> Tuple[Optional[int], float, List]: diff --git a/katrain/gui.kv b/katrain/gui.kv index ca68450e..30aeb32a 100644 --- a/katrain/gui.kv +++ b/katrain/gui.kv @@ -499,7 +499,7 @@ StatsLabel: id: pointloss_label label: i18n._('stats:pointslost') if root.points_lost is None or root.points_lost > 0 else i18n._('stats:pointsgained') - text: '{}: {:.1f}'.format(i18n._('short color ' + root.player), abs(root.points_lost)) if root.points_lost is not None else '...' + text: '{}: {:.1f}'.format(i18n._(f'short color {root.player}'), abs(root.points_lost)) if root.points_lost is not None else '...' color: Theme.POINTLOSS_COLOR :