[Solved] Change command text(s) "on_the_fly"

Hi. I am writing an application wich should you allow to make a translatable game (it generates a ruby script from a list *.po files containing all text translations). The generated ruby script almost work, but I have an issue I still cannot solve.

The problem is changing the text on main menu "on the fly".

------------------------

How the script works: it generates a new main menu ("Language") where you can choose one of the available languages. When you choosed a language, all text will be translated correctly in the desired language (and the setting will be saved on a text file, so the next time the game will start with the desired language).

But, unless you close the game and launch it again, main menu items will be not translated.

All vocabs terms are indeed changed when a new language is selected, but I surely need something to "refresh" text commands on main window (probably, if an approach allows you to change the text "on the fly" the same method could be applied on all other texts). Another solution could be "force game to be closed if a new language is selected, allowing that language is changed and game will need to reboot" . However all other translations (example message text) don't actually require a reboot to work, and moreover I don't know what instruction I could use to force a game shutdown.

Any help?
I don't remember if going back to the previous scene refreshed that scene's objects.
it should be a case of simply re-building the main menu.
if your code is correct, then you're already doing it the right way: concentrating all strings into one file, and pointing all string-related operations to that file, as File::String_name.
if that logic applies to the main menu, then it's probably not being rebuilt correctly.

Code:
class Window_TitleCommand < Window_Command
def make_command_list
    add_command(File::translated_new_game_string, :new_game)
    add_command(File::translated_continue_string, :continue, continue_enabled)
    add_command(File::translated_shutdown_string, :shutdown)
  end
end

if your code obeys that structure, then it should work.
notice that Window_TitleCommand is it's own thing.
you need to modify *it*, not the create_command_window function within Scene_Title
create_command_window only assigns functions to it, it doesn't *create* it.
Thank for your reply. I can confirm that going back the window refreshes.
I did some test, assuming you were right, and I understand where is the problem. I did a mistake on designing the Vocab translations.
With the current code, the Vocab can be correctly translated on game startup OR during the runtime ONLY IF the current language is the native game language (when you don't need to change any text).

Now that I understood the problem, I can work on fixing my ruby generator. Thank.

PS: A lot of hard work may wait me. Probably the same problem could be located in all the database translation system :/

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-change-command-text-s-on_the_fly.80497/