Open gioisco opened 2 years ago
Ah.
I had started thinking about that never went through with a solution.
(The resetstatic
command was part of that...)
There is a way to check language, because the locale is saved in config.sh
when you run GameShell the first time.
There are questions I don't know how to answer like "what happens if we switch from en_US
to en_GB
, but they are probably not relevant for now.
Because of the way translations are handled, the only practical solution is the first one. If we detect that the language is different, we should display a warning and ask for confirmation before running resetstatic
.
The reason I had stopped is that I don't want to run rm -rf $GSH_HOME/
because it contains the journal, which should probably be kept. Keeping the whole content of $GSH_CHEST
and moving it into the translated chest is probably enough though.
Does anyone see any problem with that solution?
I don't see any issues on that, the journal is important.
Good, I'll try doing that when I have some time!
When I play the game and I want to change the language, my expected behavior was: a) descriptions in the game and the folders in other language or b) only descriptions of the game in other language
The real behavior instead is more strange
1) Start the game with
./start.sh
2) Show folders with 'ls'3) Exit with
gsh exit
4) Start the game in other language with./start.sh -L fr
5) I don't want to start new game (I may be already complete some mission)6) Show folders and...
I have the extra folder
Chateau
! (because the script of the first mission create the./Chateau/Donjon/Premier_etage/Deuxieme_etage/Haut_du_donjon/
folders)My expected behavios was
For a) descriptions in the game and the folders in other language
1) Start the game with
./start.sh
2) Show folders with 'ls'3) Exit with
gsh exit
4) Start the game in other language with./start.sh -L fr
5) Show message to continue or start new game 6) If the last choice was N AND the language is different from the last run (I don't know how to check this) 7) Translate all folders. This is is now possible running follow command at startup:For b) only descriptions of the game in other language (this is more complicated)
Same as above, but in the step 7) 7) Ask if you want to translate folders (default N) 8a) If yes
8b) If no
and recreate folders with previous language of last run (I don't know how to do this) However, probably the game now doesn't work with folders in other language and only my hypothesis a) is practicable.