[gthumb] added script to update text.h automatically
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] added script to update text.h automatically
- Date: Mon, 21 Jun 2010 11:14:36 +0000 (UTC)
commit 6c31962492b1dc4d6e43c1e666d49a8a0c74f37f
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Jun 21 13:13:46 2010 +0200
added script to update text.h automatically
extensions/webalbums/data/albumthemes/text.h | 16 +++++--
.../webalbums/data/albumthemes/update-text-h.rb | 48 ++++++++++++++++++++
2 files changed, 60 insertions(+), 4 deletions(-)
---
diff --git a/extensions/webalbums/data/albumthemes/text.h b/extensions/webalbums/data/albumthemes/text.h
index 194660c..c8b2c21 100644
--- a/extensions/webalbums/data/albumthemes/text.h
+++ b/extensions/webalbums/data/albumthemes/text.h
@@ -1,9 +1,9 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* DO NOT EDIT. This file is generated automatically. */
/*
* GThumb
*
- * Copyright (C) 2004 Free Software Foundation, Inc.
+ * Copyright (C) 2010 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
@@ -24,9 +24,17 @@
#include <glib/gi18n.h>
static char *text[] = {
+ N_("Click to view the image"),
N_("Go back to the index"),
+ N_("Image %d of %d"),
+ N_("Index"),
+ N_("Next"),
+ N_("Page %d of %d"),
+ N_("Previous"),
+ N_("View page %d"),
N_("View the next image"),
- N_("View the previous image"),
N_("View the next page"),
- N_("View the previous page")
+ N_("View the previous image"),
+ N_("View the previous page"),
+ NULL
}
diff --git a/extensions/webalbums/data/albumthemes/update-text-h.rb b/extensions/webalbums/data/albumthemes/update-text-h.rb
new file mode 100644
index 0000000..9830736
--- /dev/null
+++ b/extensions/webalbums/data/albumthemes/update-text-h.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/env ruby1.8
+
+strings = []
+Dir.glob("**/*.gthtml") do |filename|
+ File.open("./#{ filename }").each_line do |line|
+ if line =~ /<%=[ \t]+translate[ \t]+'(([^\\']|\\.)*)'/
+ strings << $1
+ end
+ end
+end
+
+puts <<EOF
+/* DO NOT EDIT. This file is generated automatically. */
+
+/*
+ * GThumb
+ *
+ * Copyright (C) #{ Time::now.year } 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
+#include <glib/gi18n.h>
+
+static char *text[] = {
+EOF
+
+strings.uniq.sort.each do |string|
+ puts "\tN_(\"#{ string.gsub('\\', '\\\\').gsub('"', '\\"') }\"),"
+end
+
+puts <<EOF
+\tNULL
+}
+EOF
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]