[glom] test_document_load_translations: Test title_singular too.



commit 8d360f1bb883c5ec1a06532d9c65c9e730d7c60b
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 13 17:56:47 2012 +0100

    test_document_load_translations: Test title_singular too.
    
    	* examples/example_film_manager.glom: Scenes table: Add a German
    	translation of the singular title.
    	* tests/test_document_load_translations.cc: Test
    	Document::get_table_title_singular() in the original and de locales.

 ChangeLog                                |    9 +++++++++
 examples/example_film_manager.glom       |    6 +++++-
 tests/test_document_load_translations.cc |    4 +++-
 3 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 16ad234..b031994 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2012-01-13  Murray Cumming  <murrayc murrayc com>
 
+	test_document_load_translations: Test title_singular too.
+
+	* examples/example_film_manager.glom: Scenes table: Add a German
+	translation of the singular title.
+	* tests/test_document_load_translations.cc: Test 
+	Document::get_table_title_singular() in the original and de locales.
+
+2012-01-13  Murray Cumming  <murrayc murrayc com>
+
 	Import .po translations into the .glom example files.
 
 	* examples/example_film_manager.glom:
diff --git a/examples/example_film_manager.glom b/examples/example_film_manager.glom
index 29e8311..d6fea4c 100644
--- a/examples/example_film_manager.glom
+++ b/examples/example_film_manager.glom
@@ -4432,7 +4432,11 @@ Orientation=portrait
       <trans loc="de" val="Szenen"/>
       <trans loc="es" val="Escenas"/>
     </trans_set>
-    <title_singular title="Scene"/>
+    <title_singular title="Scene">
+      <trans_set>
+        <trans loc="de" val="Szene"/>
+      </trans_set>
+    </title_singular>
     <fields>
       <field name="scene_id" primary_key="true" unique="true" auto_increment="true" type="Number" title="Scene ID">
         <formatting format_thousands_separator="true" format_decimal_places="2"/>
diff --git a/tests/test_document_load_translations.cc b/tests/test_document_load_translations.cc
index 1ef9326..8a320d9 100644
--- a/tests/test_document_load_translations.cc
+++ b/tests/test_document_load_translations.cc
@@ -239,17 +239,19 @@ int main()
   }
 
   const std::vector<Glib::ustring> locales = document.get_translation_available_locales();
-  g_assert(locales.size() == 2);
+  g_assert(locales.size() == 4);
   g_assert(contains(locales, "de"));
 
   const std::vector<Glib::ustring> table_names = document.get_table_names();
   g_assert(contains(table_names, "scenes"));
 
   g_assert( document.get_table_title("scenes") == "Scenes" );
+  g_assert( document.get_table_title_singular("scenes") == "Scene" );
   
   const Glib::ustring locale_original = Glom::TranslatableItem::get_current_locale();
   Glom::TranslatableItem::set_current_locale(locale_de);
   g_assert( document.get_table_title("scenes") == "Szenen" );
+  g_assert( document.get_table_title_singular("scenes") == "Szene" ); //TODO: Make this is translated correctly.
   Glom::TranslatableItem::set_current_locale(locale_original);
 
   //Check a field:



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