[education/rkward] /: Remove old (custom) i18n installation handling.

Thomas Friedrichsmeier null at kde.org
Tue Dec 27 12:00:15 GMT 2022


Git commit a9c9268e2e033d22364f337f34096d3743625200 by Thomas Friedrichsmeier.
Committed on 27/12/2022 at 11:56.
Pushed by tfry into branch 'master'.

Remove old (custom) i18n installation handling.

Note: Compiled po files for plugins shipped with the main distribution are now installed
in a regular system path. RKWard will still try to find them relative to the .pluginmap files
(as is needed for external plugins), but as the system path is always used as a fallback, no
adjustments to this mechanism are needed.

M  +0    -1    CMakeLists.txt
D  +0    -5    i18n/CMakeLists.txt
D  +0    -17   i18n/Messages.standalone.sh
D  +0    -32   i18n/README.translations
D  +0    -3    i18n/compile_lang.cmake
M  +1    -1    scripts/check_translations.py
D  +0    -108  scripts/import_translations.py
M  +0    -1    scripts/makedist.sh

https://invent.kde.org/education/rkward/commit/a9c9268e2e033d22364f337f34096d3743625200

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e130c89..bdb87c82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,7 +47,6 @@ ADD_DEFINITIONS(-DQT_NO_URL_CAST_FROM_STRING)
 #ADD_DEFINITIONS(-DRKWARD_NO_TRACE)
 
 ADD_SUBDIRECTORY(rkward)
-ADD_SUBDIRECTORY(i18n)
 ADD_SUBDIRECTORY(doc)
 ADD_SUBDIRECTORY(tests)
 KI18N_INSTALL(po)
diff --git a/i18n/CMakeLists.txt b/i18n/CMakeLists.txt
deleted file mode 100644
index a3e3057f..00000000
--- a/i18n/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-SET(TRANSLATION_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/po/")
-FILE(GLOB _dirs "${TRANSLATION_SRC_DIR}/*")
-FOREACH(_dir ${_dirs})
-	ADD_SUBDIRECTORY("${_dir}")
-ENDFOREACH()
diff --git a/i18n/Messages.standalone.sh b/i18n/Messages.standalone.sh
deleted file mode 100755
index 4d2402a6..00000000
--- a/i18n/Messages.standalone.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-BASEDIR=`dirname $0`/../rkward/ # root of translatable sources
-export EXTRACTRC=`which extractrc`
-export XGETTEXT="xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
-                          -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3"
-export podir=`dirname $0`
-
-cd ${BASEDIR}/..
-/bin/sh Messages.sh
-rm rc.cpp
-
-#echo "Extracting messages from plugins"
-#cd ${BASEDIR}
-# For testing purposes, extract analysis.pluginmap, only
-#python ../scripts/update_plugin_messages.py --extract-only --outdir=../i18n/ plugins/analysis.pluginmap
-#python ../scripts/extract_plugin_messages.py --outdir=../po/plugins/ --default_po=testing plugins/under_development.pluginmap
-#echo "Done"
diff --git a/i18n/README.translations b/i18n/README.translations
deleted file mode 100644
index 5130f6fe..00000000
--- a/i18n/README.translations
+++ /dev/null
@@ -1,32 +0,0 @@
-=== Maintainance of translations ===
-
-So you want to work on one of the translations? Great!
-
-In general, however, you should NOT use the .po files in this directory as a basis for your translations,
-and neither should you commit your updates, here. Translations are managed in KDE. See http://l10n.kde.org/
-for documentation and links.
-
-THIS IS NOT THE PRIMARY PLACE where translations are maintained. In order to minimize the risk of your work
-conflicting with that of other translators, please get in touch with the KDE translation team for your
-language. See http://l10n.kde.org/teams-list.php for a list of teams and their mailing lists. This also has
-links where to find the most recent, and authoritative version of each .po file.
-
-If you have any questions or concerns about the process, please contact us on the rkward-devel mailing list.
-
-If all you want is a quick way to pull translations from KDE l10n, use one of:
-* scripts/import_translations.py [xx]
-  (where the optional parameter xx is your language code, such as "de"; script to be found in our git
-  repository, only, not in source releases).
-* git clone git://anongit.kde.org/scratch/tfry/rkward-po-export i18n/po
-  (this is much faster in case you want to fetch/build _all_ translations)
-
-=== Developers ===
-
-- Synchronize translations from KDE l10n to git like this:
-  1. Clone (or update) the existing translation export repo:
-     > git clone git://anongit.kde.org/scratch/tfry/rkward-po-export i18n/po
-  2. Run
-     > scripts/import_translations.py
-     (without language arg) to fetch updates
-  3. git commit & push in the export repo.
-- For dealing with plugin messages, read the i18n-chapter in "Introduction to writing plugins for RKWard".
diff --git a/i18n/compile_lang.cmake b/i18n/compile_lang.cmake
deleted file mode 100644
index 9f38f23a..00000000
--- a/i18n/compile_lang.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-GET_FILENAME_COMPONENT(_lang "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-FILE(GLOB _poFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.po")
-GETTEXT_PROCESS_PO_FILES(${_lang} ALL INSTALL_DESTINATION "${DATA_INSTALL_DIR}/rkward/po" PO_FILES ${_poFiles})
diff --git a/scripts/check_translations.py b/scripts/check_translations.py
index c66927b7..9c55f2c3 100755
--- a/scripts/check_translations.py
+++ b/scripts/check_translations.py
@@ -34,7 +34,7 @@ for arg in sys.argv[1:]:
     else:
         paths.append(arg)
 if (len(paths) < 1):
-    paths = [os.path.join(BASEDIR, "po"), os.path.join(BASEDIR, "i18n", "po")]
+    paths = [os.path.join(BASEDIR, "po")]
 
 def checkCompleteness(filename):
     po = polib.pofile(filename)
diff --git a/scripts/import_translations.py b/scripts/import_translations.py
deleted file mode 100755
index dd888ca0..00000000
--- a/scripts/import_translations.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#! /usr/bin/env python3
-# ***************************************************************************
-#                          import_translations  -  description
-#                             -------------------
-#    begin                : Jan 2015
-#    copyright            : (C) 2015 by Thomas Friedrichsmeier
-#    email                : tfry at users.sourceforge.net
-# ***************************************************************************
-#
-# ***************************************************************************
-# *                                                                         *
-# *   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  *
-# *   the Free Software Foundation; either version 2 of the License, or     *
-# *   (at your option) any later version.                                   *
-# *                                                                         *
-# ***************************************************************************
-#
-# Somewhat experimental script to import translations from KDE l10n infrastructure.
-# Imports specified - or all - languages to tmp/export .
-# Imported po-files are renamed according to rkward's naming scheme.
-# Modelled - to some degree - after l10n.rb from releaseme.
-
-import sys
-import subprocess
-import os
-import shutil
-
-SVNROOT = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/"
-RKWARDSVNPATH = "messages/rkward"
-RKWARDSVNDOCSPATH = "docs/rkward"
-SCRIPTDIR = os.path.dirname (os.path.realpath (sys.argv[0]))
-TMPDIR = os.path.join (SCRIPTDIR, "tmp")
-I18NDIR = os.path.join (SCRIPTDIR, "..", "i18n")
-EXPORTDIR = os.path.join (I18NDIR, "po")
-PODIR = os.path.join (SCRIPTDIR, "..", "po")
-IGNOREDPONAMES = {'org.kde.rkward.appdata.po', 'rkward._desktop_.po', 'rkward_xml_mimetypes.po'}
-SVNCMD = shutil.which("svn")  # could be svn.BAT on Windows/craft, and that won't be found by subprocess.call
-
-if not os.path.exists (TMPDIR):
-    os.makedirs (TMPDIR)
-if os.path.exists (EXPORTDIR):
-    shutil.rmtree (os.path.join (EXPORTDIR))
-
-if (len (sys.argv) > 1):
-    LANGUAGES = sys.argv[1:]
-else:
-    LANGUAGES = subprocess.check_output ([SVNCMD, "cat", SVNROOT + "subdirs"]).decode ('utf-8').split ()
-    LANGUAGES.remove ('x-test')
-print ("Languages: " + ", ".join (LANGUAGES))
-
-for lang in LANGUAGES:
-    os.chdir (TMPDIR)
-    messagesdir = os.path.join (TMPDIR, "messages-" + lang)
-    if not os.path.exists (messagesdir):
-        subprocess.call ([SVNCMD, "co", SVNROOT + lang + "/" + RKWARDSVNPATH, "messages-" + lang])
-        if not os.path.exists (messagesdir):
-            continue
-    else:
-        os.chdir (messagesdir)
-        subprocess.call ([SVNCMD, "up"])
-        os.chdir (TMPDIR)
-    pofiles = [fn for fn in os.listdir (messagesdir) if fn.endswith ('.po') and fn not in IGNOREDPONAMES]
-    if (len (pofiles) < 1):
-        continue
-    langpodir = os.path.join (PODIR, lang)
-    exportlangpodir = os.path.join (EXPORTDIR, lang)
-    for pofile in pofiles:
-        is_main = pofile == "rkward.po"
-        if is_main:
-            outdir = langpodir
-        else:
-            outdir = exportlangpodir
-        infile = os.path.join (messagesdir, pofile)
-        outfile = os.path.join (outdir, pofile)
-        if not os.path.exists (outdir):
-            os.makedirs (outdir)
-            if not is_main:
-                shutil.copyfile (os.path.join (I18NDIR, "compile_lang.cmake"), os.path.join (outdir, "CMakeLists.txt"))
-
-        # copy to destination
-        print ("writing " + outfile)
-        shutil.copyfile (infile, outfile)
-
-for lang in LANGUAGES:
-    os.chdir (TMPDIR)
-    docsdir = os.path.join (TMPDIR, "docs-" + lang)
-    if not os.path.exists (docsdir):
-        subprocess.call ([SVNCMD, "co", SVNROOT + lang + "/" + RKWARDSVNDOCSPATH, "docs-" + lang])
-        if not os.path.exists (docsdir):
-            continue
-    else:
-        os.chdir (docsdir)
-        subprocess.call ([SVNCMD, "up"])
-        os.chdir (TMPDIR)
-    docdirs = [fn for fn in os.listdir (docsdir) if fn[0] != '.' and os.path.isdir (os.path.join (docsdir, fn))]
-    if (len (docdirs) < 1):
-        continue
-    langdocdir = os.path.join (PODIR, lang, "docs")
-    for docdir in docdirs:
-        indir = os.path.join (docsdir, docdir)
-        outdir = os.path.join (langdocdir, docdir)
-
-        # copy to destination
-        print ("copying " + outdir)
-        if os.path.exists (outdir):
-            shutil.rmtree (outdir)
-        shutil.copytree (indir, outdir)
diff --git a/scripts/makedist.sh b/scripts/makedist.sh
index 309fad92..5e9221fb 100755
--- a/scripts/makedist.sh
+++ b/scripts/makedist.sh
@@ -6,7 +6,6 @@ OLDVERSION=`${BASEDIR}/scripts/getversion.sh`
 VERSION=`${BASEDIR}/scripts/getversion.sh ${1}`
 
 # import the translations
-$BASEDIR/scripts/import_translations.py
 $BASEDIR/scripts/check_translations.py --strict
 
 mkdir $BASEDIR/disttemp


More information about the rkward-tracker mailing list