Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-05-13-15-51-23
[civicrm-core.git] / templates / CRM / common / l10n.js.tpl
index 44f5498a55963a841eee0351c163368b681a1e05..d0c094bf0bbc471d808d9ea0cd106597cb00c447 100644 (file)
@@ -2,7 +2,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
   CRM.config.userFramework = {$config->userFramework|@json_encode};
   CRM.config.resourceBase = {$config->resourceBase|@json_encode};
   CRM.config.lcMessages = {$config->lcMessages|@json_encode};
+  $.datepicker._defaults.dateFormat = CRM.config.dateInputFormat = {$config->dateInputFormat|@json_encode};
+  CRM.config.timeIs24Hr = {if $config->timeInputFormat eq 2}true{else}false{/if};
+  CRM.config.ajaxPopupsEnabled = {$ajaxPopupsEnabled|@json_encode};
+  CRM.config.userFrameworkResourceURL = {$config->userFrameworkResourceURL|@json_encode};
 
   // Merge entityRef settings
   CRM.config.entityRef = $.extend({ldelim}{rdelim}, {$entityRef|@json_encode}, CRM.config.entityRef || {ldelim}{rdelim});
 
   // Initialize CRM.url and CRM.formatMoney
   CRM.url({ldelim}back: '{crmURL p="*path*" q="*query*" h=0 fb=1}', front: '{crmURL p="*path*" q="*query*" h=0 fe=1}'{rdelim});
-  CRM.formatMoney('init', {$moneyFormat});
+  CRM.formatMoney('init', false, {$moneyFormat});
 
   // Localize select2
   $.fn.select2.defaults.formatNoMatches = "{ts escape='js'}None found.{/ts}";
   // Localize jQuery UI
   $.ui.dialog.prototype.options.closeText = "{ts escape='js'}Close{/ts}";
 
+  // Localize jQuery DataTables
+  // Note the first two defaults set here aren't localization related,
+  // but need to be set globally for all DataTables.
+  $.extend( $.fn.dataTable.defaults, {ldelim}
+    "searching": false,
+    "jQueryUI": true,
+    "language": {ldelim}
+      "emptyTable": "{ts escape='js'}None found.{/ts}",
+      "info":  "{ts escape='js' '1=_START_ 2=_END_ 3=_TOTAL_}Showing %1 to %2 of %3 entries{/ts}",
+      "infoEmpty": "{ts escape='js'}Showing 0 to 0 of 0 entries{/ts}",
+      "infoFiltered": "{ts escape='js' 1=_MAX_}(filtered from %1 total entries){/ts}",
+      "infoPostFix": "",
+      "thousands": {$config->monetaryThousandSeparator|json_encode},
+      "lengthMenu": "{ts escape='js' 1=_MENU_}Show %1 entries{/ts}",
+      "loadingRecords": " ",
+      "processing": " ",
+      "zeroRecords": "{ts escape='js'}None found.{/ts}",
+      "paginate": {ldelim}
+        "first": "{ts escape='js'}First{/ts}",
+        "last": "{ts escape='js'}Last{/ts}",
+        "next": "{ts escape='js'}Next{/ts}",
+        "previous": "{ts escape='js'}Previous{/ts}"
+      {rdelim}
+    {rdelim}
+  {rdelim});
+
   // Localize strings for jQuery.validate
   var messages = {ldelim}
     required: "{ts escape='js'}This field is required.{/ts}",