i18n.js.php 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. session_start();
  3. if (empty($_SESSION['language'])) {
  4. $_SESSION['language'] = 'en';
  5. }
  6. require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php');
  7. if (!function_exists('_translate')) {
  8. function _translate() {
  9. global $LANG;
  10. $args = func_get_args();
  11. $l = $args[0];
  12. if (!$l) return 'NO LANGUAGE DEFINED';
  13. $key = $args[1];
  14. if (!isset($LANG[$l])) {
  15. require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$l.'.php');
  16. }
  17. if (!isset($LANG[$l][$key])) {
  18. $text=$key;
  19. } else {
  20. $text=$LANG[$l][$key];
  21. }
  22. array_shift($args);
  23. if (count($args)>1) {
  24. $args[0] = $text;
  25. return call_user_func_array("sprintf",$args);
  26. } else {
  27. return $text;
  28. }
  29. }
  30. }
  31. if (!function_exists('__')) {
  32. function __() {
  33. $args = func_get_args();
  34. array_unshift($args,$_SESSION['language']);
  35. return call_user_func_array("_translate",$args);
  36. }
  37. }
  38. ?>
  39. App.i18n.ARE_YOU_SURE = '<?=__('Are you sure?')?>';
  40. App.Constants.UNLIM_TRANSLATED_VALUE = '<?=__('unlimited')?>';
  41. App.Constants.FM_HIT = '<?=__('Hit')?>';
  42. App.Constants.FM_TO_RELOAD_THE_PAGE = '<?=__('to reload the page')?>'
  43. App.Constants.FM_DIRECTORY_NAME_CANNOT_BE_EMPTY = '<?=__('Directory name cannot be empty')?>';
  44. App.Constants.FM_FILE_NAME_CANNOT_BE_EMPTY = '<?=__('File name cannot be empty')?>';
  45. App.Constants.FM_NO_FILE_SELECTED = '<?=__('No file selected')?>';
  46. App.Constants.FM_NO_FILE_OR_DIRECTORY_SELECTED = '<?=__('No file or folder selected')?>';
  47. App.Constants.FM_FILE_TYPE_NOT_SUPPORTED = '<?=__('File type not supported')?>';
  48. App.Constants.FM_DIRECTORY_DOWNLOAD_NOT_READY = '<?=__('Directory download not available in current version')?>';
  49. App.Constants.FM_DIRECTORY_NOT_AVAILABLE = '<?=__('Directory not available')?>';
  50. App.Constants.FM_DONE = '<?=__('Done')?>';
  51. App.Constants.FM_CLOSE = '<?=__('Close')?>';
  52. App.Constants.FM_COPY = '<?=__('Copy') ?>';
  53. App.Constants.FM_CANCEL = '<?=__('Cancel')?>';
  54. App.Constants.FM_RENAME = '<?=__('Rename')?>';
  55. App.Constants.FM_DELETE = '<?=__('Delete')?>';
  56. App.Constants.FM_CONFIRM_DELETE_BULK = '<?=__('Delete items')?>';
  57. App.Constants.FM_EXTRACT = '<?=__('Extract')?>';
  58. App.Constants.FM_CREATE = '<?=__('Create')?>';
  59. App.Constants.FM_PACK = '<?=__('Compress')?>';
  60. App.Constants.FM_PACK_BUTTON = '<?=__('Compress')?>';
  61. App.Constants.FM_OK = '<?=__('OK')?>';
  62. App.Constants.FM_YOU_ARE_COPYING = '<?=__('YOU ARE COPYING')?>';
  63. App.Constants.FM_YOU_ARE_REMOVING = '<?=__('YOU ARE REMOVING')?>';
  64. App.Constants.FM_COPY_BULK = '<?=__('Copy files')?>';
  65. App.Constants.FM_CONFIRM_COPY = '<?=__('Are you sure you want to copy')?>';
  66. App.Constants.FM_CONFIRM_DELETE = '<?=__('Are you sure you want to delete')?>';
  67. App.Constants.FM_INTO_KEYWORD = '<?=__('into')?>';
  68. App.Constants.FM_EXISTING_FILES_WILL_BE_REPLACED= '<?=__('existing files will be replaced')?>';
  69. App.Constants.FM_ORIGINAL_NAME = '<?=__('Original name')?>';
  70. App.Constants.FM_FILE = '<?=__('File')?>';
  71. App.Constants.FM_ALREADY_EXISTS = '<?=__('already exists')?>';
  72. App.Constants.FM_CREATE_FILE = '<?=__('Create file')?>';
  73. App.Constants.FM_CREATE_DIRECTORY = '<?=__('Create directory')?>';
  74. App.Constants.FM_TRANSLATED_DATES = {'Jan': '<?=__('Jan')?>', 'Feb': '<?=__('Feb')?>','Mar': '<?=__('Mar')?>','Apr': '<?=__('Apr')?>','May': '<?=__('May')?>','Jun': '<?=__('Jun')?>','Jul': '<?=__('Jul')?>','Aug': '<?=__('Aug')?>','Sep': '<?=__('Sep')?>','Oct': '<?=__('Oct')?>','Nov': '<?=__('Nov')?>','Dec': '<?=__('Dec')?>'};