douyingbei1458 2015-11-09 10:55
浏览 30

翻译上传按钮标题

Hy all. I have a question: I added a file-upload plugin to my site (this one:http://danholloran.me/WPMultiFileUploader/) and it works great. I want to translate the upload button's text, (I'm using for translation Polylang) and for that I need to add the following code to make the plugin translate the string from the .mo file:

<?php echo __('Upload File(s)'); ?>

to the plugins minified .js file

text:{uploadButton:"Upload File(s)"}

I searched on the net and found out that in a .js file the php script wont run, so how can i replace the text from the .js file with my php code to make it work?

The .js file: http://we.tl/HDT0yiVSq1

(its a minified file unfortunately, but the text we search for is on the end of the file)

  • 写回答

1条回答 默认 最新

  • duanbaque4230 2015-11-09 10:58
    关注

    You can use $.get().

    So:

    $.get("phpfile.php", function(data){
        // initialize your upload and then use instead of "Upload File(s)" the variable data.
        // so uploadButton: data
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 我的数据无法存进链表里
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端