Skip to content

Commit

Permalink
replaced -G option (no gettext) by -L ""
Browse files Browse the repository at this point in the history
  • Loading branch information
phyver committed Nov 20, 2024
1 parent e3f29cf commit 9366d9e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
4 changes: 2 additions & 2 deletions i18n/start-full-help/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ options:
-R reset game
-F do not check for more recent savefiles, force using the given archive

-G do not use gettext for translation (everything will be in English)
-L ... set LANGUAGE variable (ex: -L fr:it:en)
On non GNU systems, set the variable LC_MESSAGES to a valid locale.
This flag is ignored when continuing from a save file.
-L "" gettext won't be used and everything will be in English
The -L flag is ignored when continuing from a save file.

-S simple
the savefile is obtained by adding a "-save" suffix,
Expand Down
6 changes: 3 additions & 3 deletions i18n/start-full-help/fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ options :
-F ne vérifie pas l'existence de fichiers de sauvegarde plus récents,
force l'utilisation de l'archive donnée

-G désactive gettext pour les traductions (tout sera en Anglais)
-L initialise la variable LANGUAGE (ex : -L fr:it:en)
-L ... initialise la variable LANGUAGE (ex : -L fr:it:en)
Pour les systèmes non GNU, initialisez la variable LC_MESSAGES
avec une locale valide.
Cette option est sans effet lorsqu'on reprend une session à partir
-L "" gettext ne sera pas utilisé et le jeu sera en Anglais
L'option -L est sans effet lorsqu'on reprend une session à partir
d'un fichier de sauvegarde.

-S simple
Expand Down
2 changes: 1 addition & 1 deletion i18n/start-full-help/it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ options:
-R reimposta la partita
-F non cercare salvataggi recenti, utilizza forzatamente l'archivio definito

-G non utilizzare gettext per le traduzioni (sarà tutto in Inglese)
-L ... imposta la variabile LANGUAGE (ex: -L fr:it:en)
Su sistemi non GNU, imposta la variabile LC_MESSAGES
per un "locale" valido.
-L "" non utilizzare gettext per le traduzioni (sarà tutto in Inglese)

-S simple
il file di salvataggio è generato con un suffiso "-save",
Expand Down
13 changes: 8 additions & 5 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ GSH_EXPLICIT_LANGUAGE="false"
# if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English
# export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh
RESET=""
while getopts ":hHInPdDACRXUVqGL:KBZc:FS:" opt
while getopts ":hHInPdDACRXUVqL:KBZc:FS:" opt
do
case $opt in
S)
Expand Down Expand Up @@ -102,12 +102,15 @@ do
RESET="TRUE"
;;
L)
export LANGUAGE="$OPTARG" # only works on GNU systems
if [ -z "$OPTARG" ]
then
export GSH_NO_GETTEXT=1
else
export LANGUAGE="$OPTARG" # only works on GNU systems
unset GSH_NO_GETTEXT
fi
GSH_EXPLICIT_LANGUAGE="true"
;;
G)
export GSH_NO_GETTEXT=1
;;
V)
# when lib/header.sh sees the -V flag, it displays the version and exits,
# so the next case isn't used.
Expand Down
25 changes: 10 additions & 15 deletions utils/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ options:
-P use the "passport mode" by default when running GameShell
-A use the "anonymous mode" by default when running GameShell
-L LANGS only keep the given languages (ex: -L 'en*,fr')
-E only keep english as a language, not generating any ".mo" file
and not using gettext
if LANGS is empty (-L ""), only keep english as a language,
not generating any ".mo" file and not using gettext
-N ... name of the archive / top directory (default: "gameshell")
-I FILE additional index file to include in the archive
Expand Down Expand Up @@ -67,7 +67,7 @@ VERBOSE=""

INDEX_FILES=""

while getopts "hp:N:atPzL:EvS:p:I:" opt
while getopts "hp:N:atPzL:vS:p:I:" opt
do
case $opt in
h)
Expand Down Expand Up @@ -113,22 +113,17 @@ do
;;
L)
LANGUAGES=$OPTARG
;;
E)
LANGUAGES=
KEEP_PO=0
GENERATE_MO=0
GSH_NO_GETTEXT=1
if [ -z "$OPTARG" ]
then
KEEP_PO=0
GENERATE_MO=0
GSH_NO_GETTEXT=1
fi
;;
v)
VERBOSE=1
;;
*)
if [ "$_long_option" = "1" ]
then
OPTARG="-$opt"
fi
echo "invalid option: '-$OPTARG'" >&2
'?' | :)
exit 1
;;
esac
Expand Down

0 comments on commit 9366d9e

Please sign in to comment.