diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-09-20 00:45:42 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-09-20 00:50:05 +0200 | 
| commit | 3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457 (patch) | |
| tree | 9608ff402d95ea927fb3b0c9dbddd7a927f9bf87 /client/menu | |
| parent | 2b2b1957b80c0743b455e3decba56d0551e69162 (diff) | |
| download | hurrycurry-3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457.tar hurrycurry-3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457.tar.bz2 hurrycurry-3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457.tar.zst | |
replace % operator with String.format()
Diffstat (limited to 'client/menu')
| -rw-r--r-- | client/menu/hairstyle_preview.gd | 2 | ||||
| -rw-r--r-- | client/menu/lobby.gd | 2 | ||||
| -rw-r--r-- | client/menu/popup_message/popup_message.gd | 16 | ||||
| -rw-r--r-- | client/menu/rating/rating.gd | 1 | ||||
| -rw-r--r-- | client/menu/settings/input/input_manager.gd | 8 | 
5 files changed, 15 insertions, 14 deletions
| diff --git a/client/menu/hairstyle_preview.gd b/client/menu/hairstyle_preview.gd index 324f7de1..fb2cabce 100644 --- a/client/menu/hairstyle_preview.gd +++ b/client/menu/hairstyle_preview.gd @@ -21,5 +21,5 @@ signal selected(character: int)  func setup(character: int, group: ButtonGroup):  	$HairViewport/Node3D/Character.select_hairstyle(character)  	$Select.button_group = group -	$Select.text = tr("Hairstyle %d") % (character + 1) +	$Select.text = tr("Hairstyle %d") % (character + 1) # TODO localize  	$Select.pressed.connect(func(): selected.emit(character)) diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd index 39199d59..0dca6f4c 100644 --- a/client/menu/lobby.gd +++ b/client/menu/lobby.gd @@ -105,7 +105,7 @@ func select_map(i: int):  	selected_map = i  	var map_data: Dictionary = game.maps[i][1]  	map_name_label.text = map_data["name"] -	map_player_label.text = tr("c.map.players_recommended") % map_data["players"] +	map_player_label.text = tr("c.map.players_recommended").format([map_data["players"]])  	map_difficulty_label.text = tr("c.map.difficulty.%d" % (map_data["difficulty"] - 1))  	selected_map_name = game.maps[i][0]  	if not game.menu.covered: diff --git a/client/menu/popup_message/popup_message.gd b/client/menu/popup_message/popup_message.gd index ead11977..6413a887 100644 --- a/client/menu/popup_message/popup_message.gd +++ b/client/menu/popup_message/popup_message.gd @@ -153,35 +153,35 @@ func _input(_event):  func _on_boost_timeout():  	if not Global.get_hint("has_boosted") and not Global.using_touch: -		display_hint_msg(tr("c.hint.boost") % display_keybind("boost")) +		display_hint_msg(tr("c.hint.boost").format([display_keybind("boost")]))  func _on_move_timeout():  	if not Global.get_hint("has_moved") and not Global.using_touch: -		display_hint_msg(tr("c.hint.movement") % ", ".join( +		display_hint_msg(tr("c.hint.movement").format([", ".join(  			[  				display_keybind("forwards"),  				display_keybind("left"),  				display_keybind("backwards"),  				display_keybind("right")  			] -		)) +		)]))  func _on_interact_timeout():  	if not Global.get_hint("has_interacted") and not Global.using_touch: -		display_hint_msg(tr("c.hint.interact") % display_keybind("interact")) +		display_hint_msg(tr("c.hint.interact").format([display_keybind("interact")]))  func _on_reset_timeout():  	if not Global.get_hint("has_reset") and not Global.using_touch: -		display_hint_msg(tr("c.hint.reset_camera") % display_keybind("reset")) +		display_hint_msg(tr("c.hint.reset_camera").format([display_keybind("reset")]))  func _on_zoom_timeout():  	if not Global.get_hint("has_zoomed") and not Global.using_touch: -		display_hint_msg(tr("c.hint.zoom_camera") % ", ".join( +		display_hint_msg(tr("c.hint.zoom_camera").format([", ".join(  			[  				display_keybind("zoom_in"),  				display_keybind("zoom_out")  			] -		)) +		)]))  func display_keybind(action_name: String) -> String:  	var events := InputManager.get_events(action_name) @@ -227,7 +227,7 @@ func _on_nametags_timeout():  func _on_join_while_running_timeout():  	if not game.is_joined and not Global.get_hint("has_seen_join_while_running"):  		Global.set_hint("has_seen_join_while_running", true) -		display_hint_msg(tr("c.hint.join_while_running") % display_keybind("menu")) +		display_hint_msg(tr("c.hint.join_while_running").format([display_keybind("menu")]))  func _on_performance_timeout() -> void:  	if not Global.get_hint("has_seen_performance") and Engine.get_frames_per_second() < DisplayServer.screen_get_refresh_rate() * 0.75: diff --git a/client/menu/rating/rating.gd b/client/menu/rating/rating.gd index 1669e5fc..abe4d426 100644 --- a/client/menu/rating/rating.gd +++ b/client/menu/rating/rating.gd @@ -32,6 +32,7 @@ func _process(_delta):  	particles.emission_rect_extents = get_viewport_rect().size * Vector2(0.5, 0.5)  func show_rating(stars_: int, points: int): +	# TODO localize  	match stars_:  		0: title.text = tr("Poor service")  		1: title.text = tr("Acceptable service") diff --git a/client/menu/settings/input/input_manager.gd b/client/menu/settings/input/input_manager.gd index 640410d0..b612bde3 100644 --- a/client/menu/settings/input/input_manager.gd +++ b/client/menu/settings/input/input_manager.gd @@ -93,12 +93,12 @@ func get_event_type(input_event: InputEvent) -> EventType:  func display_input_event(input_event: InputEvent) -> String:  	if input_event is InputEventKey: -		return tr("c.settings.input.keyboard") % OS.get_keycode_string(input_event.physical_keycode) +		return tr("c.settings.input.keyboard").format([OS.get_keycode_string(input_event.physical_keycode)])  	elif input_event is InputEventMouseButton: -		return tr("c.settings.input.mouse_button") % input_event.button_index +		return tr("c.settings.input.mouse_button").format([input_event.button_index])  	elif input_event is InputEventJoypadButton: -		return tr("c.settings.input.joypad") % input_event.button_index +		return tr("c.settings.input.joypad").format([input_event.button_index])  	elif input_event is InputEventJoypadMotion: -		return tr("c.settings.input.joypad_axis") % [input_event.axis] +		return tr("c.settings.input.joypad_axis").format([input_event.axis])  	else:  		return tr("c.settings.input.other_event") | 
