Home Forums Plugin Support WP User Frontend Pro Wp Userfrontend Pro: Translation of javascript strings

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Nayem 4 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31823

    Torben
    Member
    Post count: 4

    Hi, there are some strings nested in js files, which are not translatable. For example in upload.js there are included error alerts for wrong file type, file size, etc. beginning in line 108:

    msg = 'The file you have uploaded exceeds the file size limit. Please try again.';
    msg = 'You have uploaded an incorrect file type. Please try again.';
    ...

    Could you please create a dynamic js file for these strings, i.e. ‘lang.php':

    var errors = {
      file_size: "<?php _e('The file you have uploaded exceeds the file size limit. Please try again.', 'wpuf'); ?>",
      file_type: "<?php _e('You have uploaded an incorrect file type. Please try again.', 'wpuf'); ?>"
    };

    Then you could alert the variables:
    msg = errors.file_size;
    msg = errors.file_type;

    #31842

    Nayem
    Moderator
    Post count: 6480

    Hello Torben,

    Thank you for your suggestion. I have reported this to our developer team. Hope they will fix this in our next update.

    Thank you ๐Ÿ™‚

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Wp Userfrontend Pro: Translation of javascript strings’ is closed to new replies.