## Aurigma Image Uploader Flash 1.0

# Localization

- Collapse All Sections
- See Also
- Language Filter ( all languages )

To make Image Uploader Flash usage easier for non-English users, we provide a possibility to change all text that can ever be displayed by the control. Each text label, button caption, or error message can be changed using the appropriate class property.

There are two ways to add the translation of the control:

1. Simply specify each property when initializing an imageUploaderFlash objects.
2. Use aurigma.imageuploaderflash.X_localization.js files from Image Uploader Flash embedding scripts library or create your own localization scripts.

## Translating Interface Manually

In the first case, necessary text properties with translation are added just like any other imageUploaderFlash property. The table below lists properties which are necessary for localization of Image Uploader Flash.

Name | Type | Description
--- | --- | ---
commonDialog | commonDialog | Contains captions for common dialog buttons.
imagePreviewWindow | imagePreviewWindow | Contains a property specifying the tooltip which is displayed when the Image Preview window is shown and the mouse pointer hovers over the Status Panel.
listView | listView | Contains button captions and tooltips displayed on the List View.
messages | messages | Contains error messages shown by Image Uploader Flash when a user tries to add files which exceed specified imageUploaderFlash.restrictions.
statusPanel | statusPanel | Contains button captions and text labels displayed on the Status Panel.
topPanel | topPanel | Contains text labels and links displayed on the Top Panel.
uploadErrorDialog | uploadErrorDialog | Contains button captions and text labels displayed on the Upload Error dialog.

Code samples below demonstrate how it can be done in JavaScript, ASP.NET, and PHP respectively.

### JavaScript

    var fu = $au.imageUploaderFlash({id: 'Uploader1'});

    fu.messages({
        tooFewFilesError: 'Minimum file count to start upload is {0}.',
        tooManyFilesError: 'Not all files were added. Maximum file count is {0}.'
    });

    fu.topPanel({
        addFilesLink: 'Add more files',
        viewComboBoxLabel: 'Change view:'
    });

    fu.listView({
        addFilesButton: '+ Add more files',
        rotateIconToolTip: 'Rotate'
    });

    fu.statusPanel({
        dataUploadedLabel: 'Data uploaded: {0} / {1}'
        sendButton: 'Send'
    });

### ASP.NET

    <aur:ImageUploaderFlash ID="Uploader1" runat="server">
        <Messages TooFewFilesError="Minimum file count to start upload is {0}."
                  TooManyFilesError="Not all files were added. Maximum file count is {0}." />
        <TopPanel AddFilesLink="Add more files"
                  ViewComboBoxLabel="Change view:" />
        <ListView AddFilesButton="+ Add more files"
                  RotateIconToolTip="Rotate" />
        <StatusPanel DataUploadedLabel="Data uploaded: {0} / {1}"
                     SendButton="Send" />
    </aur:ImageUploaderFlash>

### PHP

    $uploader = new ImageUploaderFlash();

    $uploader->getMessages()->setTooFewFilesError("Minimum file count to start upload is {0}.");
    $uploader->getMessages()->setTooManyFilesError("Not all files were added. Maximum file count is {0}.");

    $uploader->getTopPanel()->setAddFilesLink("Add more files");
    $uploader->getTopPanel()->setViewComboBoxLabel("Change view:");

    $uploader->getListView()->setAddFilesButton("+ Add more files");
    $uploader->getListView()->setRotateIconToolTip("Rotate");

    $uploader->getStatusPanel()->setDataUploadedLabel("Data uploaded: {0} / {1}");
    $uploader->getStatusPanel()->setSendButton("Send");

When translating the values of the properties, you may notice that some of them contain numbers in braces like {0}, {1}, and so on. These are placeholders that will be replaced at runtime with the appropriate values depending on the displayed text.

For example, you restrict a maximum allowed file size to 3 MB (set the restrictions.maxFileSize property to 3145728), and a user wants to upload a 5 MB file named My File.jpg. In this case, the messages.fileTooLargeError property will be used in a warning message. By default, it has the value:

Size of '{0}' is too large to be added. Maximum allowed size is {1}.

And when a user sees this text, it will already contain corresponding values:

Size of 'My File.jpg' is too large to be added. Maximum allowed size is 3.00Mb.

See reference on the appropriate properties to learn more about the meaning of particular placeholders.

## Using Predefined Localizations

The second case means that you use aurigma.imageuploaderflash.X_localization.js (where X is a language code) files which come with Image Uploader Flash. These files are located in the /ClientScripts folder and contain all the text properties translated to the corresponded language. Thus, to translate Image Uploader Flash interface, do the following:

1. Copy the localization file you need (say, aurigma.imageuploaderflash.en_localization.js) to your application scripts folder (along with aurigma.imageuploaderflash.js file).

2. Link the aurigma.imageuploaderflash.en_localization.js file with the page which hosts Image Uploader Flash.

   ### JavaScript

       <script type="text/javascript" src="../ClientScripts/aurigma.imageuploaderflash.js">  </script>
       <script type="text/javascript" src="../ClientScripts/aurigma.imageuploaderflash.en_localization.js">  </script>

3. Initialize an imageUploaderFlash class instance:

   ### JavaScript

       var fu = $au.imageUploaderFlash({
           id: 'Uploader1',
           flashControl: {codeBase: '../ClientScripts/aurigma.imageuploaderflash.swf'}
       });

4. Pass the en_localization object defined in the aurigma.imageuploaderflash.en_localization.js file to the imageUploaderFlash.set(Object) method:

   ### JavaScript

       fu.set(en_localization);

   Note

   The set(Object) method can be called at runtime, so you can use it to create a language switcher.

You can use the aurigma.imageuploaderflash.en_localization.js file as template to create your own localization script.

### Selecting Predefined Localization in ASP.NET Control and PHP Library

If you use Image Uploader Flash ASP.NET control or PHP library, then the way to select one of the predefined localizations becomes easier. All you need is to specify Image Uploader Flash localization via the Aurigma.Uploader.ImageUploaderFlash.Language or ImageUploaderFlash.Language property, respectively. See code snippets below:

### ASP.NET

    <aur:ImageUploaderFlash ID="Uploader1" runat="server"
                Height="480px" Width="650px"
                Language="English">
    </aur:ImageUploaderFlash>

### PHP

    $uploader = new ImageUploaderFlash();

    $uploader->setLanguage("en");

## See Also

### Reference

- commonDialog Class
- imagePreviewWindow Class
- listView Class
- messages Class
- statusPanel Class
- topPanel Class
- uploadErrorDialog Class

### Manual

- Image Uploader Flash User Interface

- ImageUploaderFlash (ASP.NET)
- ImageUploaderFlash (PHP)
- imageUploaderFlash (Java Script)

- ImageUploaderFlash (ASP.NET)
- ImageUploaderFlash (PHP)
- imageUploaderFlash (Java Script)

- CommonDialog (ASP.NET)
- CommonDialog (PHP)
- commonDialog (Java Script)

- CommonDialog (ASP.NET)
- CommonDialog (PHP)
- commonDialog (Java Script)

- ImagePreviewWindow (ASP.NET)
- ImagePreviewWindow (PHP)
- imagePreviewWindow (Java Script)

- ImagePreviewWindow (ASP.NET)
- ImagePreviewWindow (PHP)
- imagePreviewWindow (Java Script)

- ListView (ASP.NET)
- ListView (PHP)
- listView (Java Script)

- ListView (ASP.NET)
- ListView (PHP)
- listView (Java Script)

- Messages (ASP.NET)
- Messages (PHP)
- messages (Java Script)

- Messages (ASP.NET)
- Messages (PHP)
- messages (Java Script)

- Restrictions (ASP.NET)
- Restrictions (PHP)
- restrictions (Java Script)

- StatusPanel (ASP.NET)
- StatusPanel (PHP)
- statusPanel (Java Script)

- StatusPanel (ASP.NET)
- StatusPanel (PHP)
- statusPanel (Java Script)

- TopPanel (ASP.NET)
- TopPanel (PHP)
- topPanel (Java Script)

- TopPanel (ASP.NET)
- TopPanel (PHP)
- topPanel (Java Script)

- UploadErrorDialog (ASP.NET)
- UploadErrorDialog (PHP)
- uploadErrorDialog (Java Script)

- UploadErrorDialog (ASP.NET)
- UploadErrorDialog (PHP)
- uploadErrorDialog (Java Script)

- MaxFileSize (ASP.NET)
- MaxFileSize (PHP)
- maxFileSize (Java Script)

- FileTooLargeError (ASP.NET)
- FileTooLargeError (PHP)
- fileTooLargeError (Java Script)

- ImageUploaderFlash (ASP.NET)
- ImageUploaderFlash (PHP)
- imageUploaderFlash (Java Script)

- CommonDialog (ASP.NET)
- CommonDialog (PHP)
- commonDialog (Java Script)

- ImagePreviewWindow (ASP.NET)
- ImagePreviewWindow (PHP)
- imagePreviewWindow (Java Script)

- ListView (ASP.NET)
- ListView (PHP)
- listView (Java Script)

- Messages (ASP.NET)
- Messages (PHP)
- messages (Java Script)

- StatusPanel (ASP.NET)
- StatusPanel (PHP)
- statusPanel (Java Script)

- TopPanel (ASP.NET)
- TopPanel (PHP)
- topPanel (Java Script)

- UploadErrorDialog (ASP.NET)
- UploadErrorDialog (PHP)
- uploadErrorDialog (Java Script)