@@ -821,6 +821,9 @@ function showForm() {
821821
822822 // überprüfe, ob das Template existiert, wenn nicht
823823 // dann generiere das Template
824+
825+ // Translate the title of the tab
826+ $ tab ['title ' ] = $ this ->lng ($ tab ['title ' ]);
824827
825828 if (!is_file ($ tab ["template " ])) {
826829 $ app ->uses ('tform_tpl_generator ' );
@@ -849,8 +852,8 @@ function showForm() {
849852 $ app ->tpl ->setVar ('form_active_tab ' ,$ active_tab );
850853
851854 // Set form title
852- $ form_hint = '<b> ' .$ this ->formDef ["title " ].'</b> ' ;
853- if ($ this ->formDef ["description " ] != '' ) $ form_hint .= '<br><br> ' .$ this ->formDef ["description " ];
855+ $ form_hint = '<b> ' .$ this ->lng ( $ this -> formDef ["title " ]) .'</b> ' ;
856+ if ($ this ->formDef ["description " ] != '' ) $ form_hint .= '<br><br> ' .$ this ->lng ( $ this -> formDef ["description " ]) ;
854857 $ app ->tpl ->setVar ('form_hint ' ,$ form_hint );
855858
856859 // Set Wordbook for this form
@@ -1020,6 +1023,19 @@ function getNextTab() {
10201023 function getCurrentTab () {
10211024 return $ _SESSION ["s " ]["form " ]["tab " ];
10221025 }
1026+
1027+
1028+ // translation function for forms, tries the form wordbook first and if this fails, it tries the global wordbook
1029+ function lng ($ msg ) {
1030+ global $ app ;
1031+
1032+ if (isset ($ this ->wordbook [$ msg ])) {
1033+ return $ this ->wordbook [$ msg ];
1034+ } else {
1035+ return $ app ->lng ($ msg );
1036+ }
1037+
1038+ }
10231039
10241040}
10251041
0 commit comments