Skip to content

Changing language, add folders! #100

Description

@gioisco

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'
[mission 1] $ ls
Castle	Forest	Garden	Mountain  Stall
  1. Exit with gsh exit
  2. Start the game in other language with ./start.sh -L fr
  3. I don't want to start new game (I may be already complete some mission)
[giovanni@giovanni GameShell]$ ./start.sh -L fr
Le répertoire /run/media/giovanni/DATI/Projects-shared/GameShell/.config contient des méta-données provenant d'une partie précédente.
Voulez vous les supprimer et commencer une nouvelle partie ? [o/N] N
  1. Show folders and...
[mission 1] $ ls
Castle	Chateau  Forest  Garden  Mountain  Stall

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'
[mission 1] $ ls
Castle	Forest	Garden	Mountain  Stall
  1. Exit with gsh exit
  2. Start the game in other language with ./start.sh -L fr
  3. Show message to continue or start new game
  4. If the last choice was N AND the language is different from the last run (I don't know how to check this)
  5. Translate all folders.
    This is is now possible running follow command at startup:
rm -r $GSH_HOME/*
gsh resetstatic

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

rm -r $GSH_HOME/*
gsh resetstatic

8b) If no

rm -r $GSH_HOME/*

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.

Activity

  1. changed the title [-]Change language, add folders![/-] [+]Changing language, add folders![/+] on Jul 3, 2022
  2. phyver commented on Jul 3, 2022

    @phyver
    Owner

    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?

  3. Mte90 commented on Jul 4, 2022

    @Mte90
    Contributor

    I don't see any issues on that, the journal is important.

  4. phyver commented on Jul 5, 2022

    @phyver
    Owner

    Good, I'll try doing that when I have some time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions