Help with MenuButton

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Comet

(Sorry for my english i’m using google translator)
I want to make it so that using the MenuButton it was possible to change the language, but I can’t.
Here are my ideas:

onready var menuButton = get_node('ColorRect/MenuButton')

func _ready():
var popup = menuButton.get_popup()
popup.connect(“id_pressed”, self, “file_menu”)
$ColorRect/MenuButton.get_popup().add_item(‘key_ru’, 0)
$ColorRect/MenuButton.get_popup().add_item(‘key_en’, 1)

func file_menu( id ):
match id:
0:
TranslationServer.translate(‘ru’)
1:
TranslationServer.translate(‘en’)