innostudio / fileuploader

Beautiful and powerful HTML file uploading tool. A jQuery, PHP and Node.js plugin that transforms the standard input into a revolutionary and fancy field on your page.
141 stars 25 forks source link

Caption in multiple languages #36

Closed tornako closed 4 years ago

tornako commented 5 years ago

Hi, is possible to have the caption for multilanguages? How I put different languages in the same captions? Ex. Catalan, Spanish and English.

(I write a new post because the other is already closed, and so it is visible.)

Thanks!!

innostudio commented 5 years ago

@tornako there is no way to have in the captions object different languages at the same time.

innostudio commented 4 years ago

The simplest way is following

HTML:

<script type="text/javascript">
    window.appLanguage = 'en';
</script>

Custom.js:

// declare translations
var fileuploaderTranslations = {
    en: {
        button: 'Browse files'
    },
    es: {
        button: 'Examinar...'
    }
};

// init fileuploader
$('input:file').fileuploader({
    captions: fileuploaderTranslations[window.appLanguage]
});
innostudio commented 4 years ago

@tornako the plugin is now translated in 14 languages. Check it here https://innostudio.de/fileuploader/documentation/#options-captions