Skip to content

Translations of .js files are not loaded #1243

Open

Description

@DAnn2012

Describe the bug
Translations of .js files are not loading because are missing the "wp_set_script_translations" functions after the "wp_enqueue_script" functions.

To Reproduce
Steps to reproduce the behavior:

  1. Activate the "Loco Translate" plugin
  2. Upload a language .po file from "translate.wordpress.org"
  3. Translate strings related to .js files
  4. See error

Screenshots
N/A

Expected behavior
If after the "wp_enqueue_script" functions, such as:
https://github.com/wpeverest/user-registration/blob/8346d4b4a59708207ff94a5944bc96901c69ad82/includes/admin/class-ur-admin-dashboard.php#L26-L32

You enter the "wp_set_script_translations" function, such as:

wp_set_script_translations( 'ur-dashboard-script', 'user-registration' );

translations are displayed.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only User Registration plugin is active.
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions