[geany/geany] 1aa82c: Add a script to fixup copyright years translations

Colomban Wendling git-noreply at xxxxx
Sat Mar 18 19:02:45 UTC 2017


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 18 Mar 2017 19:02:45 UTC
Commit:      1aa82c3e6e0ac62f8cc7fa5469298dc0d254f26c
             https://github.com/geany/geany/commit/1aa82c3e6e0ac62f8cc7fa5469298dc0d254f26c

Log Message:
-----------
Add a script to fixup copyright years translations


Modified Paths:
--------------
    scripts/update-year-in-po.sh

Modified: scripts/update-year-in-po.sh
29 lines changed, 29 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+# prevent sed from doing stupid things in case the locale encoding doesn't
+# match the files'.  Unlikely, but doesn't hurt.
+export LANG=C
+
+year=$(grep -Po '(?<="Copyright \(c\)  2005-)20[0-9][0-9](?=\\n)' src/about.c)
+echo "new years are: $years"
+
+for f in po/*.po; do
+  echo "processing $f..."
+  sed -f /dev/stdin -i "$f" <<EOF
+/^"Copyright (c)  2005-20[0-9][0-9]\\\\n"\$/{
+  s/\\(2005-\\)20[0-9][0-9]/\\1$year/
+  n
+  :loop
+    /^msgstr/{
+      n
+      # in case the range uses something else than the ASCII dash
+      s/\\(2005.*\\)20[0-9][0-9]/\\1$year/
+      b done
+    }
+    n
+    b loop
+  :done
+}
+EOF
+done



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list