diff --git a/web/CXM_jquery_datatable.anubis b/web/CXM_jquery_datatable.anubis index 6012a7a..9e870e0 100644 --- a/web/CXM_jquery_datatable.anubis +++ b/web/CXM_jquery_datatable.anubis @@ -10,8 +10,10 @@ read calexium_lib/web/CXM_making_a_web_site.anubis read calexium_lib/web/CXM_jquery.anubis read calexium_lib/web/CXM_jquery_datatable_types.anubis +read calexium_lib/web/jquery/CXM_jquery_datatable_translation.anubis read tools/basis.anubis read system/string.anubis +read system/convert.anubis /* Initialize jQuery in compatiblity mode with jQueryUI */ public define List(HTML_Head_Tag) @@ -57,15 +59,7 @@ public define HTML_Partial_Content else jquery_datatable(table_id, table) . - -public define String - bool_to_string - ( - Bool b - ) - = - if b then "true" else "false" - . + public define HTML_Partial_Content jquery_datatable @@ -77,7 +71,8 @@ public define HTML_Partial_Content JQuery_datatable_pagination_type pagination_type, Bool enable_change_page_length, // if true, "enable_pagination" must be true too. Bool enable_search_field, - Bool enable_columns_sorting + Bool enable_columns_sorting, + String lang ) = partial_content( @@ -90,12 +85,13 @@ public define HTML_Partial_Content { $('#"+table_id+"').dataTable( { - \"bJQueryUI\":"+bool_to_string(enable_jqueryui)+", + \"bJQueryUI\":"+to_String(enable_jqueryui)+", \"sPaginationType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"', - \"bFilter\":"+bool_to_string(enable_search_field)+", - \"bPaginate\":"+bool_to_string(enable_pagination)+", - \"bLengthChange\":"+bool_to_string(enable_change_page_length)+", - \"bSort\":"+bool_to_string(enable_columns_sorting)+" + \"bFilter\":"+to_String(enable_search_field)+", + \"bPaginate\":"+to_String(enable_pagination)+", + \"bLengthChange\":"+to_String(enable_change_page_length)+", + \"bSort\":"+to_String(enable_columns_sorting)+","+ + get_datatable_translation(lang)+" }); }); " @@ -105,3 +101,17 @@ public define HTML_Partial_Content table ) . + +public define HTML_Partial_Content + jquery_datatable + ( + String table_id, + HTML_Off_Form table, + Bool enable_jqueryui, + Bool enable_pagination, + JQuery_datatable_pagination_type pagination_type, + Bool enable_change_page_length, // if true, "enable_pagination" must be true too. + Bool enable_search_field, + Bool enable_columns_sorting + ) = + jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, enable_change_page_length, enable_search_field, enable_columns_sorting, "en"). diff --git a/web/jQuery/CXM_jquery_datatable_translation.anubis b/web/jQuery/CXM_jquery_datatable_translation.anubis new file mode 100644 index 0000000..2529704 --- /dev/null +++ b/web/jQuery/CXM_jquery_datatable_translation.anubis @@ -0,0 +1,25 @@ +/* + * Created by PyramIDE. + * User: Totoro + * Date: 17/09/2012 + * Time: 17:37 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + + +public define String + get_datatable_translation + ( + String language + )= + with file = if language = "en" then "en" else + if language = "fr" then "fr" else + if language = "zh" then "zh" else + if language = "ja" then "ja" else + "en", + "\"oLanguage\": { + \"sUrl\": \"/js/jquery/dataTables/"+file+".txt\" + }". + + -- libgit2 0.21.4