Localizing AJAX File Browser

The IT Hit AJAX File Browser control can be localized to any language. The most simple approach is just to localize all strings stored in ITHitAJAXFileBrowser.js file. The strings are not compressed so you can easily replace them with a translated version.

The more advanced approach is to pass localized strings to constructor in Settings.Phrases object. In this case you do not need to edit the original ITHitAJAXFileBrowser.js file:

 ITHit.oNS.EN = {
 

var phrases = {
 AjaxFileBrowser: {
  
  Interface: {
   
   Buttons: {
    Copy: 'Copy',
    Cut: 'Cut',
    Delete: 'Delete',
    Details: 'Details',
    Folders: 'Folders',
    Info: 'Properties',
    Paste: 'Paste',
    Up: 'Up'
   },
   
   Add: 'Add',
   AddProperty: 'Add Property',
   Address: 'Address:',
   BrowseFiles: 'Browse...',

   ...

  }

 }

};

 

var settings = {
    Id: 'AjaxFileBrowserContainer',     // ID of the parent control 
    Url: 'http://webdavserver.com',     // the root folder to be displayed
    Style: 'height: 100%; width: 100%',
    FileIconsPath: '/icons/',           // file icons path
    MsOfficeTemplatesPath: 'http://webdavserver.com/MSOfficeTemplates/',
    SelectedFolder: '/Pictures',        // folder to be selected
    PluginsPath: '/plugins/',           // path to Java applet that opens documents
    Phrases: phrases                    // localized strings

}; 

 

ajaxFileBrowser = new ITHit.WebDAV.Client.AjaxFileBrowser.Controller(settings);

 

You can find all string IDs in ITHitAJAXFileBrowser.js. If any string is not passed to the constructor the English analog will be used.