Search in support tickets

#672 – How to translate "add files"

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 25 November 2019 15:26 CET
pat01
Hi

I use a field of type "file" for uploading PDF files.

There is a button called "add files". How can I translate it?

I can't find it in language overrides (I did try to create a new one and searched for "add files" - but got no results).

How can I translate it?

Thanks.
Custom Fields
Joomla Version
3.9.13
PHP Version
7.2
Product
AdsManager
Product Version
latest
Monday, 25 November 2019 16:19 CET
loic
Hello,

The upload field label are set by the browser, it will by displayed in the language set as default for the browser.

Just to be sure, could you try to change the default language of your browser and refresh the page ?

In my test site, I see 'Choose file' with 'No file chosen' in the input box.

Best regards.
 
Tuesday, 26 November 2019 08:45 CET
pat01
Hello

I use German as browser language (both: menus and websites). I did switch to English, but it still says "Add files". Then I changed back to German and still I see "Add files" and below "Max. number of files" (please see screenshot).

Thanks.

Best regads
Patrick
Attachment
Tuesday, 26 November 2019 13:18 CET
loic
Hello,

For Max. number of files, the constant is ADSMANAGER_MAX_NUMBER_OF_FILES

You can override the translation in the backend, extensions -> languages -> override


for the Add files, it is a little more complicated.
Open the file corresponding your language in this folder -> components/com_adsmanager/js/plupload/{yourlanguage}.js

Here add a line for Add files like this :
'Add files' :  'Add files translation',


Add that translation like the ones already in the file, do not insert that line before the
// .po file like language pack
plupload.addI18n({

or after the
});

Best regards.

 
Wednesday, 27 November 2019 08:15 CET
pat01
Hello

Thanks for your information.

Wouldn't it be better if you make "Add files" translatable by Joomla core override system?

Because if I make changes in .js file as you said, it will get overridden on next update. Because of that, I don't like to do core hacking.

Besides this, at the location you said there is no de.js (German is the language I want to use). Please see screenshot.

What do you think?

Thanks.

Best regards

Attachment
Wednesday, 27 November 2019 12:51 CET
loic
Hello,

I totally agree with you and will work on that this week.

If it takes too much time, I will try to find an alternative solution.

Best regards.
 
Wednesday, 27 November 2019 16:03 CET
pat01
Hello

This is great, thanks a lot.

Best regards
Monday, 02 December 2019 12:39 CET
loic
Hello,

Ok so it is not as easy as I thought.

For the moment, you can create the de.js file and see if it works.

If yes, then, since the file doesn't exist, it will not be erased when you update the component.
(You can also send the file to us and we will incorporate it in the component)

Best regards.
 
Tuesday, 03 December 2019 11:45 CET
pat01
Hello

I found de.js file. It is located here:
components/com_adsmanager/js/plupload/i18n

I have added "Add files" and done one correction:
"Add images" was translated as "Dateien" (= "files") which is wrong. Correct is: Bilder hinzufügen

Attached I'm sending the file to you.

"Max number of files" can be translated using core language override for this language key: ADSMANAGER_MAX_NUMBER_OF_FILES

Thanks.

Best regards
Patrick
Tuesday, 03 December 2019 11:47 CET
pat01
Hello again

ZIP files are not allowed to upload here. So I try with TXT.

Best regards

Edit: No luck either, I get error message.

So I post content here:

// German

plupload.addI18n({

    'Add files' : 'Datei(en) hinzufügen',
	'Select files' : 'Dateien hochladen',

    'Add files to the upload queue and click the start button.' : 'Dateien hinzufügen und auf \'Hochladen\' klicken.',

    'Filename' : 'Dateiname',

    'Status' : 'Status',

    'Size' : 'Größe',

    'Add images' : 'Bilder hinzufügen', // 'Dateien', // hinzufügen',

    'Stop current upload' : 'Aktuelles Hochladen stoppen',

    'Start uploading queue' : 'Hochladen starten',

    'Uploaded %d/%d files': '%d/%d Dateien sind hochgeladen',

    'N/A' : 'Nicht verfügbar',

    'Drag files here.' : 'Ziehen Sie die Dateien hier hin',

    'File extension error.': 'Fehler bei Dateiendung',

    'File size error.': 'Fehler bei Dateigröße',

    'Init error.': 'Initialisierungsfehler',

    'HTTP Error.': 'HTTP-Fehler',

    'Security error.': 'Sicherheitsfehler',

    'Generic error.': 'Typischer Fehler',

    'IO error.': 'Ein/Ausgabe-Fehler',

    'Stop Upload': 'Hochladen stoppen',

    'Start upload': 'Hochladen',

    '%d files queued': '%d Dateien in der Warteschlange'

});

Tuesday, 03 December 2019 13:48 CET
loic
Hello,

thanks !

I will add that in the package.

Best regards.
 
Thursday, 05 December 2019 14:55 CET
loic
Hello,

I modified the german translations to match the one you gave me.
It will be available in the next version.

Best regards.
 
Thursday, 05 December 2019 15:07 CET
pat01
Hello

Great, thanks a lot!

Best regards
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.