• Hi,
    Your plugin is very successful and useful. Thank you.
    There is a question I want to ask. I am using a plugin. I translate this into another language with Loco Translate. However, this does not appear even if I translate some words. Because the source text is incorrect. For example:
    I get this error “Failed to find source file matching” src / admin / components / Reports.vue “”.
    How can I rearrange the source text? Am I authorized to do this?

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

    (@timwhitlock)

    What is the plugin? Please provide a free download link.

    this does not appear even if I translate some words. Because the source text is incorrect.

    Do you mean the English string in the plugin source code is not exactly the same as the source string in the PO file you translated? Or are you just pointing out that the source file is missing?

    Please be clear how you’ve verified this as the reason for text not appearing.

    Failed to find source file matching “src/admin/components/Reports.vue”

    This file is probably not shipped with the plugin. The author will have extracted strings from this file in a development environment and hopefully shipped a generated srings template instead. The source code does not need to be present in the plugin if they’ve provided a valid template.

    Loco Translate cannot extract strings from .vue files anyway. Also this tells me the translation is probably loaded into JavaScript, which may be relevant. We can get into that once you’ve provided some clarification on the above.

    How can I rearrange the source text? Am I authorized to do this?

    I don’t understand what you’re hoping to do, but the answer is probably that you shouldn’t rearrange anything that was prepared by the plugin author. You should sync source strings to their provided template. If it doesn’t work, there may be a different reason.

    Thread Starter loopforever

    (@loopforever)

    Thank you very much for your answer.
    Plugin, Dokan (Business). I saying that the source file and line number are not correct. Please see the image.

    Images
    For example, I’m translating this word. However, it does not appear on the site. Because this text is no longer available where it is stated in the source. It’s elsewhere.
    What I want to ask is: How do I edit the Source File?
    For example, this word is now here: dokan-pro / modules / export-import / includes / export / abstract-wc-csv-exporter.php.

    • This reply was modified 4 years, 6 months ago by loopforever.
    Plugin Author Tim W

    (@timwhitlock)

    I saying that the source file and line number are not correct. Please see the image.

    OK, thanks for the clarification. This fact is not relevant to translations not showing. The only thing that matters is that the source text “Tools Page” is compiled into the MO file. This is a unique key.

    it does not appear on the site. Because this text is no longer available where it is stated in the source.

    This is not the reason. As I explained, the file is probably not shipped with the plugin and doesn’t need to be. It is some kind of JavaScript source file which is likely compiled into a compressed script which gets shipped with the plugin. I don’t know anything about Vue, so cannot comment further on exactly how this works.

    The critical thing is that your MO file is read by WordPress and the translation of “Tools Page” string is provided to the JavaScript. If the plugin is getting its translations from some other means, such as a JSON translations file, then this would explain why it doesn’t work. Without access to the plugin I cannot say which is the case. You will have to ask the author where the JavaScript code gets its translations from.

    Thread Starter loopforever

    (@loopforever)

    Thank you very much for your valuable answer. I am grateful. There is a situation like you said.
    I installed a plugin called “String Locator”. I searched for “Tools Page” in this plugin. As a result, a js file came out:

    File: wp-content / plugins / dokan-pro / assets / js / vue-pro-admin.js

    Line Number: 1
    Line Position: 89738

    Can I do something about it? Do you have any advice?
    Thank you.
    Best regards.

    Plugin Author Tim W

    (@timwhitlock)

    Exactly. This is the compressed file. You can ignore the fact that the file reference in the PO file differs? This makes no difference to the loading of your translations.

    Can I do something about it? Do you have any advice?

    I have already given my advice in the last paragraph of my previous reply.

    I cannot force your plugin to load JavaScript translations from your MO file. As I said – ask the author where the JavaScript code gets its translations from.

    Thread Starter loopforever

    (@loopforever)

    Thank you very much again.

    I reported the situation to Dokan. If there is a solution, I will add here. Because there are those who have similar problems.

    • This reply was modified 4 years, 6 months ago by loopforever.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Source Text (Re)’ is closed to new replies.