• Resolved huntersbest

    (@huntersbest)


    Hi,

    I encountered a strange phenomenon with translating YITH Wishlist.

    The strings are translated and show up correctly in the *.po file but are empty or unchanged (in case of changes to the translation) in the corresponding json file.

    In the settings I checked “delete redundant files”. Anyone who could point me into the right direction?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter huntersbest

    (@huntersbest)

    I correct: it does compile. BUT Loco compiles directly into the folder where the po/mo files are and YITH Wishlist has a seperate folder within this languagefolder for all json files. Is there a filter to set the path of where the json files will be saved?

    Plugin Author Tim W

    (@timwhitlock)

    The short answer is no.

    During the compilation process Loco Translate has no idea where the author wants to load their own JSON files from. Plugins can declare a Domain Path, but there is no mechanism that I know if to specify a subfolder for JSON files.

    However, loading JSONs from non-author locations may not require the file structure be the same. (I need to test this). Are you compiling your files to that same location? Where are the files located when you install the official language pack in your language?

    Thread Starter huntersbest

    (@huntersbest)

    Yes I compile the files to the YITH Wishlist folder. Still even with your “no” you gave me 2 ways to find a solution.

    a) I can have a go at YITH Wishlist and maybe re-declare the path where they get their json files from.
    b) I test to save the translations in the WP language folder and try to retrieve them from there (but I think the official language pack might overrule this – it might be worth a try)

    Thank you very much for the suggestions. I will post here as soon as I know more.

    Plugin Author Tim W

    (@timwhitlock)

    It’s not recommended to ever save files into the author location.

    If there exists an official language pack in your language then it’s not recommended to save them there either!

    So, in this case you should use Loco Translate’s custom folder if you can. (i.e. if it’s allowed to work). Here the structure will mirror the official WordPress paths, and I suspect that won’t have a subfolder *

    Plugin Author Tim W

    (@timwhitlock)

    * I just installed the language pack for Spanish, and WordPress placed all files together in the same directory.

    Thread Starter huntersbest

    (@huntersbest)

    The German Pack for Yith kame with the separated files (subfolder for json). I even found the path

    wp_set_script_translations( ‘yith-wcwl-add-to-wishlist’, ‘yith-woocommerce-wishlist’, YITH_WCWL_DIR . ‘languages/js’ );

    Plugin Author Tim W

    (@timwhitlock)

    We’ve already established that the author files have a subfolder. I’m referring to the language pack installed by WordPress as per the link I gave earlier.

    The German project is only at 46% so won’t be installed automatically. If it was installed, you would find it places the files all together in the same directory. I tested this with Spanish, which is 100% complete.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.