Localization of web viewer interface


For the convenience of users to localize web viewer skin the localization mechanism is introduced.

The localization can be done with the help of Localize method. The function that has two parameters (localization key and the default value) is passed to Localize method.

 
  1. ReportViewerConstructor.Localize(function (key, defaultValue) {
  2.     // Return localized string for the specified key,
  3.     // otherwise, if you are not able to get it, you may return defaultValue
  4. });
 

 

Below you can see a possible localization implementation. The sample contains English localization strings where the name of the property matches the name of the string key.

 
  1. ReportViewerConstructor.Localize(function (key, value) {

  2.         localizedValue = localization [key];

  3.         if (localizedValue != undefined) {

  4.             return localizedValue;

  5.         }

  6.         return value;

  7.     });

  8.  

  9. var localization =

  10. {

  11.          thumbnails: "Thumbnails" ,

  12.          documentMap : "Document Map",

  13.          of : "of",

  14.          pageRange : "Page range",

  15.          all : "All",

  16.          pages : "Pages",

  17.          pageNumberClarification : "Enter page number and/or pages ranges separated by commas. For example: 1, 3, 5-10",

  18.          imageSettings : "Image settings",

  19.          keepOriginalImageSettings : "Keep original image resolution and quality",

  20.          customResolution : "Custom resolution",

  21.          imageQuality : "Image quality",

  22.          securitySettings : "Security settings",

  23.          encryptionLevel : "Encryption level",

  24.          none : "None",

  25.          low : "Low (40-bit RC4)",

  26.          high : "High (128-bit RC4)",

  27.          requiredPasswordToOpenDocument : "Required a password to open document",

  28.          documentOpenPassword : "Document open password",

  29.          generateChangePassword : "Generate change permissions password automatically",

  30.          changePermi : "Change permissions password",

  31.          allowPrinting : "Allow printing",

  32.          allowCommenting : "Allow commenting",

  33.          allowChanging : "Allow changing the document",

  34.          allowCopying : "Allow copying content",

  35.          compress : "Compress",

  36.          imageReusing : "Image reusing (hash comparing used)",

  37.          imageSettings : "Image settings",

  38.          customResolution : "Custom resolution",

  39.          imageQuality : "Image quality",

  40.          sheetSettings : "Sheet settings",

  41.          splitByPage : "Split sheets by pages",

  42.          splitByGroups : "Split sheets by groups",

  43.          exportToOneSheet : "Export to one sheet",

  44.          pageRender : "Page render",

  45.          exportWithoutPageDelimeters : "Export without page delimeters",

  46.          all : "All",

  47.          pages : "Pages",

  48.          textWasNotFound : "Text was not found.",

  49.          print : "Print",

  50.          exportToRtf : "Export to Rtf",

  51.          exportToPdf : "Export to Pdf",

  52.          exportToExcel : "Export to Excel",

  53.          exportToHtml : "Export to Html",

  54.          exportToXps : "Export to Xps",            

  55.          zoomIn : "Zoom in",

  56.          zoomOut : "Zoom out",

  57.          find : "Find",

  58.          findPrevious : "Find Previous",

  59.          findNext : "Find Next",

  60.          errorInformation : "Error information",

  61.          pdfExportOptions : "PDF export options",

  62.          mustBeIntegerValue : "Must be an integer value between 0 and 100",

  63.          xlsxExportOptions : "XLSX export options",

  64.          textSearchCompleted: "Text search completed",

  65.          close : "Close",

  66.          currentPage : "Current page",

  67.          ok: "OK",

  68.          cancel: "Cancel"

  69. };
 

Add Feedback