apply proper I18N-ification to new template builder functionality
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 14 Mar 2009 02:56:11 +0000 (02:56 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 14 Mar 2009 02:56:11 +0000 (02:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12516 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/reports/nls/reports.js
Open-ILS/web/opac/locale/en-US/reports.dtd
Open-ILS/web/reports/xul/source-browse.js
Open-ILS/web/reports/xul/source-setup.js
Open-ILS/web/reports/xul/template_builder.xul

index 3f61b84..f9b72e5 100644 (file)
@@ -1,5 +1,10 @@
 {
        "RPT_BUILDER_CONFIRM_SAVE": "Name : ${0}\nDescription: ${1}\nSave Template?",
+
+    "LINK_NULLABLE_DEFAULT": "Default",
+    "LINK_NULLABLE_RIGHT": "Parent",
+    "LINK_NULLABLE_LEFT": "Child",
+    "LINK_NULLABLE_NONE": "None",
        
        "FILTERS_LABEL_EQUALS":"Equals",
        "FILTERS_LABEL_LIKE": "Contains Matching substring",
index 72bd39e..51baaf0 100644 (file)
 <!ENTITY reports.xul.template_builder.db_source_browser.label "Database Source Browser">
 <!ENTITY reports.xul.template_builder.sources_menulist.label "Sources">
 <!ENTITY reports.xul.template_builder.source_name.label "Source Name">
+<!ENTITY reports.xul.template_builder.source_nullable.label "Nullable">
+<!ENTITY reports.xul.template_builder.nullability_select.label "Enable nullability seletion">
 <!ENTITY reports.xul.template_builder.source_specifier.label "Source Specifier:">
 <!ENTITY reports.xul.template_builder.field_name.label "Field Name">
 <!ENTITY reports.xul.template_builder.data_type.label "Data Type">
index df13f95..4075dd1 100644 (file)
@@ -66,7 +66,7 @@ function sourceTreeHandler (ev, dbl) {
 
                                subtreeList.push(
                                        { name : name,
-                                         nullable : 'Default',
+                                         nullable : rpt_strings.LINK_NULLABLE_DEFAULT,
                                          idlclass : idlclass,
                                          map : map,
                                          key : key,
@@ -77,67 +77,67 @@ function sourceTreeHandler (ev, dbl) {
                                        }
                                );
 
-                               if ($('nullable-source-control').checked) {
-                                       if (reltype == 'has_a') {
-                                               subtreeList.push(
-                                                       { name : name,
-                                                         nullable : 'Parent', //rpt_strings.LINK_NULLABLE_RIGHT,
-                                                         idlclass : idlclass,
-                                                         map : map,
-                                                         key : key,
-                                                         join : 'right',
-                                                         field : field.getAttribute('name'),
-                                                         reltype : reltype,
-                                                         link : link,
-                                                         fullpath : fullpath + '>right'
-                                                       }
-                                               );
+                if ($('nullable-source-control').checked) {
+                       if (reltype == 'has_a') {
+                                       subtreeList.push(
+                                               { name : name,
+                                 nullable : rpt_strings.LINK_NULLABLE_RIGHT,
+                                                 idlclass : idlclass,
+                                                 map : map,
+                                                 key : key,
+                                                     join : 'right',
+                                                 field : field.getAttribute('name'),
+                                                 reltype : reltype,
+                                                 link : link,
+                                                 fullpath : fullpath + '>right'
+                                               }
+                                       );
        
-                                               subtreeList.push(
-                                                       { name : name,
-                                                         nullable : 'None',  //rpt_strings.LINK_NULLABLE_NONE
-                                                         idlclass : idlclass,
-                                                         map : map,
-                                                         key : key,
-                                                         join : 'inner',
-                                                         field : field.getAttribute('name'),
-                                                         reltype : reltype,
-                                                         link : link,
-                                                         fullpath : fullpath + '>inner'
-                                                       }
-                                               );
-
-                                       } else {
-                                               subtreeList.push(
-                                                       { name : name,
-                                                         nullable : 'Child', //rpt_strings.LINK_NULLABLE_LEFT,
-                                                         idlclass : idlclass,
-                                                         map : map,
-                                                         key : key,
-                                                         join : 'left',
-                                                         field : field.getAttribute('name'),
-                                                         reltype : reltype,
-                                                         link : link,
-                                                         fullpath : fullpath + '>left'
-                                                       }
-                                               );
+                                       subtreeList.push(
+                                               { name : name,
+                                 nullable : rpt_strings.LINK_NULLABLE_NONE,
+                                                 idlclass : idlclass,
+                                                 map : map,
+                                                     key : key,
+                                                     join : 'inner',
+                                                 field : field.getAttribute('name'),
+                                                 reltype : reltype,
+                                                 link : link,
+                                                 fullpath : fullpath + '>inner'
+                                               }
+                                       );
        
-                                               subtreeList.push(
-                                                       { name : name,
-                                                         nullable : 'None',  //rpt_strings.LINK_NULLABLE_NONE
-                                                         idlclass : idlclass,
-                                                         map : map,
-                                                         key : key,
-                                                         join : 'inner',
-                                                         field : field.getAttribute('name'),
-                                                         reltype : reltype,
-                                                         link : link,
-                                                         fullpath : fullpath + '>inner'
-                                                       }
-                                               );
+                       } else{
+                                       subtreeList.push(
+                                               { name : name,
+                                 nullable : rpt_strings.LINK_NULLABLE_LEFT,
+                                                 idlclass : idlclass,
+                                                 map : map,
+                                                 key : key,
+                                                     join : 'left',
+                                                 field : field.getAttribute('name'),
+                                                 reltype : reltype,
+                                                 link : link,
+                                                 fullpath : fullpath + '>left'
+                                               }
+                                       );
        
-                                       }
-                               }
+                                       subtreeList.push(
+                                               { name : name,
+                                 nullable : rpt_strings.LINK_NULLABLE_NONE,
+                                                 idlclass : idlclass,
+                                                 map : map,
+                                                     key : key,
+                                                     join : 'inner',
+                                                 field : field.getAttribute('name'),
+                                                 reltype : reltype,
+                                                 link : link,
+                                                 fullpath : fullpath + '>inner'
+                                               }
+                                       );
+       
+                       }
+                }
                        }
 
                        populateSourcesSubtree( item.lastChild, subtreeList );
index 8e902de..018e101 100644 (file)
@@ -276,10 +276,17 @@ function populateDetailTree (tcNode, c, item) {
                        var field_name = atom[1];
                        var join_type = field_name;
 
-                       field_name = field_name.split(/>/)[0];
-                       join_type = join_type.split(/>/)[1];
-
-                       if (join_type) _label += ' (' + join_type + ')'; 
+                       switch (join_type) {
+                               case 'right':
+                                       _label += ' (' + rpt_strings.LINK_NULLABLE_RIGHT + ')'; 
+                                       break;
+                               case 'left':
+                                       _label += ' (' + rpt_strings.LINK_NULLABLE_LEFT + ')'; 
+                                       break;
+                               case 'inner':
+                                       _label += ' (' + rpt_strings.LINK_NULLABLE_NONE + ')'; 
+                                       break;
+                       }
                }
 
                path_label.push(_label); 
index 3ffd297..688ea8e 100644 (file)
                                        ondblclick="sourceTreeHandlerDblClick(event)"
                                >
                                        <treecols>
-                                               <treecol label="Nullable" flex="0"/>
+                                               <treecol label="&reports.xul.template_builder.source_nullable.label;" flex="0"/>
                                                <treecol primary="true" label="&reports.xul.template_builder.source_name.label;" flex="1"/>
                                        </treecols>
                                        <treechildren id="sources-treetop" alternatingbackground="true" />
                                </tree>
-                <checkbox id="nullable-source-control" label="Enable nullability seletion"/>
+                <checkbox id="nullable-source-control" label="&reports.xul.template_builder.nullability_select.label;"/>
                        </vbox>
                </hbox>