Skip to content
Permalink
Browse files

backport processing help support (from 2f431bc)

(cherry picked from commit 263f54c)
  • Loading branch information
jef-n committed Mar 1, 2019
1 parent b4cf2fd commit 000ac972e0e4c766fb7800d8c09ce9d51c29ae7c
@@ -27,7 +27,7 @@
import codecs
import yaml
from qgis.core import QgsSettings, Qgis
from qgis.PyQt.QtCore import QLocale
from qgis.PyQt.QtCore import QLocale, QCoreApplication


def loadShortHelp():
@@ -37,7 +37,11 @@ def loadShortHelp():
if f.endswith("yaml"):
filename = os.path.join(path, f)
with codecs.open(filename, encoding='utf-8') as stream:
h.update(yaml.load(stream))
for k, v in yaml.load(stream).items():
if v is None:
continue
h[k] = QCoreApplication.translate("{}Algorithm".format(f[:-5].upper()), v)

version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2])
overrideLocale = QgsSettings().value('locale/overrideFlag', False, bool)
if not overrideLocale:
@@ -51,7 +55,9 @@ def replace(s):
return s.replace("{qgisdocs}", "https://docs.qgis.org/%s/%s/docs" % (version, locale))
else:
return None

h = {k: replace(v) for k, v in list(h.items())}

return h


@@ -304,7 +304,7 @@ qgis:pointsalonglines: >

An optional start and end offset can be specified, which controls how far from the start and end of the geometry the points should be created.

qgis:pointsdisplacement:
qgis:pointsdisplacement: >
Offsets nearby point features by moving nearby points by a preset amount to minimize overlapping features.

qgis:pointslayerfromtable: >
@@ -314,7 +314,7 @@ qgis:pointslayerfromtable: >

The attributes table of the resulting layer will be the input table.

qgis:pointstopath:
qgis:pointstopath: >
Converts a point layer to a line layer, by joining points in a defined order.

Points can be grouped by a field to output individual line features per group.

This file was deleted.

This file was deleted.

@@ -15,6 +15,7 @@
###########################################################################

use XML::Simple;
use YAML::XS qw/LoadFile/;
use Data::Dumper;

die "usage: $0 dest.cpp\n" unless @ARGV==1;
@@ -79,7 +80,16 @@
$strings{"SAGAAlgorithm"}{$desc} = 1;
}

for my $f ( ("python/plugins/processing/gui/algclasssification.txt", "python/plugins/processing/gui/algnames.txt") ) {
for my $f (<python/plugins/processing/algs/help/*.yaml>) {
my ($base) = $f =~ /.*\/(.*)\.yaml$/;
$base = uc $base;
my $yaml = LoadFile($f);
for my $k (keys %$yaml) {
$strings{"${base}Algorithm"}{$yaml->{$k}} = 1;
}
}

for my $f ( ("python/plugins/processing/gui/algnames.txt") ) {
open I, $f;
while(<I>) {
chop;
@@ -177,7 +177,7 @@ echo "TR_EXCLUDE = $(qmake -query QT_INSTALL_HEADERS)/*" >>qgis_ts.pro
echo Updating translations
$LUPDATE -no-obsolete -locations absolute -verbose qgis_ts.pro

perl -i.bak -ne 'print unless /^\s+<location.*qgs(expression|contexthelp)_texts\.cpp.*$/;' i18n/qgis_*.ts
perl -i.bak -ne 'print unless /^\s+<location.*(qgs(expression|contexthelp)_texts|.*-i18n)\.cpp.*$/;' i18n/qgis_*.ts

if [ $action = push ]; then
cp i18n/qgis_en.ts /tmp/qgis_en.ts-uploading

0 comments on commit 000ac97

Please sign in to comment.
You can’t perform that action at this time.