1.21.2:

2012-01-11  Murray Cumming  <murrayc@murrayc.com>

	Fix make distcheck.

	* Makefile.am: Add messages.mo to CLEANFILES, though I would prefer 
  to not generate it in the first place. This is apparently triggered by 
  the presence of the .po files in examples/po_files/ though these are 
  not part of the build.

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:

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	Export .po files for the example files.

	* examples/po_files/example_film_manager/de.po:
	* examples/po_files/example_lesson_planner/de.po:
	* examples/po_files/example_music_collection/de.po:
	* examples/po_files/example_project_manager/de.po:
	* examples/po_files/example_smallbusiness/de.po:
	Hopefully people will translate these and add more,
	for me to import back into the .glom files with
	$ make examples_import_po

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	examples: Remove translations for useless locale.

	* examples/example_lesson_planner.glom:
	* examples/example_project_manager.glom:
	* examples/example_smallbusiness.glom:
	* ldtp/database-templates/PostgresCentral/Test.glom:
	* ldtp/database-templates/SQLite/Test.glom: For some reason
	these had translations for de_BE, de_AT, en_GB, and en_US.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	Translations: Prefer non-country-specific locales, such as de.

	* examples/example_film_manager.glom:
	* examples/example_lesson_planner.glom:
	* examples/example_music_collection.glom:
	* examples/example_project_manager.glom:
	* examples/example_smallbusiness.glom:
	* examples/sqlite/test_sqlite_music/test_sqlite_music.glom:
	* ldtp/database-templates/PostgresCentral/Test.glom:
	* ldtp/database-templates/SQLite/Test.glom:
	* tests/test_document_load_translations.cc:
	* tests/translations_po/test_document_export_po.cc:
	* tests/translations_po/test_document_import_po.cc:
	Replace de_DE with de.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	Translations: Offer non-country-specific language locales too.

	* Makefile_tests.am:
	* glom/libglom/utils.cc: locale_language_id(): Parse language-only
	locale IDs too.
	* glom/mode_design/iso_codes.cc: get_locale_name(): Create non-country
	locale IDs too, though they are not in the iso-codes XML file.
	* glom/mode_design/translation/window_translations.cc: Show, for instance
	German (de) as well as the existing German (Germany), German (Austria),
	etc.

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():
  Write the file manually instead of using gettext-po.h and its po_file_write(), 
  because that loses non-ASCII characters (see previous commit).
  make check now works.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	test_document_export_po: Test a special character.

	* tests/translations_po/test_document_export_po.cc:
	Demonstrate that the po file export currently drops non-ASCII characters.
  Apparently there is no way to tell po_file_write() to use UTF-8 encoding, 
  though that can be affected by code that uses the libgettext-po source code 
  itself, by setting output_format_po.requires_utf8.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	Add glom_import_po_all command-line utility.

	* glom/libglom/translations_po.cc: write_translations_to_po_file():
  Mark the document as modified so the changes will (or can be) saved.
	* Makefile_libglom.am:
	* glom/glom_import_po_all.cc: Add this command-line utility to read all 
	.po files in a directory back into the .glom file.
	
2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	Command-line utilities: Initialize gettext and the locale.

	* glom/glom_create_from_example.cc:
	* glom/glom_export_po.cc:
	* glom/glom_export_po_all.cc:
	* glom/glom_test_connection.cc: This should make the translations be used.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	glom_export_po_all: Actually export the translations.

	* glom/glom_export_po_all.cc: Use the available locale_id,
	instead of an unset variable that should not be used.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	export_po_all: Fix some typos.

	* glom/glom_export_po_all.cc: Fix some typos.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	test_document_load_translations: Test more fallbacks.

	* examples/example_film_manager.glom: Remove the useless en_GB translations.
	* tests/test_document_load_translations.cc: Check that similar locales 
  are used if there is no translation.

2012-01-09  Murray Cumming  <murrayc@murrayc.com>

	Added glom_export_po_all command-line too.

	* Makefile_libglom.am:
	* glom/glom_export_po_all.cc: This outputs all .po files to a directory.

2012-01-08  Murray Cumming  <murrayc@murrayc.com>

	test_document_export_po: Use msgfmt -c to test the exported .po file.

	* configure.ac: Get the path for msgfmt.
	* tests/translations_po/test_document_export_po.cc: Use msgfmt -c to
	check the new .po file.

2012-01-08  Murray Cumming  <murrayc@murrayc.com>

	glom_export_po: Let the user choose the locale ID.

	* glom/glom_export_po.cc: Add, and use, a --locale-id (-l) option
	instead of just hard-coding de_DE.

2012-01-08  Murray Cumming  <murrayc@murrayc.com>

	Export to po file: Write a po file header.

	* glom/libglom/translations_po.[h|cc]: write_translations_to_po_file():
	Add an optional locale_name parameter. We cannot discover this inside
	the function because we only use iso-codes in glom, not libglom, and 
	I would prefer not to move that static data into libglom.
	* glom/mode_design/translation/window_translations.cc: 
	on_button_export():Pass the extra locale_name parameter.
	* tests/translations_po/data/test.po: Resave.

	This makes the written .po file pass validation by msgfmt -c on the 
	command line.

2012-01-08  Murray Cumming  <murrayc@murrayc.com>

	Import of po files: Handle empty gettext strings.

	* glom/libglom/translations_po.cc: Handle empty msgid, msgstr and 
	msgctxt.

2012-01-08  Murray Cumming  <murrayc@murrayc.com>

	Export to po file: Improve the msgtxt hints more.

	* glom/libglom/document/document.cc: fill_translatable_layout_items():
	Mention the parent groups in the hints, t omake them more unique.
	* tests/translations_po/data/test.po: Resaved.

2012-01-08  Murray Cumming  <murrayc@murrayc.com>

	Export to po file: Improve the msgtxt hints.

	* glom/libglom/data_structure/translatable_item.[h|cc]: 
	get_translatable_item_type(): Make this const.
	* glom/libglom/document/document.[h|cc]: get_translatable_items():
	Now return a list of pairs, so each TranslatableItem also has a hint
	for the msgtxt for the po (gettext) file, so that each can be 
	identified uniquely and so that the translator has some context.
	* glom/libglom/translations_po.[h|cc]: Adapt.
	* glom/mode_design/translation/window_translations.[h|cc]: Adapt,
	showing the actual hint instead of just the item type.
	* tests/test_document_load_translations.cc: Adapted.
	* tests/translations_po/data/test.po: Reexported.

2012-01-07  Murray Cumming  <murrayc@murrayc.com>

	Move po file (gettext) import and export into libglom and test it.

	* glom/mode_design/translation/window_translations.[h|cc]:
	load_from_document(), save_to_document(): Move the collecting of
	translatable items to:
	* glom/libglom/document/document.[h|cc]: get_translatable_items();
	Also move the gettext/po import/export to:
	* Makefile_libglom.am:
	* glom/libglom/filelist.am:
	* glom/libglom/translations_po.[h|cc]: write_translations_to_po_file()
	and import_translations_from_po_file().

	* Makefile_tests.am
	* tests/translations_po/data/test.po:
	* tests/translations_po/test_document_export_po.cc:
	* tests/translations_po/test_document_import_po.cc: Add tests of the new 
	libglom functions.

	* Makefile_glom.am
	* glom/glom_export_po.cc: Added a new command-line tool that uses the
	new libglom API.

2012-01-07  Murray Cumming  <murrayc@murrayc.com>

	test_document_load: Fix a typo.

	* tests/test_document_load.cc: Check the correct variable.

2012-01-06  Murray Cumming  <murrayc@murrayc.com>

	Replace most uses of g_object_set() with C++ code.

	* glom/mode_data/datawidget/cellcreation.cc:
	* glom/mode_data/datawidget/combochoiceswithtreemodel.cc:
	* glom/mode_data/db_adddel/db_adddel.cc:
	* glom/mode_design/layout/dialog_layout_export.cc:
	* glom/utility_widgets/adddel/adddel.cc:
	Apart from some uses, due to GTK+ bug #667415 .

	These were probably using C code due to the reduced API on Maemo,
	but we remove the Maemo code a while ago.

2012-01-06  Murray Cumming  <murrayc@murrayc.com>

	List: Custom choices: Make them work here too.

	* glom/libglom/data_structure/layout/fieldformatting.[h|cc]:
	Added get_custom_choice_original_for_translated_text() and
	get_custom_choice_translated() to convert between original and 
	translated choice text.
	* glom/libglom/data_structure/layout/layoutitem_field.[h|cc]:
	Add a get_formatting_used_has_translatable_choices() convenience method.
	* tests/test_document_load_translations.cc: Test these new methods.

	* glom/mode_data/datawidget/cellcreation.cc: create_cell():
	Pass the restricted bool to set_choices_restricted() so that the
	translations can be used.
	* glom/mode_data/db_adddel/db_adddel.cc:
	on_treeview_cell_edited(): store only the original (not translated) 
	text in the database so that other locales can also show their own 
	translations.
	treeviewcolumn_on_cell_data(): Show the translated text, not the 
	original.

2012-01-05  Murray Cumming  <murrayc@murrayc.com>

	DTD: formatting: Mention choices_restricted to fix make check.

	* glom/glom_document.dtd: Note that this is not a new part of the
	file format. We just never used it in an example before.

2012-01-04  Murray Cumming  <murrayc@murrayc.com>

	Custom Choices: Allow these to be translated when used for text fields. 

	* glom/libglom/filelist.am:
	* glom/libglom/data_structure/layout/choicevalue.[h|cc]: Add the
	ChoiceValue translatable item. The translations are only meaningful
	when this is used for a text field.
	* glom/libglom/data_structure/translatable_item.[h|cc]:
	Make get_title_original() virtual, so ChoiceValue can override it,
	to return a text representation of its Gnome::Gda::Value.
	Always use get_title_original() instead of the member variable,
	so that the method override is used when appropriate.
	* glom/libglom/data_structure/layout/fieldformatting.h:
	set/get_choices_custom(): Return a list of ChoiceValues instead of 
	Gnome::Gda::Values.
	* glom/mode_data/datawidget/cellcreation.cc:
	* glom/mode_design/layout/layout_item_dialogs/box_formatting.cc: Adapt.

	* glom/libglom/document/document.[h|cc]: 
	load_after_layout_item_formatting(), save_before_layout_item_formatting():
	Adapt and load/save the ChoiceValue translations too.
	fill_translatable_layout_items(): Return the ChoiceValue items too.
	Add a static fill_translatable_custom_choices() helper function. 

	* glom/mode_data/datawidget/combochoices.h: set_choices_fixed():
	Add an optional restricted parameter, because the translations are 
	only useful if the choices are restricted.
	* glom/mode_data/datawidget/cellrenderer_dblist.[h|cc]:
	* glom/mode_data/datawidget/combo_as_radio_buttons.[h|cc]:
	* glom/mode_data/datawidget/datawidget.cc:Adapted.
	* glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]:
	set_choices_fixed(): Use get_title() if the choice could be translated.
	* glom/mode_data/datawidget/combo.[h|cc]: set_choices_fixed():
	Use the (translated) text value if the choice could be translated.

	* glom/mode_design/translation/window_translations.cc:
	load_from_document(): For text fields, handle the ChoiceValues too.

	* tests/test_document_load.cc: Adapt.
	* tests/test_document_load_translations.cc: Test ChoiceValue 
	translations too.
	* examples/example_film_manager.glom: Add some translations for the 
	Scene::Day/Night field's choices. Also make the choices for this 
	field restricted, so the translations can be used.
	* glom/glom_document.dtd: custom_choice: Mention the new trans_set
	child tags.

	This fixes bug #666343

2012-01-04  Murray Cumming  <murrayc@murrayc.com>

	Details: Make restricted choices work.

	* glom/mode_data/datawidget/combochoiceswithtreemode.[h|cc]:
	on_cell_data(): Move some code into set_cell_for_field_value().
	* glom/mode_data/datawidget/combo.[h|cc]: on_fixed_cell_data():
	Connect a cell_data slot that uses set_cell_for_field_value(), 
	instead of trying to associate a Gnome::Gda::Value with a cell's text 
	property. 

	Without this, the choice combobox's rows were empty when the field's
	value should be restricted to the available custom (fixed) choices.