[glom] Add rules for batch .po import and export for the examples.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Add rules for batch .po import and export for the examples.
- Date: Mon, 9 Jan 2012 22:11:45 +0000 (UTC)
commit f5dca3f6352c82dbe244321ac10a9e5b83b8079e
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jan 9 21:29:47 2012 +0100
Add rules for batch .po import and export for the examples.
* Makefile.am: Add examples_export_po and examples_import_po targets
that must be run manually. For instance:
$ make examples_export_po
and
$ make examples_import_po
* glom/glom_import_po_all.cc: Improve the stdout message.
ChangeLog | 11 +++++++++++
Makefile.am | 22 ++++++++++++++++++++--
glom/glom_import_po_all.cc | 2 +-
3 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7513b19..0499c75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2012-01-09 Murray Cumming <murrayc murrayc com>
+ Add rules for batch .po import and export for the examples.
+
+ * Makefile.am: Add examples_export_po and examples_import_po targets
+ that must be run manually. For instance:
+ $ make examples_export_po
+ and
+ $ make examples_import_po
+ * glom/glom_import_po_all.cc: Improve the stdout message.
+
+2012-01-09 Murray Cumming <murrayc murrayc com>
+
Exporting of .po files: Do not lose non-ASCII characters.
* glom/libglom/translations_po.cc: write_translations_to_po_file():
diff --git a/Makefile.am b/Makefile.am
index 2fd53d4..f9c70ee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,13 +167,31 @@ xsltdir = $(pkgdatadir)/xslt
dist_xslt_DATA = xslt/print_report_to_html.xsl
exampledir = $(docdir)/examples
-dist_example_DATA = \
- examples/README \
+example_files = \
examples/example_film_manager.glom \
examples/example_lesson_planner.glom \
examples/example_music_collection.glom \
examples/example_project_manager.glom \
examples/example_smallbusiness.glom
+dist_example_DATA = \
+ $(example_files) \
+ examples/README
+
+# Get the base filenames only, without the extension:
+example_files_names ?= $(patsubst %.glom,%,$(notdir $(example_files)))
+
+# Create .po files for all locales in all example files:
+examples_export_po: $(top_builddir)/glom/glom_export_po_all
+ for example_file in $(example_files_names); do \
+ $(top_builddir)/glom/glom_export_po_all $(top_srcdir)/examples/$$example_file.glom --output-path=$(top_builddir)/examples/po_files/$$example_file/; \
+ done
+
+# Import all .po files into all example files:
+examples_import_po: $(top_builddir)/glom/glom_import_po_all
+ for example_file in $(example_files_names); do \
+ $(top_builddir)/glom/glom_import_po_all $(top_srcdir)/examples/$$example_file.glom --input-path=$(top_builddir)/examples/po_files/$$example_file/; \
+ done
+
# We use += because we set this first in Makefile_tests.am:
dist_noinst_DATA += \
diff --git a/glom/glom_import_po_all.cc b/glom/glom_import_po_all.cc
index 30dfba0..16a02c9 100644
--- a/glom/glom_import_po_all.cc
+++ b/glom/glom_import_po_all.cc
@@ -215,7 +215,7 @@ int main(int argc, char* argv[])
}
document.save();
- std::cout << Glib::ustring::compose(_("Po file imported for locale: %1"), locale_id) << std::endl;
+ std::cout << Glib::ustring::compose(_("Po file imported for locale: %1 for file %2"), locale_id, input_uri) << std::endl;
}
Glom::libglom_deinit();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]