Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ EXTRA_DIST = \
src/gui/bitmaps/undo.h \
src/gui/bitmaps/redo.h \
src/gui/bitmaps/gambitrc.rc \
po/gambit.pot \
po/es.po \
po/fr.po \
contrib/games/2s2x2x2.efg \
contrib/games/2x2x2.efg \
contrib/games/4cards.efg \
Expand Down Expand Up @@ -347,7 +350,8 @@ bin_PROGRAMS = gambit
endif

# Define VERSION for all C++ compilations and set include paths
AM_CPPFLAGS = -I$(top_srcdir)/src -DVERSION=\"$(VERSION)\"
AM_CPPFLAGS = -I$(top_srcdir)/src -DVERSION=\"$(VERSION)\" \
-DLOCALEDIR=\"$(LOCALEDIR)\"

AM_CXXFLAGS = ${LLVM_CXXFLAGS}

Expand Down Expand Up @@ -379,6 +383,8 @@ gambit_SOURCES = \
src/gui/edittext.h \
src/gui/dlabout.cc \
src/gui/dlabout.h \
src/gui/dlpreferences.cc \
src/gui/dlpreferences.h \
src/gui/dleditmove.cc \
src/gui/dleditmove.h \
src/gui/dleditnode.cc \
Expand Down Expand Up @@ -457,6 +463,56 @@ endif
src/gui/bitmaps/gambitrc.o: src/gui/bitmaps/gambitrc.rc
$(WINDRES) $(WX_CXXFLAGS) -I$(srcdir)/src/gui/bitmaps -o $@ $<

#-----------------------------------------------------------------------
# Translations
#
# GUI strings are extracted with xgettext (maintainer action, "make update-po"),
# kept as hand-edited po/<lang>.po files, and compiled to GNU mo catalogs with
# msgfmt at build time. The mo files are installed under $(LOCALEDIR), which
# app.cc registers with wxLocale so that the "_()" macro translates the UI.
# When msgfmt is unavailable, no catalogs are built/installed and the interface
# falls back to the built-in English strings.
#-----------------------------------------------------------------------

PO_LANGS = es fr
PO_CATALOGS = $(PO_LANGS:%=$(top_builddir)/po/%.mo)

if HAVE_MSGFMT
all-local: $(PO_CATALOGS)

$(top_builddir)/po/%.mo: $(top_srcdir)/po/%.po
$(MKDIR_P) $(top_builddir)/po
$(MSGFMT) --check -o $@ $<

install-data-local: $(PO_CATALOGS)
@for lang in $(PO_LANGS); do \
$(MKDIR_P) $(DESTDIR)$(LOCALEDIR)/$$lang/LC_MESSAGES || exit 1; \
$(INSTALL_DATA) $(top_builddir)/po/$$lang.mo \
$(DESTDIR)$(LOCALEDIR)/$$lang/LC_MESSAGES/gambit.mo || exit 1; \
done
endif

if HAVE_XGETTEXT
.PHONY: update-po
update-po: po/gambit.pot
@for lang in $(PO_LANGS); do \
test -f po/$$lang.po || cp -f po/gambit.pot po/$$lang.po; \
msgmerge --update --quiet po/$$lang.po po/gambit.pot >/dev/null 2>&1 || true; \
done

po/gambit.pot: $(gambit_SOURCES)
$(MKDIR_P) po
$(XGETTEXT) --keyword=_ --keyword=wxPLURAL:1,2 --add-comments=TRANSLATORS: \
--from-code=UTF-8 --language=C++ -o $@ $(gambit_SOURCES)
$(XGETTEXT) --keyword=_ --keyword=wxPLURAL:1,2 --add-comments=TRANSLATORS: \
--from-code=UTF-8 --language=C++ -j -o $@ $(wildcard src/gui/*.h)
endif

uninstall-local:
@for lang in $(PO_LANGS); do \
rm -f $(DESTDIR)$(LOCALEDIR)/$$lang/LC_MESSAGES/gambit.mo; \
done

osx-bundle:
make all
-rm -rf Gambit.app
Expand All @@ -476,6 +532,12 @@ osx-dmg: osx-bundle
msw-msi:
-mkdir installer
cp gambit* installer
if HAVE_MSGFMT
$(MSGFMT) --check -o $(top_builddir)/po/es.mo $(top_srcdir)/po/es.po
$(MSGFMT) --check -o $(top_builddir)/po/fr.mo $(top_srcdir)/po/fr.po
cp $(top_builddir)/po/es.mo installer/es.mo
cp $(top_builddir)/po/fr.mo installer/fr.mo
endif
candle build_support/msw/gambit.wxs
light -ext WixUIExtension gambit.wixobj

Expand Down
25 changes: 24 additions & 1 deletion build_support/msw/gambit.wxs.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="ApplicationRootDirectory" Name="Gambit"/>
<Directory Id="ApplicationRootDirectory" Name="Gambit">
<Directory Id="Gambit.share" Name="share">
<Directory Id="Gambit.locale" Name="locale">
<Directory Id="Gambit.es" Name="es">
<Directory Id="Gambit.es.messages" Name="LC_MESSAGES"/>
</Directory>
<Directory Id="Gambit.fr" Name="fr">
<Directory Id="Gambit.fr.messages" Name="LC_MESSAGES"/>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Gambit"/>
Expand Down Expand Up @@ -101,10 +112,22 @@
<RegistryValue Root="HKCU" Key="Software\Gambit\Gambit @GAMBIT_MSI_MAJOR@" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="Gambit.es.messages">
<Component Id="Gambit.es.mo" Guid="7E5C11A2-3B14-4E9A-8C2F-1D0B6A9A9E41" Win64="yes">
<File Id="gambit.es.mo" Source="installer\es.mo" Name="gambit.mo" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="Gambit.fr.messages">
<Component Id="Gambit.fr.mo" Guid="8F6D22B3-4C25-4FAB-9D30-2E1C7B0B0F52" Win64="yes">
<File Id="gambit.fr.mo" Source="installer\fr.mo" Name="gambit.mo" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="Complete" Level="1">
<ComponentRef Id="Gambit.exe"/>
<ComponentRef Id="Gambit.copying"/>
<ComponentRef Id="ApplicationShortcut"/>
<ComponentRef Id="Gambit.es.mo"/>
<ComponentRef Id="Gambit.fr.mo"/>
</Feature>
</Product>
</Wix>
21 changes: 21 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,27 @@ AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_CXXFLAGS)

dnl---------------------------------------
dnl Checking for gettext tools & locale dir
dnl---------------------------------------
AC_ARG_VAR([LOCALEDIR], [Directory for installed locale data files])
test -n "$LOCALEDIR" || LOCALEDIR='${datadir}/locale'
AC_SUBST(LOCALEDIR)

AC_CHECK_PROG([MSGFMT], [msgfmt], [msgfmt])
if test -n "$MSGFMT"; then
AM_CONDITIONAL([HAVE_MSGFMT], [true])
else
AM_CONDITIONAL([HAVE_MSGFMT], [false])
fi

AC_CHECK_PROG([XGETTEXT], [xgettext], [xgettext])
if test -n "$XGETTEXT"; then
AM_CONDITIONAL([HAVE_XGETTEXT], [true])
else
AM_CONDITIONAL([HAVE_XGETTEXT], [false])
fi


REZFLAGS=`echo $CXXFLAGS $WX_CXXFLAGS | sed 's/-mthreads//g' | sed 's/-g//g' | sed 's/-O. / /g' | sed 's/-I/--include-dir /g'`
AC_SUBST(REZFLAGS)
Expand Down
162 changes: 162 additions & 0 deletions po/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Spanish translations for Gambit.
# Copyright (C) 2026 The Gambit Project
# This file is distributed under the same license as the Gambit package.
# Fernando P. <fernando@example.org>, 2026.
#
msgid ""
msgstr ""
"Project-Id-Version: Gambit\n"
"Report-Msgid-Bugs-To: https://github.com/gambitproject/gambit\n"
"POT-Creation-Date: 2026-08-29 00:00+0000\n"
"PO-Revision-Date: 2026-08-29 00:00+0000\n"
"Last-Translator: Fernando P. <fernando@example.org>\n"
"Language-Team: Spanish <es@li.org>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. Main menu bar
msgid "&File"
msgstr "&Archivo"

msgid "&Edit"
msgstr "&Editar"

msgid "&View"
msgstr "&Ver"

msgid "&Format"
msgstr "&Formato"

msgid "&Tools"
msgstr "&Herramientas"

msgid "&Help"
msgstr "&Ayuda"

#. File menu
msgid "&Extensive game"
msgstr "Juego &extensivo"

msgid "&Strategic game"
msgstr "Juego &estratégico"

msgid "&New"
msgstr "&Nuevo"

msgid "&Open\tCtrl-O"
msgstr "&Abrir\tCtrl-O"

msgid "&Save\tCtrl-S"
msgstr "&Guardar\tCtrl-S"

msgid "Save &as\tShift-Ctrl-S"
msgstr "Guardar &como\tShift-Ctrl-S"

msgid "&Export"
msgstr "&Exportar"

msgid "Page Se&tup"
msgstr "Configur&ación de página"

msgid "Print Pre&view"
msgstr "&Vista preliminar"

msgid "&Print\tCtrl-P"
msgstr "&Imprimir\tCtrl-P"

msgid "&Close\tCtrl-W"
msgstr "&Cerrar\tCtrl-W"

msgid "E&xit\tCtrl-Q"
msgstr "&Salir\tCtrl-Q"

#. Edit menu
msgid "&Undo\tCtrl-Z"
msgstr "&Deshacer\tCtrl-Z"

msgid "&Redo\tShift-Ctrl-Z"
msgstr "&Rehacer\tShift-Ctrl-Z"

msgid "&Game"
msgstr "&Juego"

msgid "&Preferences"
msgstr "&Preferencias"

#. View menu
msgid "&Profiles"
msgstr "&Perfiles"

msgid "Zoom &In\tCtrl-+"
msgstr "A&mpliar\tCtrl-+"

msgid "Zoom &Out\tCtrl--"
msgstr "&Reducir\tCtrl--"

msgid "&Actual Size\tCtrl-0"
msgstr "Tamaño &real\tCtrl-0"

msgid "Zoom to &Fit"
msgstr "Ajustar a la &ventana"

msgid "La&bels"
msgstr "&Etiquetas"

msgid "&Font"
msgstr "&Fuente"

msgid "&Layout"
msgstr "&Diseño"

#. Tools menu
msgid "&Dominance"
msgstr "&Dominancia"

msgid "&Equilibrium"
msgstr "&Equilibrio"

msgid "&QRE"
msgstr "&QRE"

#. Help menu / dialogs
msgid "&About Gambit"
msgstr "&Acerca de Gambit"

msgid "Welcome to Gambit"
msgstr "Bienvenido a Gambit"

msgid "Preferences"
msgstr "Preferencias"

msgid "Language:"
msgstr "Idioma:"

msgid "Appearance:"
msgstr "Apariencia:"

msgid "System (default)"
msgstr "Sistema (predeterminado)"

msgid "English"
msgstr "Inglés"

msgid "Spanish"
msgstr "Español"

msgid "French"
msgstr "Francés"

msgid "Light"
msgstr "Claro"

msgid "Dark"
msgstr "Oscuro"

msgid "OK"
msgstr "Aceptar"

msgid "Cancel"
msgstr "Cancelar"
Loading