Page 1 of 1

No translation of buttons Add Files & Start Upload (Backend)

Posted: 03 Jun 2019, 21:24
by madmetz
Hi Jan,

The translation of the the two buttons "Add Files" and "Start Upload" in backend
components -> phoca download -> files -> muliple add -> tab "Multiple Upload" does not work.

Could you please have a look at this problem? I tried but couldn't find it myself. :(

Thanks a lot.

Regards Mike

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 03 Jun 2019, 22:05
by Kostelano
Good day!
Lines are not translated because they are written directly in the JS-file.

SITE/components/com_phocadownload/assets/plupload/jquery.plupload.queue/jquery.plupload.queue.js

Code: Select all

									'<div class="plupload_buttons">' +
										'<a href="#" class="plupload_button plupload_add btn btn-success fileinput-button"><i class="icon-plus icon-white"></i>' + _('Add Files') + '</a>' +
										'<a href="#" class="plupload_button plupload_start  btn btn-primary start"><i class="icon-upload icon-white"></i>' + _('Start Upload') + '</a>' +
									'</div>' +

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 04 Jun 2019, 12:20
by madmetz
Hello Kostelano,

Thanks for your reply.
I have already found that too, but couldn't find a way to replace the text by a translation variable from language.ini file.

There is another file in:
administrator/components/com_phocadownload/libraries/phocadownload/file/fileuploadmultiple.php
BTW ..administrator/.. is the correct location to me for this issue.
There you can find the following (js) code:

Code: Select all

132  $js = 'var pgJQ = jQuery.noConflict();';
133
134  $js .='pgJQ(function() {'."\n";
135
136  $js.=''."\n";
137  $js.='   plupload.addI18n({'."\n";
138  $js.='	   \'Select files\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_SELECT_FILES')).'\','."\n";
139  $js.='	   \'Add files to the upload queue and click the start button.\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_ADD_FILES_TO_UPLOAD_QUEUE_AND_CLICK_START_BUTTON')).'\','."\n";
140  $js.='	   \'Filename\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_FILENAME')).'\','."\n";
141  $js.='	   \'Status\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_STATUS')).'\','."\n";
142  $js.='	   \'Size\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_SIZE')).'\','."\n";
143  $js.='	   \'Add files\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_ADD_FILES')).'\','."\n";
144  $js.='	   \'Start upload\':\''.addslashes(JText::_('COM_PHOCADOWNLOAD_START_UPLOAD')).'\','."\n";
145  $js.='	   \'Stop current upload\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_STOP_CURRENT_UPLOAD')).'\','."\n";
146  $js.='	   \'Start uploading queue\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_START_UPLOADING_QUEUE')).'\','."\n";
147  $js.='	   \'Drag files here.\' : \''.addslashes(JText::_('COM_PHOCADOWNLOAD_DRAG_FILES_HERE')).'\''."\n";
148  $js.='   });';
149  $js.=''."\n";
As you can see in lines 143, 144 the translation should happen there.
Only these two text items don't work. The other ones are translated correctly.
I guess there's something mixed up between site and backend and Jan should have a look at.

Regards Mike

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 04 Jun 2019, 12:57
by Kostelano
Yes indeed.
Translation error due to different constants in files
SITE/components/com_phocadownload/assets/plupload/jquery.plupload.queue/jquery.plupload.queue.js
and
SITE/administrator/components/com_phocadownload/libraries/phocadownload/file/fileuploadmultiple.js

For example, if in file
SITE/components/com_phocadownload/assets/plupload/jquery.plupload.queue/jquery.plupload.queue.js

Code: Select all

class="icon-plus icon-white"></i>' + _('Add Files') + '</a>' +
replaced by (according to the file "....../file/fileuploadmultiple.js" data)

Code: Select all

class="icon-plus icon-white"></i>' + _('Add files') + '</a>' +
Then the language string will be translated. The same applies to "Start Upload" - the problem is in the case of characters.
I will try to find more inconsistencies of phrases.

This should be fixed in the next version ;).

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 04 Jun 2019, 13:27
by Kostelano
I checked other files for constant mismatch.
Found problems only for "Add Files" and "Start Upload". With the rest of the constants all is well.
Need to fix in files:

Add Files ---- > Add files
SITE/components/com_phocadownload/assets/plupload/jquery.plupload.queue/jquery.plupload.queue.js

Code: Select all

									'<div class="plupload_buttons">' +
										'<a href="#" class="plupload_button plupload_add btn btn-success fileinput-button"><i class="icon-plus icon-white"></i>' + _('Add Files') + '</a>' +

Code: Select all

					if (uploader.total.queued === 0) {
						$('span.plupload_add_text', target).html(_('Add Files'));
					} else {
SITE/components/com_phocadownload/assets/plupload/jquery.plupload.queue.min.js

Code: Select all

l.queued===0){c("span.plupload_add_text",i).text(a("Add files."))}else{c("span.plupload_add_text",i).text(j.total.queued+" files queued.")}c("a.plupload_start",i).toggleClass("plupload_disabled",j.files.length===0);m[0].scrollTop=m[0].scrollHeight;f();if(!j.files.length&&j.features.dragdrop&&j.se
Add file + dot (I'm not sure)

SITE/components/com_phocadownload/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.js

Code: Select all

class="plupload_cell plupload_file_name"><div class="plupload_buttons"><!-- Visible --><a class="plupload_button plupload_add">'+b("Add Files")+'</a>&nbsp;<a 

Code: Select all

owse_button).html(b("Add Files"))}else{g(".ui-button-text",k.browse_button).html(b("%d files 
Start Upload ---- > Start upload
SITE/components/com_phocadownload/assets/plupload/jquery.plupload.queue/jquery.plupload.queue.js

Code: Select all

										'<a href="#" class="plupload_button plupload_start  btn btn-primary start"><i class="icon-upload icon-white"></i>' + _('Start Upload') + '</a>' +
SITE/components/com_phocadownload/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.js

Code: Select all

class="plupload_button plupload_start">'+b("Start Upload")+'</a>&nbsp;<a class="plupload_button plupload_stop plupload_hidden">'+b("Stop Upload")+'</a>&nbsp;</div><div 

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 04 Jun 2019, 16:35
by Jan
Hi, thank you for the info, I will take a look at it for the next version.

Jan

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 04 Jun 2019, 16:59
by madmetz
@Kostelano

Man, that's embarrassing that I didn't notice that. :oops:
Thanks anyway.

Regards Mike

Re: No translation of buttons Add Files & Start Upload (Backend)

Posted: 17 Apr 2020, 23:00
by Jan