From 38a249290f954a53690e5d386372ae4f76c1bd6f Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 24 Mar 2023 08:52:31 -0300 Subject: [PATCH] Building locale based on product name. --- locale/Makefile.in | 47 +++++++++++++++++------------------------------ locale/pw3270.pot | 2 +- src/main/main.c | 6 +++--- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/locale/Makefile.in b/locale/Makefile.in index 6cf11ac..7a45e87 100644 --- a/locale/Makefile.in +++ b/locale/Makefile.in @@ -1,27 +1,19 @@ +# SPDX-License-Identifier: LGPL-3.0-or-later # -# Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 -# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a -# aplicativos mainframe. Registro no INPI sob o nome G3270. +# Copyright (C) 2008 Banco do Brasil S.A. # -# Copyright (C) <2008> +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob -# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela -# Free Software Foundation. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER -# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO -# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para -# obter mais detalhes. -# -# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este -# programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin -# St, Fifth Floor, Boston, MA 02110-1301 USA -# -# Contatos: -# -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . # @@ -56,15 +48,15 @@ INSTALL_DATA=@INSTALL_DATA@ @$(MSGMERGE) --update --sort-output $@ $(PACKAGE_NAME).pot @touch $@ -$(BINDIR)/%/LC_MESSAGES/$(PACKAGE_NAME).mo: \ +$(BINDIR)/%/LC_MESSAGES/$(PRODUCT_NAME).mo: \ %.po @echo $< ... @$(MKDIR) `dirname $@` @$(MSGFMT) -c -v -o $@ $^ -$(DESTDIR)/$(localedir)/%/LC_MESSAGES/$(PACKAGE_NAME).mo: \ - $(BINDIR)/%/LC_MESSAGES/$(PACKAGE_NAME).mo +$(DESTDIR)/$(localedir)/%/LC_MESSAGES/$(PRODUCT_NAME).mo: \ + $(BINDIR)/%/LC_MESSAGES/$(PRODUCT_NAME).mo @echo $< ... @$(MKDIR) `dirname $@` @@ -73,14 +65,9 @@ $(DESTDIR)/$(localedir)/%/LC_MESSAGES/$(PACKAGE_NAME).mo: \ #---[ Targets ]-------------------------------------------------------------------------- all: \ - $(foreach SRC, $(basename $(wildcard *.po)), $(BINDIR)/$(SRC)/LC_MESSAGES/$(PACKAGE_NAME).mo) + $(foreach SRC, $(basename $(wildcard *.po)), $(BINDIR)/$(SRC)/LC_MESSAGES/$(PRODUCT_NAME).mo) install: \ - $(foreach SRC, $(basename $(wildcard *.po)), $(DESTDIR)/$(localedir)/$(SRC)/LC_MESSAGES/$(PACKAGE_NAME).mo) - -# @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/locale -# @$(INSTALL_DATA) *.po $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/locale -# @$(INSTALL_DATA) $(PACKAGE_NAME).pot $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/locale -# @$(INSTALL_DATA) Makefile $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/locale + $(foreach SRC, $(basename $(wildcard *.po)), $(DESTDIR)/$(localedir)/$(SRC)/LC_MESSAGES/$(PRODUCT_NAME).mo) diff --git a/locale/pw3270.pot b/locale/pw3270.pot index a03bb64..80a1b74 100644 --- a/locale/pw3270.pot +++ b/locale/pw3270.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-31 11:13-0300\n" +"POT-Creation-Date: 2023-03-24 08:43-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/main/main.c b/src/main/main.c index be15450..39a4186 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -77,12 +77,12 @@ int main (int argc, char **argv) { g_autofree gchar * appdir = g_win32_get_package_installation_directory_of_module(NULL); g_autofree gchar * locdir = g_build_filename(appdir,"locale",NULL); debug("Locale from \"%s\"\n",locdir); - bindtextdomain( PACKAGE_NAME, locdir ); + bindtextdomain( G_STRINGIFY(PRODUCT_NAME), locdir ); } #endif // _WIN32 - bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); - textdomain(PACKAGE_NAME); + bind_textdomain_codeset(G_STRINGIFY(PRODUCT_NAME), "UTF-8"); + textdomain(G_STRINGIFY(PRODUCT_NAME)); // Setup and start application. g_set_application_name(G_STRINGIFY(PRODUCT_NAME)); -- libgit2 0.21.2