• Resolved NtwJzcWtaea

    (@xiaolllll)


    hello:

    I have one plugin containing some js translation files, in the js file using translating function like __(“aaa”,”some-domain”). In the template file, loco has extracted the text “aaa”, and I have translated aaa to destination language, and complied into mo file, but when browsing the page, it’s still the original translated text, so how to translate js file correctly?

    thans a lot!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tim W

    (@timwhitlock)

    JavaScript translations may not be taken from MO files. They may be loaded from JSON files. See this info page: https://localise.biz/wordpress/plugin/manual/json

    Plugin Author Tim W

    (@timwhitlock)

    loco has extracted the text “aaa”

    To be clear, are you extracting JavsScript strings from the js source code yourself, or are you translating from existing template files? Are you the developer of the plugin? I need more context to be able to help.

    Thread Starter NtwJzcWtaea

    (@xiaolllll)

    Yes it’s exactly the json file, and I found the plugin translation cached in DB, thx a lot!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how does the translation funciton work in js file’ is closed to new replies.