I want use my flag.json or error.json in my plugin


  • GNU/Linux

    I want to use my flag.json or my error.json in my plugin and not the files that are in public/language/en-GB/flags.json. My plugin's structure folder is this:

    languages
    ----->flag.json
    ----->error.json

    I want read my text in these files, How can I do that?

    Example

    <div class="col-md-4 col-xs-12 ">
     <button class="btn btn-default flag-reason" disabled="true" name="bottone_flag">[[flags:modal-reason-offensive]]</button>
    </div>
    

    In this way I read the default value but I want to customize with my file so something like this:

    [[languages flags:modal-reason-offensive]]
    
    

    But this it doesn't work. Anyone can help me?


  • Admin

    You will need to do two things:

    • Your languages/ folder must follow the same directory structure as the default files you want to overwrite. For example, if you want to overwrite public/language/en-GB/flags.json, your plugin will need the file path/to/my/plugin/languages/en-GB/flags.json
    • You need to define a path to the languages/ folder in plugin.json

  • Global Moderator

    And you need to run ./nodebb build after making changes.


 

| |