[glom] Allow creation of .pot files for .glom files.



commit 06295b456d9f3dc43aad5a1de2be2015e7347a8c
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jan 10 11:42:21 2012 +0100

    Allow creation of .pot files for .glom files.
    
    * glom/libglom/translations_po.[h|cc]: Added write_pot_file().
    * glom/glom_export_po.cc: Add a --template option to genereate
    .pot files.
    * Makefile.am: Use this new option to generate .pot files
    when exporting all .po files.
    * examples/po_files/*/*.pot: Add these generated files to git,
    to help translators to start new translations.

 ChangeLog                                          |   12 +
 Makefile.am                                        |    5 +-
 .../example_film_manager/example_film_manager.pot  | 1175 ++++++++++++++++++++
 .../example_lesson_planner.pot                     |  339 ++++++
 .../example_music_collection.pot                   |  183 +++
 .../example_project_manager.pot                    |  307 +++++
 .../example_smallbusiness.pot                      |  351 ++++++
 glom/glom_export_po.cc                             |   41 +-
 glom/libglom/translations_po.cc                    |    6 +
 glom/libglom/translations_po.h                     |    6 +
 10 files changed, 2414 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a4604ec..153a3d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2012-01-10  Murray Cumming  <murrayc murrayc com>
 
+	Allow creation of .pot files for .glom files.
+
+	* glom/libglom/translations_po.[h|cc]: Added write_pot_file().
+	* glom/glom_export_po.cc: Add a --template option to genereate
+	.pot files.
+	* Makefile.am: Use this new option to generate .pot files 
+	when exporting all .po files.
+	* examples/po_files/*/*.pot: Add these generated files to git,
+	to help translators to start new translations.
+
+2012-01-10  Murray Cumming  <murrayc murrayc com>
+
 	Add README about examples' .po files.
 
 	* examples/po_files/README:
diff --git a/Makefile.am b/Makefile.am
index f9c70ee..2736777 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -181,17 +181,18 @@ dist_example_DATA = \
 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
+examples_export_po: $(top_builddir)/glom/glom_export_po_all $(top_builddir)/glom/glom_export_po
 	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/; \
+	  $(top_builddir)/glom/glom_export_po $(top_srcdir)/examples/$$example_file.glom --output-path=$(top_builddir)/examples/po_files/$$example_file/$$example_file.pot --template; \
 	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/examples/po_files/example_film_manager/example_film_manager.pot b/examples/po_files/example_film_manager/example_film_manager.pot
new file mode 100644
index 0000000..daa78a6
--- /dev/null
+++ b/examples/po_files/example_film_manager/example_film_manager.pot
@@ -0,0 +1,1175 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Openismus Film Manager\n"
+"product=glom&keywords=I18N+L10N&component=general\n"
+"PO-Revision-Date: 2012-01-10 11:38+0100\n"
+"Last-Translator: Someone <someone someone com>\n"
+"Language-Team:  <someone someone com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgctxt "Table (accommodation)"
+msgid "Accommodation"
+msgstr ""
+
+msgctxt "Field (accommodation_id). Parent table: accommodation"
+msgid "Accommodation ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: accommodation"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: accommodation"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (address_street). Parent table: accommodation"
+msgid "Street"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: accommodation"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_county). Parent table: accommodation"
+msgid "County"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: accommodation"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: accommodation"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: accommodation"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (name). Parent table: accommodation"
+msgid "Name"
+msgstr ""
+
+msgctxt "Relationship (contacts). Parent table: accommodation"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: accommodation"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: accommodation, Parent Group: details"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (contact). Parent table: accommodation, Parent Group: details"
+msgid "Contact"
+msgstr ""
+
+msgctxt "Table (cars)"
+msgid "Cars"
+msgstr ""
+
+msgctxt "Field (car_id). Parent table: cars"
+msgid "Car ID"
+msgstr ""
+
+msgctxt "Field (manufacturer). Parent table: cars"
+msgid "Manufacturer"
+msgstr ""
+
+msgctxt "Field (model). Parent table: cars"
+msgid "Model"
+msgstr ""
+
+msgctxt "Field (registration). Parent table: cars"
+msgid "Registration"
+msgstr ""
+
+msgctxt "Field (description). Parent table: cars"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comment). Parent table: cars"
+msgid "Comment"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: cars"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: cars"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (characters)"
+msgid "Characters"
+msgstr ""
+
+msgctxt "Field (character_id). Parent table: characters"
+msgid "Cast ID"
+msgstr ""
+
+msgctxt "Field (character). Parent table: characters"
+msgid "Character"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: characters"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: characters"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (mainpart). Parent table: characters"
+msgid "Main Part"
+msgstr ""
+
+msgctxt "Relationship (contacts_actor). Parent table: characters"
+msgid "Actor"
+msgstr ""
+
+msgctxt "Relationship (scenes). Parent table: characters"
+msgid "Scenes"
+msgstr ""
+
+msgctxt "Report (cast_list). Parent table: characters"
+msgid "Cast List"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: characters, Parent Report: cast_list"
+msgid "Actor"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: characters, Parent Report: cast_list"
+msgid "Agent"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: characters, Parent Group: main"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: characters, Parent Group: main"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (actor). Parent table: characters, Parent Group: main, Parent Group: details"
+msgid "Actor"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: characters, Parent Group: main"
+msgid "Actor's Contact ID"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: characters, Parent Group: main"
+msgid "Actor's Name"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: characters"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: characters"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (actor). Parent table: characters, Parent Group: details"
+msgid "Actor"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: characters, Parent Group: details, Parent Group: actor"
+msgid "Actor's Name"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: characters, Parent Group: main"
+msgid "Actor"
+msgstr ""
+
+msgctxt "Table (companies)"
+msgid "Companies"
+msgstr ""
+
+msgctxt "Field (company_id). Parent table: companies"
+msgid "Company ID"
+msgstr ""
+
+msgctxt "Field (name). Parent table: companies"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: companies"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (description). Parent table: companies"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (logo). Parent table: companies"
+msgid "Logo"
+msgstr ""
+
+msgctxt "Field (website). Parent table: companies"
+msgid "Web Site"
+msgstr ""
+
+msgctxt "Relationship (staff). Parent table: companies"
+msgid "Staff"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: companies"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: companies"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (contacts)"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: contacts"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (name_first). Parent table: contacts"
+msgid "First Name"
+msgstr ""
+
+msgctxt "Field (name_middle). Parent table: contacts"
+msgid "Second Name"
+msgstr ""
+
+msgctxt "Field (name_last). Parent table: contacts"
+msgid "Last Name"
+msgstr ""
+
+msgctxt "Field (name_title). Parent table: contacts"
+msgid "Title"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Mr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Ms"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Mrs"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Miss"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Dr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Prof"
+msgstr ""
+
+msgctxt "Field (address_street2). Parent table: contacts"
+msgid "Street (line 2)"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: contacts"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_state). Parent table: contacts"
+msgid "State"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: contacts"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: address_country"
+msgid "Germany"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: address_country"
+msgid "United Kingdom"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: address_country"
+msgid "USA"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: address_country"
+msgid "France"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: address_country"
+msgid "Spain"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: contacts"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (date_of_birth). Parent table: contacts"
+msgid "Date Of Birth"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: contacts"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name_full). Parent table: contacts"
+msgid "Full Name"
+msgstr ""
+
+msgctxt "Field (company_id). Parent table: contacts"
+msgid "Company ID"
+msgstr ""
+
+msgctxt "Field (picture). Parent table: contacts"
+msgid "Picture"
+msgstr ""
+
+msgctxt "Field (tel_home). Parent table: contacts"
+msgid "Home Telephone"
+msgstr ""
+
+msgctxt "Field (tel_mobile). Parent table: contacts"
+msgid "Mobile Telephone"
+msgstr ""
+
+msgctxt "Field (tel_fax). Parent table: contacts"
+msgid "Fax"
+msgstr ""
+
+msgctxt "Field (tel_work). Parent table: contacts"
+msgid "Work Telephone"
+msgstr ""
+
+msgctxt "Field (email). Parent table: contacts"
+msgid "Email"
+msgstr ""
+
+msgctxt "Field (address_street1). Parent table: contacts"
+msgid "Street (line 1)"
+msgstr ""
+
+msgctxt "Field (website). Parent table: contacts"
+msgid "Web Site"
+msgstr ""
+
+msgctxt "Field (agent_id). Parent table: contacts"
+msgid "Agent ID"
+msgstr ""
+
+msgctxt "Field (stagename). Parent table: contacts"
+msgid "Stagename"
+msgstr ""
+
+msgctxt "Relationship (company). Parent table: contacts"
+msgid "Company"
+msgstr ""
+
+msgctxt "Relationship (agent). Parent table: contacts"
+msgid "Agent"
+msgstr ""
+
+msgctxt "Relationship (crew). Parent table: contacts"
+msgid "Crew"
+msgstr ""
+
+msgctxt "Relationship (cast). Parent table: contacts"
+msgid "Cast"
+msgstr ""
+
+msgctxt "Report (by_country). Parent table: contacts"
+msgid "Contacts By Country"
+msgstr ""
+
+msgctxt "Report (by_country_by_town). Parent table: contacts"
+msgid "By Country, By Town"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: contacts"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: contacts"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (name). Parent table: contacts, Parent Group: details, Parent Group: notebook_contact"
+msgid "Name"
+msgstr ""
+
+msgctxt "Layout Group (company). Parent table: contacts, Parent Group: details, Parent Group: notebook_contact"
+msgid "Company"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: contacts, Parent Group: details, Parent Group: notebook_contact"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (telephone). Parent table: contacts, Parent Group: details, Parent Group: notebook_contact"
+msgid "Telephone"
+msgstr ""
+
+msgctxt "Layout Group (agent). Parent table: contacts, Parent Group: details, Parent Group: notebook_contact"
+msgid "Agent"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: contacts, Parent Group: main"
+msgid "Company Name"
+msgstr ""
+
+msgctxt "Table (costume)"
+msgid "Costume"
+msgstr ""
+
+msgctxt "Field (costume_id). Parent table: costume"
+msgid "Costume ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: costume"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: costume"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: costume"
+msgid "Name"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: costume"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: costume"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (crew)"
+msgid "Crew"
+msgstr ""
+
+msgctxt "Field (crew_id). Parent table: crew"
+msgid "Crew ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: crew"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: crew"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (dept_id). Parent table: crew"
+msgid "Department ID"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: crew"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Relationship (contacts). Parent table: crew"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Relationship (departments). Parent table: crew"
+msgid "Departments"
+msgstr ""
+
+msgctxt "Relationship (scenes). Parent table: crew"
+msgid "Scenes"
+msgstr ""
+
+msgctxt "Report (crew_list). Parent table: crew"
+msgid "Crew List"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: crew, Parent Report: crew_list"
+msgid "Department Name"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: crew"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (department). Parent table: crew, Parent Group: details"
+msgid "Department"
+msgstr ""
+
+msgctxt "Layout Group (contact). Parent table: crew, Parent Group: details"
+msgid "Contact"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: crew, Parent Group: details, Parent Group: contact"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (agent). Parent table: crew, Parent Group: details, Parent Group: contact"
+msgid "Agent"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: crew, Parent Group: main"
+msgid "Department Name"
+msgstr ""
+
+msgctxt "Table (deliveries)"
+msgid "Deliveries"
+msgstr ""
+
+msgctxt "Field (delivery_id). Parent table: deliveries"
+msgid "Delivery ID"
+msgstr ""
+
+msgctxt "Field (arrival_date). Parent table: deliveries"
+msgid "Arrival Date"
+msgstr ""
+
+msgctxt "Field (departure_contact_id). Parent table: deliveries"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (arrival_contact_id). Parent table: deliveries"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (arrival_time). Parent table: deliveries"
+msgid "Arrival Time"
+msgstr ""
+
+msgctxt "Field (arrival_place). Parent table: deliveries"
+msgid "Arrival Place"
+msgstr ""
+
+msgctxt "Field (departure_time). Parent table: deliveries"
+msgid "Departure Time"
+msgstr ""
+
+msgctxt "Field (departure_date). Parent table: deliveries"
+msgid "Departure Date"
+msgstr ""
+
+msgctxt "Field (departure_place). Parent table: deliveries"
+msgid "Departure Place"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: deliveries"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (description). Parent table: deliveries"
+msgid "Description"
+msgstr ""
+
+msgctxt "Relationship (departure_contact). Parent table: deliveries"
+msgid "Departure Contact"
+msgstr ""
+
+msgctxt "Relationship (arrival_contact). Parent table: deliveries"
+msgid "Arrival Contact"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: deliveries, Parent Group: main"
+msgid "Departure Name"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: deliveries, Parent Group: main"
+msgid "Arrival Name"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: deliveries"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (departure). Parent table: deliveries, Parent Group: details"
+msgid "Departure"
+msgstr ""
+
+msgctxt "Layout Group (arrival). Parent table: deliveries, Parent Group: details"
+msgid "Arrival"
+msgstr ""
+
+msgctxt "Table (departments)"
+msgid "Departments"
+msgstr ""
+
+msgctxt "Field (departments_id). Parent table: departments"
+msgid "Department ID"
+msgstr ""
+
+msgctxt "Field (name). Parent table: departments"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: departments"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Relationship (department_crew). Parent table: departments"
+msgid "Department Crew"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: departments"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Table (equipment)"
+msgid "Equipment"
+msgstr ""
+
+msgctxt "Field (equipment_id). Parent table: equipment"
+msgid "Equipment ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: equipment"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: equipment"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Relationship (scenes). Parent table: equipment"
+msgid "Scenes"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: equipment"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: equipment"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (journeys)"
+msgid "Journeys"
+msgstr ""
+
+msgctxt "Field (journey_id). Parent table: journeys"
+msgid "Journey ID"
+msgstr ""
+
+msgctxt "Field (comment). Parent table: journeys"
+msgid "Comment"
+msgstr ""
+
+msgctxt "Field (description). Parent table: journeys"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (arrival_date). Parent table: journeys"
+msgid "Arrival Date"
+msgstr ""
+
+msgctxt "Field (arrival_time). Parent table: journeys"
+msgid "Arrival Time"
+msgstr ""
+
+msgctxt "Field (arrival_place). Parent table: journeys"
+msgid "Arrival Place"
+msgstr ""
+
+msgctxt "Field (departure_date). Parent table: journeys"
+msgid "Departure Date"
+msgstr ""
+
+msgctxt "Field (departure_time). Parent table: journeys"
+msgid "Departure Time"
+msgstr ""
+
+msgctxt "Field (departure_place). Parent table: journeys"
+msgid "Departure Place"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: journeys"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Relationship (contacts). Parent table: journeys"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: journeys"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (person). Parent table: journeys, Parent Group: details"
+msgid "Person"
+msgstr ""
+
+msgctxt "Layout Group (departure). Parent table: journeys, Parent Group: details"
+msgid "Departure"
+msgstr ""
+
+msgctxt "Layout Group (arrival). Parent table: journeys, Parent Group: details"
+msgid "Arrival"
+msgstr ""
+
+msgctxt "Table (locations)"
+msgid "Locations"
+msgstr ""
+
+msgctxt "Field (location_id). Parent table: locations"
+msgid "Location ID"
+msgstr ""
+
+msgctxt "Field (name). Parent table: locations"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (address_street). Parent table: locations"
+msgid "Street"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: locations"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_county). Parent table: locations"
+msgid "County"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: locations"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: locations"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: locations"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: locations"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (rent). Parent table: locations"
+msgid "Rent"
+msgstr ""
+
+msgctxt "Relationship (scenes). Parent table: locations"
+msgid "Scenes"
+msgstr ""
+
+msgctxt "Relationship (contacts). Parent table: locations"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: locations"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: locations, Parent Group: details"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (contact_person). Parent table: locations, Parent Group: details"
+msgid "Contact Person"
+msgstr ""
+
+msgctxt "Table (props)"
+msgid "Props"
+msgstr ""
+
+msgctxt "Field (prop_id). Parent table: props"
+msgid "Prop ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: props"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: props"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: props"
+msgid "Name"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: props"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: props"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (scene_cast)"
+msgid "Scene Cast"
+msgstr ""
+
+msgctxt "Field (scene_cast_id). Parent table: scene_cast"
+msgid "Scene Cast ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_cast"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (cast_id). Parent table: scene_cast"
+msgid "Cast ID"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_cast"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Relationship (cast). Parent table: scene_cast"
+msgid "Cast"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_cast, Parent Group: main"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_cast, Parent Group: main"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (scene_costume)"
+msgid "Scene Costume"
+msgstr ""
+
+msgctxt "Field (scene_costume_id). Parent table: scene_costume"
+msgid "Scene Costume ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_costume"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_costume"
+msgid "Scene Id"
+msgstr ""
+
+msgctxt "Field (costume_id). Parent table: scene_costume"
+msgid "Costume ID"
+msgstr ""
+
+msgctxt "Relationship (costume). Parent table: scene_costume"
+msgid "Costume"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_costume"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_costume"
+msgid "Details"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: scene_costume, Parent Group: details"
+msgid "Costume Name"
+msgstr ""
+
+msgctxt "Table (scene_crew)"
+msgid "Scene Crew"
+msgstr ""
+
+msgctxt "Field (scene_crew_id). Parent table: scene_crew"
+msgid "Scene Crew ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_crew"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_crew"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Field (department_id). Parent table: scene_crew"
+msgid "Department ID"
+msgstr ""
+
+msgctxt "Relationship (department). Parent table: scene_crew"
+msgid "Department"
+msgstr ""
+
+msgctxt "Relationship (scenes). Parent table: scene_crew"
+msgid "Scenes"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_crew, Parent Group: main"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_crew, Parent Group: main"
+msgid "Details"
+msgstr ""
+
+msgctxt "Field (scene_equipment_id). Parent table: scene_equipment"
+msgid "Scene Equipment ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_equipment"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (equipment_id). Parent table: scene_equipment"
+msgid "Equipment ID"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_equipment"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_equipment"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_equipment"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (scene_extras)"
+msgid "Scene Extras"
+msgstr ""
+
+msgctxt "Field (scene_extras_id). Parent table: scene_extras"
+msgid "Scene Extras ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: scene_extras"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_extras"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_extras"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: scene_extras"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Relationship (contact). Parent table: scene_extras"
+msgid "Contact"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_extras, Parent Group: main"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_extras, Parent Group: main"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (scene_makeup)"
+msgid "Scene Makeup"
+msgstr ""
+
+msgctxt "Field (scene_makeup_id). Parent table: scene_makeup"
+msgid "Scene Makeup ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: scene_makeup"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_makeup"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_makeup"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_makeup"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_makeup"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (scene_props)"
+msgid "Scene Props"
+msgstr ""
+
+msgctxt "Field (scene_props_id). Parent table: scene_props"
+msgid "Scene Prop ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scene_props"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scene_props"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Field (prop_id). Parent table: scene_props"
+msgid "Prop ID"
+msgstr ""
+
+msgctxt "Relationship (props). Parent table: scene_props"
+msgid "Props"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scene_props"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scene_props"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (scenes)"
+msgid "Scenes"
+msgstr ""
+
+msgctxt "Field (scene_id). Parent table: scenes"
+msgid "Scene ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: scenes"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (description). Parent table: scenes"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (location_id). Parent table: scenes"
+msgid "Location ID"
+msgstr ""
+
+msgctxt "Field (date). Parent table: scenes"
+msgid "Date"
+msgstr ""
+
+msgctxt "Field (time). Parent table: scenes"
+msgid "Time"
+msgstr ""
+
+msgctxt "Field (minutes). Parent table: scenes"
+msgid "Stop (minutes)"
+msgstr ""
+
+msgctxt "Field (day_or_night). Parent table: scenes"
+msgid "Day/Night"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: day_or_night"
+msgid "Day"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: day_or_night"
+msgid "Night"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: day_or_night"
+msgid "Morning"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: day_or_night"
+msgid "Evening"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: day_or_night"
+msgid "Dawn"
+msgstr ""
+
+msgctxt "Field (interior_or_exterior). Parent table: scenes"
+msgid "Interior/Exterior"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: interior_or_exterior"
+msgid "Interior"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: scenes, Parent Field: interior_or_exterior"
+msgid "Exterior"
+msgstr ""
+
+msgctxt "Field (name). Parent table: scenes"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (overview_name). Parent table: scenes"
+msgid "Scene"
+msgstr ""
+
+msgctxt "Field (pages). Parent table: scenes"
+msgid "Pages"
+msgstr ""
+
+msgctxt "Field (script_day). Parent table: scenes"
+msgid "Script Day"
+msgstr ""
+
+msgctxt "Relationship (location). Parent table: scenes"
+msgid "Locations"
+msgstr ""
+
+msgctxt "Relationship (scene_crew). Parent table: scenes"
+msgid "Additional Crew"
+msgstr ""
+
+msgctxt "Relationship (scene_cast). Parent table: scenes"
+msgid "Cast"
+msgstr ""
+
+msgctxt "Relationship (scene_equipment). Parent table: scenes"
+msgid "Additional Equipment"
+msgstr ""
+
+msgctxt "Relationship (scene_extras). Parent table: scenes"
+msgid "Extras"
+msgstr ""
+
+msgctxt "Relationship (scene_props). Parent table: scenes"
+msgid "Props"
+msgstr ""
+
+msgctxt "Relationship (scene_costume). Parent table: scenes"
+msgid "Costume"
+msgstr ""
+
+msgctxt "Relationship (scene_makeup). Parent table: scenes"
+msgid "Additional Makeup"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: scenes"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: scenes"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (scenario). Parent table: scenes, Parent Group: details"
+msgid "Scenario"
+msgstr ""
+
+msgctxt "Layout Group (location). Parent table: scenes, Parent Group: details"
+msgid "Location"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: scenes, Parent Group: details, Parent Group: location"
+msgid "Contact Name"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: scenes, Parent Group: details_lower, Parent Group: notebook"
+msgid "Actor's Name"
+msgstr ""
+
diff --git a/examples/po_files/example_lesson_planner/example_lesson_planner.pot b/examples/po_files/example_lesson_planner/example_lesson_planner.pot
new file mode 100644
index 0000000..836385e
--- /dev/null
+++ b/examples/po_files/example_lesson_planner/example_lesson_planner.pot
@@ -0,0 +1,339 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Lesson Planner\n"
+"product=glom&keywords=I18N+L10N&component=general\n"
+"PO-Revision-Date: 2012-01-10 11:38+0100\n"
+"Last-Translator: Someone <someone someone com>\n"
+"Language-Team:  <someone someone com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgctxt "Field (product_name). Parent table: invoice_lines"
+msgid "Product Name"
+msgstr ""
+
+msgctxt "Field (product_id). Parent table: invoice_lines"
+msgid "Product Id"
+msgstr ""
+
+msgctxt "Field (product_price). Parent table: invoice_lines"
+msgid "Product Price"
+msgstr ""
+
+msgctxt "Field (invoice_id). Parent table: invoice_lines"
+msgid "Invoice ID"
+msgstr ""
+
+msgctxt "Field (count). Parent table: invoice_lines"
+msgid "Number Of"
+msgstr ""
+
+msgctxt "Field (total_price). Parent table: invoice_lines"
+msgid "Total Price"
+msgstr ""
+
+msgctxt "Field (vat_percentage). Parent table: invoice_lines"
+msgid "VAT Percentage"
+msgstr ""
+
+msgctxt "Field (total_price_vat). Parent table: invoice_lines"
+msgid "Total VAT"
+msgstr ""
+
+msgctxt "Table (lessons)"
+msgid "Lessons"
+msgstr ""
+
+msgctxt "Field (lesson_id). Parent table: lessons"
+msgid "Lesson ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: lessons"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: lessons"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (subject_id). Parent table: lessons"
+msgid "Subject ID"
+msgstr ""
+
+msgctxt "Field (teacher_id). Parent table: lessons"
+msgid "Teacher ID"
+msgstr ""
+
+msgctxt "Field (date). Parent table: lessons"
+msgid "Date"
+msgstr ""
+
+msgctxt "Field (time_start). Parent table: lessons"
+msgid "Start Time"
+msgstr ""
+
+msgctxt "Field (hours). Parent table: lessons"
+msgid "Hours"
+msgstr ""
+
+msgctxt "Field (room_id). Parent table: lessons"
+msgid "Room ID"
+msgstr ""
+
+msgctxt "Relationship (subject). Parent table: lessons"
+msgid "Subject"
+msgstr ""
+
+msgctxt "Relationship (teacher). Parent table: lessons"
+msgid "Teacher"
+msgstr ""
+
+msgctxt "Relationship (room). Parent table: lessons"
+msgid "Room"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: lessons"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: lessons"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (subject). Parent table: lessons, Parent Group: details"
+msgid "Subject"
+msgstr ""
+
+msgctxt "Layout Group (room). Parent table: lessons, Parent Group: details"
+msgid "Room"
+msgstr ""
+
+msgctxt "Layout Group (teacher). Parent table: lessons, Parent Group: details"
+msgid "Teacher"
+msgstr ""
+
+msgctxt "Table (rooms)"
+msgid "Rooms"
+msgstr ""
+
+msgctxt "Field (room_id). Parent table: rooms"
+msgid "Room ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: rooms"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: rooms"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (floor). Parent table: rooms"
+msgid "Floor"
+msgstr ""
+
+msgctxt "Field (building). Parent table: rooms"
+msgid "Building"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: rooms, Parent Field: building"
+msgid "Main Building"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: rooms, Parent Field: building"
+msgid "Science Block"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: rooms, Parent Field: building"
+msgid "Sports Hall"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: rooms"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: rooms"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (subjects)"
+msgid "Subjects"
+msgstr ""
+
+msgctxt "Field (subject_id). Parent table: subjects"
+msgid "Subject ID"
+msgstr ""
+
+msgctxt "Field (name). Parent table: subjects"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: subjects"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Relationship (lessons). Parent table: subjects"
+msgid "Lessons"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: subjects"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: subjects"
+msgid "Details"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: subjects, Parent Group: details"
+msgid "Teacher Name"
+msgstr ""
+
+msgctxt "Table (teachers)"
+msgid "Teachers"
+msgstr ""
+
+msgctxt "Field (teacher_id). Parent table: teachers"
+msgid "Teacher ID"
+msgstr ""
+
+msgctxt "Field (name_first). Parent table: teachers"
+msgid "First Name"
+msgstr ""
+
+msgctxt "Field (name_middle). Parent table: teachers"
+msgid "Middle Name"
+msgstr ""
+
+msgctxt "Field (name_last). Parent table: teachers"
+msgid "Last Name"
+msgstr ""
+
+msgctxt "Field (name_title). Parent table: teachers"
+msgid "Title"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: teachers, Parent Field: name_title"
+msgid "Mr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: teachers, Parent Field: name_title"
+msgid "Mrs"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: teachers, Parent Field: name_title"
+msgid "Ms"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: teachers, Parent Field: name_title"
+msgid "Miss"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: teachers, Parent Field: name_title"
+msgid "Dr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: teachers, Parent Field: name_title"
+msgid "Prof"
+msgstr ""
+
+msgctxt "Field (address_street). Parent table: teachers"
+msgid "Street"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: teachers"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_state). Parent table: teachers"
+msgid "State"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: teachers"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: teachers"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (date_of_birth). Parent table: teachers"
+msgid "Date of Birth"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: teachers"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name_full). Parent table: teachers"
+msgid "Full Name"
+msgstr ""
+
+msgctxt "Field (picture). Parent table: teachers"
+msgid "Picture"
+msgstr ""
+
+msgctxt "Field (email). Parent table: teachers"
+msgid "Email Address"
+msgstr ""
+
+msgctxt "Field (website). Parent table: teachers"
+msgid "Web Site"
+msgstr ""
+
+msgctxt "Field (tel_home). Parent table: teachers"
+msgid "Home Telephone"
+msgstr ""
+
+msgctxt "Field (tel_work). Parent table: teachers"
+msgid "Work Telephone"
+msgstr ""
+
+msgctxt "Field (tel_mobile). Parent table: teachers"
+msgid "Mobile Telephone"
+msgstr ""
+
+msgctxt "Field (tel_fax). Parent table: teachers"
+msgid "Fax"
+msgstr ""
+
+msgctxt "Relationship (lessons). Parent table: teachers"
+msgid "Lessons"
+msgstr ""
+
+msgctxt "Report (by_country). Parent table: teachers"
+msgid "Contacts By Country"
+msgstr ""
+
+msgctxt "Report (by_country_by_town). Parent table: teachers"
+msgid "By Country, By Town"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: teachers"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: teachers"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (name). Parent table: teachers, Parent Group: details, Parent Group: notebook"
+msgid "Name"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: teachers, Parent Group: details, Parent Group: notebook"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (telephone). Parent table: teachers, Parent Group: details, Parent Group: notebook"
+msgid "Telephone"
+msgstr ""
+
+msgctxt "Layout Group (other). Parent table: teachers, Parent Group: details, Parent Group: notebook"
+msgid "Other"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: teachers, Parent Group: details"
+msgid "Subject Name"
+msgstr ""
+
diff --git a/examples/po_files/example_music_collection/example_music_collection.pot b/examples/po_files/example_music_collection/example_music_collection.pot
new file mode 100644
index 0000000..9dc841d
--- /dev/null
+++ b/examples/po_files/example_music_collection/example_music_collection.pot
@@ -0,0 +1,183 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Music Collection\n"
+"product=glom&keywords=I18N+L10N&component=general\n"
+"PO-Revision-Date: 2012-01-10 11:38+0100\n"
+"Last-Translator: Someone <someone someone com>\n"
+"Language-Team:  <someone someone com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgctxt "Table (albums)"
+msgid "Albums"
+msgstr ""
+
+msgctxt "Field (album_id). Parent table: albums"
+msgid "Album ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: albums"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: albums"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (artist_id). Parent table: albums"
+msgid "Artist ID"
+msgstr ""
+
+msgctxt "Field (publisher_id). Parent table: albums"
+msgid "Publisher ID"
+msgstr ""
+
+msgctxt "Field (year). Parent table: albums"
+msgid "Year"
+msgstr ""
+
+msgctxt "Relationship (artist). Parent table: albums"
+msgid "Artist"
+msgstr ""
+
+msgctxt "Relationship (publisher). Parent table: albums"
+msgid "Publisher"
+msgstr ""
+
+msgctxt "Relationship (songs). Parent table: albums"
+msgid "Songs"
+msgstr ""
+
+msgctxt "Report (albums_by_artist). Parent table: albums"
+msgid "Albums By Artist"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: albums, Parent Report: albums_by_artist"
+msgid "Artist Name"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: albums"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: albums"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (artist). Parent table: albums, Parent Group: details"
+msgid "Artist"
+msgstr ""
+
+msgctxt "Layout Group (publisher). Parent table: albums, Parent Group: details"
+msgid "Publisher"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: albums, Parent Group: toplevel"
+msgid "Artist Name"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: albums, Parent Group: toplevel"
+msgid "Publisher Name"
+msgstr ""
+
+msgctxt "Table (artists)"
+msgid "Artists"
+msgstr ""
+
+msgctxt "Field (artist_id). Parent table: artists"
+msgid "Artist ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: artists"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: artists"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: artists"
+msgid "Name"
+msgstr ""
+
+msgctxt "Relationship (albums). Parent table: artists"
+msgid "Albums"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: artists"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: artists"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (publishers)"
+msgid "Publishers"
+msgstr ""
+
+msgctxt "Field (publishers_id). Parent table: publishers"
+msgid "Publisher ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: publishers"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: publishers"
+msgid "Name"
+msgstr ""
+
+msgctxt "Relationship (albums). Parent table: publishers"
+msgid "Albums"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: publishers"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: publishers"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (songs)"
+msgid "Songs"
+msgstr ""
+
+msgctxt "Field (song_id). Parent table: songs"
+msgid "Song ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: songs"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (album_id). Parent table: songs"
+msgid "Album ID"
+msgstr ""
+
+msgctxt "Field (name). Parent table: songs"
+msgid "Name"
+msgstr ""
+
+msgctxt "Relationship (album). Parent table: songs"
+msgid "Album"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: songs"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: songs"
+msgid "Details"
+msgstr ""
+
+msgctxt "Layout Group (album). Parent table: songs, Parent Group: details"
+msgid "Album"
+msgstr ""
+
+msgctxt "Layout Group (artist). Parent table: songs, Parent Group: details"
+msgid "Album Artist"
+msgstr ""
+
diff --git a/examples/po_files/example_project_manager/example_project_manager.pot b/examples/po_files/example_project_manager/example_project_manager.pot
new file mode 100644
index 0000000..55000ec
--- /dev/null
+++ b/examples/po_files/example_project_manager/example_project_manager.pot
@@ -0,0 +1,307 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Project Manager Example\n"
+"product=glom&keywords=I18N+L10N&component=general\n"
+"PO-Revision-Date: 2012-01-10 11:38+0100\n"
+"Last-Translator: Someone <someone someone com>\n"
+"Language-Team:  <someone someone com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgctxt "Table (contacts)"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: contacts"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (name_first). Parent table: contacts"
+msgid "First Name"
+msgstr ""
+
+msgctxt "Field (name_middle). Parent table: contacts"
+msgid "Middle Name"
+msgstr ""
+
+msgctxt "Field (name_last). Parent table: contacts"
+msgid "Last Name"
+msgstr ""
+
+msgctxt "Field (name_title). Parent table: contacts"
+msgid "Title"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Mr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Mrs"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Ms"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Miss"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Dr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Prof"
+msgstr ""
+
+msgctxt "Field (address_street). Parent table: contacts"
+msgid "Street"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: contacts"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_state). Parent table: contacts"
+msgid "State"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: contacts"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: contacts"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (date_of_birth). Parent table: contacts"
+msgid "Date of Birth"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: contacts"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name_full). Parent table: contacts"
+msgid "Full Name"
+msgstr ""
+
+msgctxt "Field (picture). Parent table: contacts"
+msgid "Picture"
+msgstr ""
+
+msgctxt "Field (email). Parent table: contacts"
+msgid "Email Address"
+msgstr ""
+
+msgctxt "Field (website). Parent table: contacts"
+msgid "Web Site"
+msgstr ""
+
+msgctxt "Field (tel_home). Parent table: contacts"
+msgid "Home Telephone"
+msgstr ""
+
+msgctxt "Field (tel_work). Parent table: contacts"
+msgid "Work Telephone"
+msgstr ""
+
+msgctxt "Field (tel_mobile). Parent table: contacts"
+msgid "Mobile Telephone"
+msgstr ""
+
+msgctxt "Field (tel_fax). Parent table: contacts"
+msgid "Fax"
+msgstr ""
+
+msgctxt "Relationship (team_members). Parent table: contacts"
+msgid "Team Membership"
+msgstr ""
+
+msgctxt "Report (by_country). Parent table: contacts"
+msgid "Contacts By Country"
+msgstr ""
+
+msgctxt "Report (by_country_by_town). Parent table: contacts"
+msgid "By Country, By Town"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: contacts"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (notebook). Parent table: contacts, Parent Group: details"
+msgid "(Notebook)"
+msgstr ""
+
+msgctxt "Layout Group (telephone). Parent table: contacts, Parent Group: details, Parent Group: notebook"
+msgid "Telephone"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: contacts, Parent Group: details, Parent Group: notebook"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (name). Parent table: contacts, Parent Group: details, Parent Group: notebook"
+msgid "Name"
+msgstr ""
+
+msgctxt "Table (projects)"
+msgid "Projects"
+msgstr ""
+
+msgctxt "Field (project_id). Parent table: projects"
+msgid "Project ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: projects"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: projects"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: projects"
+msgid "Name"
+msgstr ""
+
+msgctxt "Relationship (teams). Parent table: projects"
+msgid "Teams"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: projects"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: projects"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (project_teams)"
+msgid "Project Teams"
+msgstr ""
+
+msgctxt "Field (project_team_id). Parent table: project_teams"
+msgid "Project Team ID"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: project_teams"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (team_id). Parent table: project_teams"
+msgid "Team ID"
+msgstr ""
+
+msgctxt "Field (project_id). Parent table: project_teams"
+msgid "Project ID"
+msgstr ""
+
+msgctxt "Relationship (team). Parent table: project_teams"
+msgid "Team"
+msgstr ""
+
+msgctxt "Relationship (project). Parent table: project_teams"
+msgid "Project"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: project_teams"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: project_teams"
+msgid "Details"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: project_teams, Parent Group: details"
+msgid "Team Name"
+msgstr ""
+
+msgctxt "Custom Title. Parent table: project_teams, Parent Group: details"
+msgid "Project Name"
+msgstr ""
+
+msgctxt "Table (team_members)"
+msgid "Team Members"
+msgstr ""
+
+msgctxt "Field (team_members_id). Parent table: team_members"
+msgid "team_members ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: team_members"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: team_members"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: team_members"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (team_id). Parent table: team_members"
+msgid "Team ID"
+msgstr ""
+
+msgctxt "Field (role). Parent table: team_members"
+msgid "Role"
+msgstr ""
+
+msgctxt "Relationship (contacts). Parent table: team_members"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Relationship (team). Parent table: team_members"
+msgid "Team"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: team_members"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: team_members"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (teams)"
+msgid "Teams"
+msgstr ""
+
+msgctxt "Field (team_id). Parent table: teams"
+msgid "Team ID"
+msgstr ""
+
+msgctxt "Field (description). Parent table: teams"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: teams"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name). Parent table: teams"
+msgid "Name"
+msgstr ""
+
+msgctxt "Relationship (members). Parent table: teams"
+msgid "Members"
+msgstr ""
+
+msgctxt "Relationship (projects). Parent table: teams"
+msgid "Projects"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: teams"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: teams"
+msgid "Details"
+msgstr ""
+
diff --git a/examples/po_files/example_smallbusiness/example_smallbusiness.pot b/examples/po_files/example_smallbusiness/example_smallbusiness.pot
new file mode 100644
index 0000000..ae690b0
--- /dev/null
+++ b/examples/po_files/example_smallbusiness/example_smallbusiness.pot
@@ -0,0 +1,351 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Small Business Example\n"
+"product=glom&keywords=I18N+L10N&component=general\n"
+"PO-Revision-Date: 2012-01-10 11:38+0100\n"
+"Last-Translator: Someone <someone someone com>\n"
+"Language-Team:  <someone someone com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgctxt "Table (contacts)"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: contacts"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (name_first). Parent table: contacts"
+msgid "First Name"
+msgstr ""
+
+msgctxt "Field (name_middle). Parent table: contacts"
+msgid "Middle Name"
+msgstr ""
+
+msgctxt "Field (name_last). Parent table: contacts"
+msgid "Last Name"
+msgstr ""
+
+msgctxt "Field (name_title). Parent table: contacts"
+msgid "Title"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Mr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Mrs"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Ms"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Miss"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Dr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: contacts, Parent Field: name_title"
+msgid "Prof"
+msgstr ""
+
+msgctxt "Field (address_street). Parent table: contacts"
+msgid "Street"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: contacts"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_state). Parent table: contacts"
+msgid "State"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: contacts"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: contacts"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (date_of_birth). Parent table: contacts"
+msgid "Date of Birth"
+msgstr ""
+
+msgctxt "Field (comments). Parent table: contacts"
+msgid "Comments"
+msgstr ""
+
+msgctxt "Field (name_full). Parent table: contacts"
+msgid "Full Name"
+msgstr ""
+
+msgctxt "Field (picture). Parent table: contacts"
+msgid "Picture"
+msgstr ""
+
+msgctxt "Field (email). Parent table: contacts"
+msgid "Email Address"
+msgstr ""
+
+msgctxt "Field (website). Parent table: contacts"
+msgid "Web Site"
+msgstr ""
+
+msgctxt "Field (tel_home). Parent table: contacts"
+msgid "Home Telephone"
+msgstr ""
+
+msgctxt "Field (tel_work). Parent table: contacts"
+msgid "Work Telephone"
+msgstr ""
+
+msgctxt "Field (tel_mobile). Parent table: contacts"
+msgid "Mobile Telephone"
+msgstr ""
+
+msgctxt "Field (tel_fax). Parent table: contacts"
+msgid "Fax"
+msgstr ""
+
+msgctxt "Report (by_country). Parent table: contacts"
+msgid "Contacts By Country"
+msgstr ""
+
+msgctxt "Report (by_country_by_town). Parent table: contacts"
+msgid "By Country, By Town"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: contacts"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (name). Parent table: contacts, Parent Group: details"
+msgid "Name"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: contacts, Parent Group: details"
+msgid "Address"
+msgstr ""
+
+msgctxt "Layout Group (telephone). Parent table: contacts, Parent Group: details"
+msgid "Telephone"
+msgstr ""
+
+msgctxt "Button. Parent table: contacts, Parent Group: details"
+msgid "Test Button"
+msgstr ""
+
+msgctxt "Field (product_name). Parent table: invoice_lines"
+msgid "Product Name"
+msgstr ""
+
+msgctxt "Field (product_id). Parent table: invoice_lines"
+msgid "Product Id"
+msgstr ""
+
+msgctxt "Field (product_price). Parent table: invoice_lines"
+msgid "Product Price"
+msgstr ""
+
+msgctxt "Field (invoice_id). Parent table: invoice_lines"
+msgid "Invoice ID"
+msgstr ""
+
+msgctxt "Field (count). Parent table: invoice_lines"
+msgid "Number Of"
+msgstr ""
+
+msgctxt "Field (total_price). Parent table: invoice_lines"
+msgid "Total Price"
+msgstr ""
+
+msgctxt "Field (vat_percentage). Parent table: invoice_lines"
+msgid "VAT Percentage"
+msgstr ""
+
+msgctxt "Field (total_price_vat). Parent table: invoice_lines"
+msgid "Total VAT"
+msgstr ""
+
+msgctxt "Table (invoices)"
+msgid "Invoices"
+msgstr ""
+
+msgctxt "Field (invoice_id). Parent table: invoices"
+msgid "Invoice ID"
+msgstr ""
+
+msgctxt "Field (contact_id). Parent table: invoices"
+msgid "Contact ID"
+msgstr ""
+
+msgctxt "Field (date). Parent table: invoices"
+msgid "Date"
+msgstr ""
+
+msgctxt "Field (comment). Parent table: invoices"
+msgid "Comment"
+msgstr ""
+
+msgctxt "Field (price_total). Parent table: invoices"
+msgid "Total Price"
+msgstr ""
+
+msgctxt "Field (vat_total). Parent table: invoices"
+msgid "Total VAT"
+msgstr ""
+
+msgctxt "Field (price_total_with_vat). Parent table: invoices"
+msgid "Total Price With Vat"
+msgstr ""
+
+msgctxt "Relationship (invoice_lines). Parent table: invoices"
+msgid "Invoice Lines"
+msgstr ""
+
+msgctxt "Relationship (contacts). Parent table: invoices"
+msgid "Contacts"
+msgstr ""
+
+msgctxt "Report (By Customer). Parent table: invoices"
+msgid "By Customer"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: invoices"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (customer). Parent table: invoices, Parent Group: details"
+msgid "Customer"
+msgstr ""
+
+msgctxt "Table (products)"
+msgid "Products"
+msgstr ""
+
+msgctxt "Field (product_id). Parent table: products"
+msgid "Product ID"
+msgstr ""
+
+msgctxt "Field (comment). Parent table: products"
+msgid "Comment"
+msgstr ""
+
+msgctxt "Field (description). Parent table: products"
+msgid "Description"
+msgstr ""
+
+msgctxt "Field (name). Parent table: products"
+msgid "Name"
+msgstr ""
+
+msgctxt "Field (price). Parent table: products"
+msgid "Price"
+msgstr ""
+
+msgctxt "Field (vat_percent). Parent table: products"
+msgid "Vat Percent"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: products"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (details). Parent table: products"
+msgid "Details"
+msgstr ""
+
+msgctxt "Table (staff)"
+msgid "Staff"
+msgstr ""
+
+msgctxt "Field (staff_id). Parent table: staff"
+msgid "Staff ID"
+msgstr ""
+
+msgctxt "Field (name_title). Parent table: staff"
+msgid "Title"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: staff, Parent Field: name_title"
+msgid "Mr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: staff, Parent Field: name_title"
+msgid "Mrs"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: staff, Parent Field: name_title"
+msgid "Miss"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: staff, Parent Field: name_title"
+msgid "Dr"
+msgstr ""
+
+msgctxt "Field Choice. Parent table: staff, Parent Field: name_title"
+msgid "Prof"
+msgstr ""
+
+msgctxt "Field (name_first). Parent table: staff"
+msgid "First Name"
+msgstr ""
+
+msgctxt "Field (name_second). Parent table: staff"
+msgid "Second Name"
+msgstr ""
+
+msgctxt "Field (name_last). Parent table: staff"
+msgid "Last Name"
+msgstr ""
+
+msgctxt "Field (address_street). Parent table: staff"
+msgid "Street"
+msgstr ""
+
+msgctxt "Field (address_town). Parent table: staff"
+msgid "Town"
+msgstr ""
+
+msgctxt "Field (address_state). Parent table: staff"
+msgid "State"
+msgstr ""
+
+msgctxt "Field (address_country). Parent table: staff"
+msgid "Country"
+msgstr ""
+
+msgctxt "Field (address_postcode). Parent table: staff"
+msgid "Postcode"
+msgstr ""
+
+msgctxt "Field (date_of_birth). Parent table: staff"
+msgid "Date Of Birth"
+msgstr ""
+
+msgctxt "Field (position). Parent table: staff"
+msgid "Position"
+msgstr ""
+
+msgctxt "Layout Group (overview). Parent table: staff"
+msgid "Overview"
+msgstr ""
+
+msgctxt "Layout Group (name). Parent table: staff, Parent Group: details"
+msgid "Name"
+msgstr ""
+
+msgctxt "Layout Group (address). Parent table: staff, Parent Group: details"
+msgid "Address"
+msgstr ""
+
diff --git a/glom/glom_export_po.cc b/glom/glom_export_po.cc
index 87ac8cc..2ef3f22 100644
--- a/glom/glom_export_po.cc
+++ b/glom/glom_export_po.cc
@@ -43,6 +43,7 @@ public:
   //and as long as the OptionContext to which those OptionGroups are added.
   std::string m_arg_filepath_output;
   Glib::ustring m_arg_locale_id;
+  bool m_arg_template;
   bool m_arg_version;
 };
 
@@ -60,6 +61,11 @@ GlomCreateOptionGroup::GlomCreateOptionGroup()
   entry.set_short_name('l');
   entry.set_description(_("The locale whose translations should be written to the .po file, such as de_DE."));
   add_entry(entry, m_arg_locale_id);
+
+  entry.set_long_name("template");
+  entry.set_short_name('t');
+  entry.set_description(_("Generate a .pot template file instead of a .po file for a locale."));
+  add_entry(entry, m_arg_template);
   
   entry.set_long_name("version");
   entry.set_short_name('V');
@@ -138,9 +144,9 @@ int main(int argc, char* argv[])
     return EXIT_FAILURE;
   }
 
-  if(group.m_arg_locale_id.empty())
+  if(group.m_arg_locale_id.empty() && !(group.m_arg_template))
   {
-    std::cerr << _("Please specify a locale ID.") << std::endl;
+    std::cerr << _("Please use either the --locale-id option or the --template option.") << std::endl;
     std::cerr << std::endl << context.get_help() << std::endl;
     return EXIT_FAILURE;
   }
@@ -180,6 +186,7 @@ int main(int argc, char* argv[])
   Glib::RefPtr<Gio::File> file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_output);
   const Glib::ustring ouput_uri = file_output->get_uri();
 
+  /* Silently overwriting is easier when we use this in a batch:
   if(file_output->query_exists())
   {
     std::cerr << _("Glom: The output file aready exists.") << std::endl;
@@ -188,6 +195,7 @@ int main(int argc, char* argv[])
     std::cerr << std::endl << context.get_help() << std::endl;
     return EXIT_FAILURE;
   }
+  */
 
 
   // Load the document:
@@ -203,15 +211,30 @@ int main(int argc, char* argv[])
     return EXIT_FAILURE;
   }
 
-  const bool succeeded = 
-    Glom::write_translations_to_po_file(&document, ouput_uri, group.m_arg_locale_id);
-  if(!succeeded)
+  if(group.m_arg_template)
   {
-    std::cerr << _("Po file creation failed.") << std::endl;
-    return EXIT_FAILURE;
+    const bool succeeded = 
+      Glom::write_pot_file(&document, ouput_uri);
+    if(!succeeded)
+    {
+      std::cerr << _("Pot file creation failed.") << std::endl;
+      return EXIT_FAILURE;
+    }
+
+    std::cout << Glib::ustring::compose(_("Pot file created at: %1"), ouput_uri) << std::endl;
+  }
+  else
+  {
+    const bool succeeded = 
+      Glom::write_translations_to_po_file(&document, ouput_uri, group.m_arg_locale_id);
+    if(!succeeded)
+    {
+      std::cerr << _("Po file creation failed.") << std::endl;
+      return EXIT_FAILURE;
+    }
+
+    std::cout << Glib::ustring::compose(_("Po file created at: %1"), ouput_uri) << std::endl;
   }
-
-  std::cout << Glib::ustring::compose(_("Po file created at: %1"), ouput_uri) << std::endl;
 
   Glom::libglom_deinit();
 
diff --git a/glom/libglom/translations_po.cc b/glom/libglom/translations_po.cc
index 239e821..e1e6cca 100644
--- a/glom/libglom/translations_po.cc
+++ b/glom/libglom/translations_po.cc
@@ -142,6 +142,12 @@ Glib::ustring get_po_context_for_item(const sharedptr<const TranslatableItem>& i
   return result;
 }
 
+bool write_pot_file(Document* document, const Glib::ustring& pot_file_uri)
+{
+  //A .pot file 
+  return write_translations_to_po_file(document, pot_file_uri, Glib::ustring() /* no locale */);
+}
+
 bool write_translations_to_po_file(Document* document, const Glib::ustring& po_file_uri, const Glib::ustring& translation_locale, const Glib::ustring& locale_name)
 {
   std::string filename;
diff --git a/glom/libglom/translations_po.h b/glom/libglom/translations_po.h
index 4926697..b333a9c 100644
--- a/glom/libglom/translations_po.h
+++ b/glom/libglom/translations_po.h
@@ -26,6 +26,12 @@
 namespace Glom
 {
 
+/** Create a pot template file that can be used by translators to create a new .po file.
+ * @param document The document whose translations should be written to a .po file.
+ * @param pot_file The filepath at which to create a .po file.
+ */
+bool write_pot_file(Document* document, const Glib::ustring& pot_file_uri);
+
 /** Create a po file containing the translations from the Glom document.
  * @param document The document whose translations should be written to a .po file.
  * @param po_file The filepath at which to create a .po file.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]