desktop: changed translations to msgfmt and xgettext
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sat, 20 Jun 2020 10:02:15 +0000 (12:02 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sat, 20 Jun 2020 16:55:52 +0000 (18:55 +0200)
During the build of the debian package 1.2.0-5 it turned out
that the pspp.appdata.xml file has a wrong structure with
respect to the translations. I did the following things

  - renamed pspp.appdata.xml to org.fsf.pspp.metainfo.xml
  - added gettext translation support for org.fsf.metainfo.xml
  - renamed pspp.desktop to org.fsf.pspp.desktop
  - replaced gen-det-desktop.sh based translation with gettext

gettext has now support for translating .desktop and .metainfo.xml
files. I took the naming conventions from the freedesktop and gnome
documentation, i.e. metainfo instead of appdata and the use of
an organization name.

README.Git
po/LINGUAS [new file with mode: 0644]
po/automake.mk
src/ui/gui/automake.mk
src/ui/gui/gen-dot-desktop.sh [deleted file]
src/ui/gui/org.fsf.pspp.desktop.in [new file with mode: 0644]
src/ui/gui/org.fsf.pspp.metainfo.xml.in [new file with mode: 0644]
src/ui/gui/pspp.appdata.xml [deleted file]

index 809bfe87116ce75f2cdc21a6656834984145d7fd..f101c058a8f60d252c25b73c86732a5f4c65a17d 100644 (file)
@@ -9,7 +9,7 @@ following:
 
        * Automake 1.10 (or later).
 
-       * Gettext 0.17 (or later).
+       * Gettext 0.19 (or later).
 
        * GNU M4 1.4.9 (or later).
 
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644 (file)
index 0000000..444424d
--- /dev/null
@@ -0,0 +1,20 @@
+ca
+cs
+de
+el
+es
+fr
+gl
+hu
+ja
+lt
+nl
+pl
+pt_BR
+ru
+sl
+tr
+uk
+zh_CN
+
+
index fd551969320e65461c131cfdea6e884a134cd065..ebdb57e343afbb9f63fc190e533d096e5999e2bf 100644 (file)
@@ -1,5 +1,5 @@
 # PSPP - a program for statistical analysis.
-# Copyright (C) 2017 Free Software Foundation, Inc.
+# Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -51,13 +51,21 @@ XGETTEXT_OPTIONS = \
        --package-version=$(VERSION) \
        --msgid-bugs-address=$(MSGID_BUGS_ADDRESS) \
         --from-code=UTF-8 \
-       --add-comments='TRANSLATORS:'
+       --add-comments='TRANSLATORS:' \
+       --directory=$(top_srcdir)
 
-$(POTFILE): $(TRANSLATABLE_FILES) $(UI_FILES) src/ui/gui/gen-dot-desktop.sh
+ALL_TRANSLATEABLE_FILES = \
+       $(TRANSLATEABLE_FILES) \
+       $(UI_FILES) \
+       src/ui/gui/org.fsf.pspp.metainfo.xml.in \
+       src/ui/gui/org.fsf.pspp.desktop.in
+
+$(POTFILE): $(ALL_TRANSLATABLE_FILES)
        @$(MKDIR_P) po
-       $(AM_V_GEN)$(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS)    $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@,tmp
-       $(AM_V_at)$(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=glade -o $@,tmp
-       $(AM_V_at)$(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) -j src/ui/gui/gen-dot-desktop.sh --language=shell --keyword=TRANSLATE -o $@,tmp
+       $(AM_V_GEN)$(XGETTEXT) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@,tmp
+       $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=glade -o $@,tmp
+       $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j src/ui/gui/org.fsf.pspp.metainfo.xml.in -o $@,tmp
+       $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j src/ui/gui/org.fsf.pspp.desktop.in -o $@,tmp
        $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: .*/d' $@,tmp > $@
 
 $(LOCALPOFILED) $(POFILES): $(POTFILE)
@@ -98,6 +106,7 @@ EXTRA_DIST += \
        $(LOCALPOFILES) \
        $(POFILES) \
        $(POTFILE) \
+       po/LINGUAS \
        po/ChangeLog \
        po/cs.po,aux
 
index 4dbba029e304a14ad6639af17de5371d8b165fa4..9f2a20f9a71d472f6db30e1b7b1e1b880d999f02 100644 (file)
@@ -1,5 +1,5 @@
 # PSPP - a program for statistical analysis.
-# Copyright (C) 2017 Free Software Foundation, Inc.
+# Copyright (C) 2017, 2020 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -81,7 +81,8 @@ EXTRA_DIST += doc/help-pages-list
 
 EXTRA_DIST += \
        src/ui/gui/memorandum.txt \
-       src/ui/gui/gen-dot-desktop.sh \
+       src/ui/gui/org.fsf.pspp.metainfo.xml.in \
+       src/ui/gui/org.fsf.pspp.desktop.in \
        src/ui/gui/marshaller-list \
        src/ui/gui/pspplogo.svg
 
@@ -376,10 +377,14 @@ PHONY += yelp-check
 
 AM_CPPFLAGS += -Isrc
 
-src/ui/gui/pspp.desktop: src/ui/gui/gen-dot-desktop.sh $(POFILES)
-       $(AM_V_GEN)POFILES="$(POFILES)" top_builddir="$(top_builddir)" $(SHELL) $< > $@
+src/ui/gui/org.fsf.pspp.metainfo.xml: src/ui/gui/org.fsf.pspp.metainfo.xml.in $(POFILES)
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -o $@ -d $(top_srcdir)/po
 
-CLEANFILES+=src/ui/gui/pspp.desktop
+src/ui/gui/org.fsf.pspp.desktop: src/ui/gui/org.fsf.pspp.desktop.in $(POFILES)
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -o $@ -d $(top_srcdir)/po
+
+CLEANFILES+=src/ui/gui/org.fsf.pspp.desktop \
+            src/ui/gui/org.fsf.pspp.metainfo.xml
 
 src/ui/gui/resources.c: src/ui/gui/resources.xml
        $(AM_V_at)$(GLIB_COMPILE_RESOURCES) --sourcedir=$(top_srcdir)/src/ui/gui --generate-source $< --target=$@,out
@@ -396,10 +401,10 @@ src/ui/gui/psppire-marshal.h: src/ui/gui/marshaller-list
        $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=psppire_marshal $? > $@
 
 desktopdir = $(datadir)/applications
-desktop_DATA = src/ui/gui/pspp.desktop
+desktop_DATA = src/ui/gui/org.fsf.pspp.desktop
 
 appdatadir = $(datadir)/metainfo
-dist_appdata_DATA = src/ui/gui/pspp.appdata.xml
+dist_appdata_DATA = src/ui/gui/org.fsf.pspp.metainfo.xml
 
 BUILT_SOURCES += src/ui/gui/psppire-marshal.c src/ui/gui/psppire-marshal.h src/ui/gui/resources.c
 
diff --git a/src/ui/gui/gen-dot-desktop.sh b/src/ui/gui/gen-dot-desktop.sh
deleted file mode 100644 (file)
index ea5b3eb..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-TRANSLATE ()
-{
-    echo "$1";
-}
-
-extract_string ()
-{
-  msggrep -K -F -e "$2" $top_builddir/$1 2> /dev/null | msgattrib --translated --no-fuzzy | awk -F \" '/^msgstr "/{print $2}' | grep -v '^$'
-}
-
-
-GenericName=`TRANSLATE "Statistical Software"`
-Comment=`TRANSLATE "Analyze statistical data with a free alternative to SPSS"`
-
-
-printf "# Generated from $0        -*- buffer-read-only: t -*-\n\n"
-
-printf '[Desktop Entry]\n';
-printf 'Name=GNU PSPP\n';
-printf "GenericName=$GenericName\n"
-
-for pfile in $POFILES; do
-    lang=${pfile%%.po}
-    lang=${lang##po/}
-    xlate=`extract_string $pfile "$GenericName"`
-    if test -z "$xlate"; then continue; fi
-    printf "GenericName[$lang]=$xlate\n";
-done
-
-
-printf "Comment=$Comment\n"
-
-for pfile in $POFILES; do
-    lang=${pfile%%.po}
-    lang=${lang##po/}
-    xlate=`extract_string $pfile "$Comment"`
-    if test -z "$xlate"; then continue; fi
-    printf "Comment[$lang]= $xlate\n";
-done
-
-printf 'Exec=psppire %%F\n'
-printf 'Icon=pspp%s\n'
-printf 'Terminal=false%s\n'
-printf 'Type=Application%s\n'
-printf 'Categories=GTK;Education;Science;Math;%s\n'
-printf 'MimeType=application/x-spss-sav;application/x-spss-por;%s\n'
-printf 'StartupNotify=false%s\n'
-
diff --git a/src/ui/gui/org.fsf.pspp.desktop.in b/src/ui/gui/org.fsf.pspp.desktop.in
new file mode 100644 (file)
index 0000000..860652a
--- /dev/null
@@ -0,0 +1,13 @@
+# This file is processed by gettext to add translations
+
+[Desktop Entry]
+Name=GNU PSPP
+GenericName=Statistical Software
+Comment=Analyze statistical data with a free alternative to SPSS
+Exec=psppire %F
+Icon=pspp
+Terminal=false
+Type=Application
+Categories=GTK;Education;Science;Math;
+MimeType=application/x-spss-sav;application/x-spss-por;
+StartupNotify=false
diff --git a/src/ui/gui/org.fsf.pspp.metainfo.xml.in b/src/ui/gui/org.fsf.pspp.metainfo.xml.in
new file mode 100644 (file)
index 0000000..ec29e49
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop">
+  <id>pspp.desktop</id>
+  <metadata_license>CC0-1.0</metadata_license>
+  <project_license>GPL-3.0+</project_license>
+  <name>GNU PSPP</name>
+  <summary>GNU PSPP is a program for statistical analysis of sampled data</summary>
+  <description>
+    <p>GNU PSPP is a program for the statistical analysis of sampled data. It is a Free replacement for the proprietary program SPSS, and appears very similar to it with a few exceptions. The most important of these exceptions are, that there are no “time bombs”; your copy of PSPP will not “expire” or deliberately stop working in the future. Neither are there any artificial limits on the number of cases or variables which you can use. There are no additional packages to purchase in order to get “advanced” functions; all functionality that PSPP currently supports is in the core package.</p>
+    <p>PSPP is a stable and reliable application. It can perform descriptive statistics, T-tests, anova, linear and logistic regression, measures of association, cluster analysis, reliability and factor analysis, non-parametric tests and more. Its backend is designed to perform its analyses as fast as possible, regardless of the size of the input data. You can use PSPP with its graphical interface or the more traditional syntax commands.</p>
+    <p>A brief list of some of the PSPP's features.</p>
+    <ul>
+      <li>Support for over 1 billion cases</li>
+      <li>Support for over 1 billion variables</li>
+      <li>Syntax and data files which are compatible with those of SPSS</li>
+      <li>A choice of terminal or graphical user interface</li>
+      <li>A choice of text, postscript, pdf, opendocument or html output formats</li>
+      <li>Inter-operability with: LibreOffice, Apache OpenOffice, Gnumeric and other free software</li>
+      <li>Easy data import from spreadsheets, text files and database sources</li>
+      <li>The capability to open, analyse and edit two or more datasets concurrently</li>
+      <li>A user interface supporting all common character sets</li>
+      <li>A user interface has been translated to multiple languages</li>
+      <li>Very fast statistical procedures, even on very large data sets</li>
+      <li>No license fees and no expiration period</li>
+      <li>No unethical “end user license agreements”</li>
+      <li>A fully indexed user manual</li>
+      <li>Freedom ensured; It is licensed under the GPLv3 or later</li>
+      <li>Portability; Runs on many different computers and many different operating systems</li>
+    </ul>
+    <p>PSPP is particularly aimed at statisticians, social scientists and students requiring fast convenient analysis of sampled data.</p>
+  </description>
+  <screenshots>
+    <screenshot type="default">
+      <image>http://www.gnu.org/software/pspp/images/variable-sheet.png</image>
+    </screenshot>
+  </screenshots>
+  <url type="homepage">http://www.gnu.org/software/pspp/</url>
+  <url type="translate">http://translationproject.org/domain/pspp.html</url>
+  <url type="donation">https://my.fsf.org/donate</url>
+  <keywords>
+    <keyword>statistics</keyword>
+  </keywords>
+  <update_contact>pspp-dev@gnu.org</update_contact>
+  <developer_name>Free Software Foundation</developer_name>
+  <url type="bugtracker">https://savannah.gnu.org/bugs/?func=additem&amp;group=pspp</url>
+  <url type="help">https://www.gnu.org/software/pspp/manual/html_node/index.html</url>
+</component>
diff --git a/src/ui/gui/pspp.appdata.xml b/src/ui/gui/pspp.appdata.xml
deleted file mode 100644 (file)
index 1149f06..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component type="desktop">
-  <id>pspp.desktop</id>
-  <metadata_license>CC0-1.0</metadata_license>
-  <project_license>GPL-3.0+</project_license>
-  <name>GNU PSPP</name>
-  <summary>GNU PSPP is a program for statistical analysis of sampled data</summary>
-  <summary xml:lang="es">GNU PSPP es un programa para el análisis estadístico de datos de la muestra</summary>
-  <summary xml:lang="pt_BR">GNU PSPP é um programa para a análise estatística dos dados da amostra</summary>
-  <description>
-    <p>GNU PSPP is a program for the statistical analysis of sampled data. It is a Free replacement for the proprietary program SPSS, and appears very similar to it with a few exceptions. The most important of these exceptions are, that there are no “time bombs”; your copy of PSPP will not “expire” or deliberately stop working in the future. Neither are there any artificial limits on the number of cases or variables which you can use. There are no additional packages to purchase in order to get “advanced” functions; all functionality that PSPP currently supports is in the core package.</p>
-    <p>PSPP is a stable and reliable application. It can perform descriptive statistics, T-tests, anova, linear and logistic regression, measures of association, cluster analysis, reliability and factor analysis, non-parametric tests and more. Its backend is designed to perform its analyses as fast as possible, regardless of the size of the input data. You can use PSPP with its graphical interface or the more traditional syntax commands.</p>
-    <p>A brief list of some of the PSPP's features.</p>
-    <ul>
-      <li>Support for over 1 billion cases</li>
-      <li>Support for over 1 billion variables</li>
-      <li>Syntax and data files which are compatible with those of SPSS</li>
-      <li>A choice of terminal or graphical user interface</li>
-      <li>A choice of text, postscript, pdf, opendocument or html output formats</li>
-      <li>Inter-operability with: LibreOffice, Apache OpenOffice, Gnumeric and other free software</li>
-      <li>Easy data import from spreadsheets, text files and database sources</li>
-      <li>The capability to open, analyse and edit two or more datasets concurrently</li>
-      <li>A user interface supporting all common character sets</li>
-      <li>A user interface has been translated to multiple languages</li>
-      <li>Very fast statistical procedures, even on very large data sets</li>
-      <li>No license fees and no expiration period</li>
-      <li>No unethical “end user license agreements”</li>
-      <li>A fully indexed user manual</li>
-      <li>Freedom ensured; It is licensed under the GPLv3 or later</li>
-      <li>Portability; Runs on many different computers and many different operating systems</li>
-    </ul>
-    <p>PSPP is particularly aimed at statisticians, social scientists and students requiring fast convenient analysis of sampled data.</p>
-  </description>
-  <description>
-    <p xml:lang="es">GNU PSPP es un programa para el análisis estadístico de los datos incluidos en la muestra. Es un reemplazo libre para el programa propietario SPSS, y parece muy similar con unas pocas excepciones. La más importante de estas excepciones son, de que no hay "bombas de tiempo"; copia de su PSPP no "expira" o deliberadamente dejar de funcionar en el futuro. Tampoco hay límites artificiales en el número de casos o variables que se pueden utilizar. No hay paquetes adicionales para la compra con el fin de obtener las funciones "avanzadas"; Toda la funcionalidad que PSPP soporta actualmente, está incluida en el paquete básico.</p>
-    <p xml:lang="es">PSPP es una aplicación estable y fiable. Puede realizar la estadística descriptiva, t-test, ANOVA, regresión lineal y logística, medidas de asociación, análisis de conglomerados, análisis factorial y fiabilidad, pruebas no paramétricas y más. Su backend está diseñado para realizar el análisis lo más rápido como sea posible, independientemente del tamaño de los datos de entrada. Puede usar PSPP con su interfaz gráfica o los comandos de sintaxis más tradicionales.</p>
-    <p xml:lang="es">Una breve lista de las características de PSPP.</p>
-    <ul xml:lang="es">
-      <li>Soporta más de mil millones de casos</li>
-      <li>Soporta más de mil millones de variables</li>
-      <li>Los archivos de datos y sintaxis son compatibles con los de SPSS</li>
-      <li>A elegir modo terminal o una interfaz gráfica de usuario</li>
-      <li>A elegir distinfos formatos de salida como texto, postscript, pdf, opendocument o html</li>
-      <li>Interopera con: LibreOffice, Apache OpenOffice, Gnumeric y otro Software Libre</li>
-      <li>Fácil importación desde hojas de cálculo, archivos de texto o bases de datos</li>
-      <li>Es capaz de abrir, analizar y editar dos o más archivos de datos al mismo tiempo</li>
-      <li>Una interfaz de usuario compatible con todos los juegos de caracteres comunes</li>
-      <li>Una interfaz de usuario que ha sido traducida a múltiples idiomas</li>
-      <li>Procedimientos estadísticos muy rápidos, incluso utilizando grandes archivos de datos</li>
-      <li>No hay derechos de licencia y no hay periodo de caducidad</li>
-      <li>No hay "acuerdos de licencia de usuario final" poco éticas</li>
-      <li>Un manual de usuario totalmente indexado</li>
-      <li>Libertad garantizada; Está licenciada bajo GPLv3 o posterior</li>
-      <li>Portable; Funciona en muchos equipos diferentes y muchos sitemas operativos diferentes</li>
-    </ul>
-    <p xml:lang="es">PSPP está especialmente dirigido a estadísticos, científicos sociales y estudiantes que requieren un análisis rápido y conveniente de datos muestreados.</p>
-  </description>
-  <description>
-    <p xml:lang="pt_BR">GNU PSPP é um programa para a análise estatística dos dados amostrados. Ele é um substituto gratuito para o SPSS programa proprietário, e parece muito semelhante com algumas exceções. A mais importante dessas exceções, não há "bombas-relógio"; cópia do PSPP não vai "expirar" ou deliberadamente parar de trabalhar no futuro. Também não há limites artificial para o número de casos ou de variáveis que podem ser usadas. Nenhum pacote adicional para comprar a fim de obter funções "avançadas"; Todas as funcionalidades que PSPP apoia actualmente está incluído no pacote básico.</p>
-    <p xml:lang="pt_BR">PSPP é uma aplicação estável e fiável. Você pode executar estatística descritiva, teste t, ANOVA, regressão linear e logística, medidas de associação, análise de cluster, análise fatorial e de confiabilidade, e testes não paramétricos. A sua infra-estrutura foi concebida para realizar as análises tão rapidamente quanto possível, independentemente do tamanho dos dados de entrada. Você pode usar PSPP com sua interface gráfica ou os comandos mais tradicionais de sintaxe.</p>
-    <p xml:lang="pt_BR">Uma pequena lista das características do PSPP.</p>
-    <ul xml:lang="pt_BR">
-      <li>Ele suporta mais de um bilhão de casos</li>
-      <li>Ele suporta mais de um bilhão de variáveis</li>
-      <li>Os arquivos de dados e sintaxe são compatíveis com SPSS</li>
-      <li>Um modo de terminal selecione ou GUI</li>
-      <li>Para escolher diferentes formatos de saída como texto, PostScript, PDF, HTML ou opendocument</li>
-      <li>Interoperar com: LibreOffice, OpenOffice, Gnumeric e outros softwares livres</li>
-      <li>Fácil importação de planilhas, arquivos de texto ou bancos de dados</li>
-      <li>Ele é capaz de abrir, editar e analisar dois ou mais arquivos de dados ao mesmo tempo</li>
-      <li>Uma interface de usuário suporta todos os conjuntos de caracteres comuns</li>
-      <li>A interface do usuário foi traduzido em vários idiomas</li>
-      <li>Não há taxas de licenciamento e sem período de expiração</li>
-      <li>Não há taxas de licenciamento e sem período de expiração</li>
-      <li>No "acordos de licença de usuário final" antiético</li>
-      <li>Um manual do usuário totalmente indexado</li>
-      <li>Liberdade garantida; É licenciado sob GPL v3+</li>
-      <li>Portátil; Ele funciona em muitas máquinas diferentes e muitos sistemas operacionais diferentes</li>
-    </ul>
-    <p xml:lang="pt_BR">PSPP é particularmente destinada aos estatísticos, cientistas sociais e os alunos que necessitam de uma análise rápida e conveniente de dados amostrados.</p>
-  </description>
-  <screenshots>
-    <screenshot type="default">
-      <image>http://www.gnu.org/software/pspp/images/variable-sheet.png</image>
-    </screenshot>
-  </screenshots>
-  <url type="homepage">http://www.gnu.org/software/pspp/</url>
-  <url type="translate">http://translationproject.org/domain/pspp.html</url>
-  <url type="donation">https://my.fsf.org/donate</url>
-  <keywords>
-    <keyword>statistics</keyword>
-  </keywords>
-  <update_contact>pspp-dev@gnu.org</update_contact>
-  <developer_name>Free Software Foundation</developer_name>
-  <url type="bugtracker">https://savannah.gnu.org/bugs/?func=additem&amp;group=pspp</url>
-  <url type="help">https://www.gnu.org/software/pspp/manual/html_node/index.html</url>
-</component>