unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 0dec8be6119d13ceba0faded7d8b76bc4d081f5f 1927 bytes (raw)
name: utils/shepherd-gettext.scm 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 
;; shepherd-gettext.scm -- Extract translatable strings from source code.
;; Copyright (C) 2002 Wolfgang Jährling <wolfgang@pro-linux.de>
;;
;; This file is part of the GNU Shepherd.
;;
;; The GNU Shepherd 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 3 of the License, or (at
;; your option) any later version.
;;
;; The GNU Shepherd 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.
;;
;; You should have received a copy of the GNU General Public License
;; along with the GNU Shepherd.  If not, see <http://www.gnu.org/licenses/>.

(define l10n-keywords '(l10n local-output))

(define (puts . text)
  (for-each display text)
  (newline))

(define (found-string str orig)
  (puts "#: " (source-property orig 'filename)
	":" (source-property orig 'line))
  (puts "msgid \"" str "\"")
  (puts "msgstr \"\"")
  (puts))

(define (extract-strings port)
  (letrec ((next-expr
	    (lambda (data)
	      (or (eof-object? data)
		  (begin
		    (letrec ((look-at
			      (lambda (expr)
				(if (and (list? expr)
					 (not (null? expr)))
				    (begin
				      (and (memq (car expr)
						 l10n-keywords)
					   (found-string (cadr expr) expr))
				      (for-each look-at expr))
				    (and (pair? expr)
					 (begin
					   (look-at (car expr))
					   (look-at (cdr expr))))))))
		      (look-at data))
		    (next-expr (read port)))))))
    (next-expr (read port))))

;; Safe file positions of the expressions we read.  It is enabled by
;; default, but we want to be sure.
(read-enable 'positions)

;; Iterate over all given files.
(for-each extract-strings
	  (map open-input-file
	       (cdr (command-line))))

debug log:

solving 35edacf ...
found 35edacf in https://yhetil.org/guix-devel/1453719021-13836-8-git-send-email-alezost@gmail.com/

applying [1/1] https://yhetil.org/guix-devel/1453719021-13836-8-git-send-email-alezost@gmail.com/
diff --git a/utils/shepherd-gettext.scm b/utils/shepherd-gettext.scm
new file mode 100644
index 0000000..35edacf

Checking patch utils/shepherd-gettext.scm...
Applied patch utils/shepherd-gettext.scm cleanly.

index at:
100644 0dec8be6119d13ceba0faded7d8b76bc4d081f5f	utils/shepherd-gettext.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).