Commit 662c6443 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Add a configure switch to encode the translations to a specific

encoding

Based on
[[https://stackoverflow.com/questions/6181294/gettext-character-encoding]].
The first answer is irrelevant on windows with Gtk+, because Gtk+
expects UTF-8 data.
parent 53fa20af
Pipeline #166178 passed with stages
in 33 minutes and 44 seconds
......@@ -49,6 +49,7 @@ mingw64-configure \
USER_DATA_DIR_VARIABLE='LOCALAPPDATA' \
--with-static-program-name=yes \
HOST_SYSROOT="/usr/x86_64-w64-mingw32/sys-root/mingw" \
--enable-textdomain-codeset="utf-8" \
|| exit 1
make -j 8 nsi || exit 1
cp tarot-setup.exe ../public/
......
......@@ -14,6 +14,9 @@ AS_IF([test "x$USER_DATA_DIR_VARIABLE" == "x"], [
USER_DATA_DIR_VARIABLE="XDG_DATA_HOME"
])
AC_DEFINE_UNQUOTED([USER_DATA_DIR], "$USER_DATA_DIR_VARIABLE", [The environment variable pointing to user-local read-write storage (XDG_DATA_HOME).])
AC_ARG_ENABLE([textdomain-codeset], AS_HELP_STRING([--enable-textdomain-codeset=CODESET],
[Do not use the current locale for translation message; use the CODESET encoding. On Windows, set it to utf-8.]))
AC_DEFINE_UNQUOTED([TEXTDOMAIN_CODESET], "$enable_textdomain_codeset", [Force gettext encoding, if not set to no.])
AC_CONFIG_MACRO_DIRS([m4])
AC_SUBST([VERSION_MAJOR], m4_esyscmd([./get-version.sh package | cut -d '.' -f 1]))
AC_SUBST([VERSION_MINOR], m4_esyscmd([./get-version.sh package | cut -d '.' -f 2]))
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tarot 0.4.2.83-ebdc-dirty\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
"POT-Creation-Date: 2019-09-06 23:11+0200\n"
"POT-Creation-Date: 2019-09-12 20:00+0200\n"
"PO-Revision-Date: 2019-09-05 23:18+0200\n"
"Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n"
"Language-Team: French\n"
......@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/tarot-app/main.vala:64
#: src/tarot-app/main.vala:67
#, c-format
msgid ""
"ERROR: environment variable '%s' is not set. Try reinstalling the program.\n"
......@@ -26,32 +26,32 @@ msgstr ""
"ERREUR : la variable d'environnement '%s' n'est pas définie. Essayez de "
"réinstaller le programme.\n"
#: src/tarot-app/main.vala:79
#: src/tarot-app/main.vala:82
msgid "Error: XDG_DATA_HOME nor HOME are set.\n"
msgstr "Erreur : ni XDG_DATA_HOME ni HOME ne sont définiies.\n"
#: src/tarot-app/main.vala:84
#: src/tarot-app/main.vala:87
#, c-format
msgid "Error: environment variable '%s' is not set.\n"
msgstr "Erreur : la variable d'environnement '%s' n'est pas définie.\n"
#: src/tarot-app/main.vala:96 src/tarot-app/program_commons.c:48
#: src/tarot-app/main.vala:99 src/tarot-app/program_commons.c:48
#, c-format
msgid "ERROR: could not initialize libtarot.\n"
msgstr "ERREUR : impossible d'initialiser libtarot.\n"
#: src/tarot-app/main.vala:108
#: src/tarot-app/main.vala:111
msgid "Print version information and exit"
msgstr "Affiche l'information de version et quitte"
#: src/tarot-app/main.vala:110 src/tarot-app/main.vala:120
#: src/tarot-app/main.vala:113 src/tarot-app/main.vala:123
#: src/tarot-app/tarot_deal.c:70 src/tarot-app/tarot_mcts.c:100
#: src/tarot-app/tarot_stacking.c:86 src/tarot-app/tarot_features.c:156
#: src/tarot-app/tarot_cnn_features.c:137
msgid "version"
msgstr "version"
#: src/tarot-app/main.vala:127 src/tarot-app/tarot_status.c:58
#: src/tarot-app/main.vala:130 src/tarot-app/tarot_status.c:58
#: src/tarot-app/tarot_deal.c:110 src/tarot-app/tarot_mcts.c:151
#: src/tarot-app/tarot_stacking.c:116 src/tarot-app/tarot_features.c:185
#: src/tarot-app/tarot_cnn_features.c:165
......@@ -1647,6 +1647,9 @@ msgstr "Écart"
msgid "Call: [card]"
msgstr "Appel : [carte]"
#~ msgid "Random seed"
#~ msgstr "Graine aléatoire"
#~ msgid "Could not run %s!\n"
#~ msgstr "Impossible d'exécuter %s !\n"
......@@ -2350,9 +2353,6 @@ msgstr "Appel : [carte]"
#~ msgid "Allow a call in the game"
#~ msgstr "Autorise un appel durant la partie"
#~ msgid "Random seed"
#~ msgstr "Graine aléatoire"
#~ msgid "Width of the output file"
#~ msgstr "Largeur du fichier de sortie"
......
......@@ -49,6 +49,9 @@ extern const double TUNE_SIMULATION_AGREED;
[CCode (cname="USER_DATA_DIR")]
extern const string USER_DATA_DIR;
[CCode (cname="TEXTDOMAIN_CODESET")]
extern const string TEXTDOMAIN_CODESET;
const string program_name = "tarot";
namespace Tarot {
......@@ -148,6 +151,10 @@ namespace Tarot {
GLib.Intl.setlocale (LocaleCategory.ALL, "");
GLib.Intl.bindtextdomain (PACKAGE, Environment.get_variable ("LOCALEDIR"));
GLib.Intl.textdomain (PACKAGE);
if (TEXTDOMAIN_CODESET != "no") {
stderr.printf ("Warning: translations codepage set to %s\n", TEXTDOMAIN_CODESET);
GLib.Intl.bind_textdomain_codeset(PACKAGE, TEXTDOMAIN_CODESET);
}
Gtk.Application app = new GuiApplication ();
int ret = app.run (args);
Tarot.quit ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment