@@ -132,7 +132,48 @@ function buildHTML($listDef,$module = '') {
132132 }
133133 fclose ($ handle );
134134
135+ /*$lang["page_txt"] = 'Page';
136+ $lang["page_of_txt"] = 'of';
137+ $lang["page_next_txt"] = 'Next';
138+ $lang["page_back_txt"] = 'Back';
139+ $lang["delete_txt"] = 'Delete';
140+ $lang["filter_txt"] = 'Filter';
141+ $lang["add_new_record_txt"] = 'Add new record';
142+ */
143+
144+ // save language file
145+ $ this ->lng_add ($ lang ,$ listDef ,$ module );
135146 }
147+
148+ function lng_add ($ lang ,$ listDef ,$ module = '' ) {
149+ global $ go_api , $ go_info ,$ conf ;
150+
151+ if ($ module == '' ) {
152+ $ lng_file = "lib/lang/ " .$ conf ["language " ]."_ " .$ listDef ['name ' ]."_list.lng " ;
153+ } else {
154+ $ lng_file = '../ ' .$ module ."/lib/lang/en_ " .$ listDef ['name ' ]."_list.lng " ;
155+ }
156+
157+ if (is_file ($ lng_file )) {
158+ include_once ($ lng_file );
159+ } else {
160+ $ wb = array ();
161+ }
162+
163+ $ wb_out = array_merge ($ lang ,$ wb );
164+
165+ if (is_array ($ wb_out )) {
166+ $ fp = fopen ($ lng_file , "w " );
167+ fwrite ($ fp ,"<?php \r\n" );
168+ foreach ($ wb_out as $ key => $ val ) {
169+ $ new_line = '$wb[" ' .$ key .'"] = ' ."' $ val'; \r\n" ;
170+ fwrite ($ fp ,$ new_line );
171+
172+ }
173+ fwrite ($ fp ,"?> " );
174+ fclose ($ fp );
175+ }
176+ }
136177
137178}
138179
0 commit comments