Skip to content

Commit

Permalink
Use format to make i18n script check happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lykahb committed Sep 26, 2024
1 parent b72e030 commit 40d201b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions katrain/core/game_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]:
Expand Down
2 changes: 1 addition & 1 deletion katrain/gui.kv
Original file line number Diff line number Diff line change
Expand Up @@ -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

<ScrollableLabel>:
Expand Down

0 comments on commit 40d201b

Please sign in to comment.