Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter kiminotsuki

    (@kiminotsuki)

    Hi Jepsiba,

    That’s strange… my images are also inside php code and it works fine. Unless I’m misunderstanding what you mean by inside the php code…

    For the global script you just have to add this…

    <?php global $my_transposh_plugin?>

    Somewhere in the php file. I don’t know if it matters where, but before the images probably. I’m a total amateur so a lot of trial and error was involved in getting my site to work. But maybe after you add the global script it might work?

    Thread Starter kiminotsuki

    (@kiminotsuki)

    Hi @jepsiba,

    For the images that are in your theme and embedded in the php code, all you have to do is add this code between the file name and extension, such as…

    nothumb<?php echo $my_transposh_plugin->target_language?>.jpg

    Just put it right in the php code and it should work as long as you have also included the global script in the same php file. Then just upload the translated image in the same location with the language code in the file name. For example if your image was translated into Japanese you should name the file nothumbja.jpg, as “ja” is the language code for Japanese.

    About the images in the css file, I think that I tried this the same way as in the php code but it didn’t work for me, so maybe someone else knows the solution.

    Thread Starter kiminotsuki

    (@kiminotsuki)

    Ofer Wald,

    Hello, thank you very much for your help! This was the problem.
    After I added the global script to all my php files the original code worked perfectly.

    Though I also had to reupload my original files with “ja” at the end of the file names. Since my site’s default language is Japanese I added the English translated files with “en” at the end, but I also needed to add “ja” for the Japanese files to load properly. Maybe this is because the original plugin assumes that English is the base language?

    Anyway, it was easily fixed and now everything is working properly for both languages. Thank you very much!

    Thread Starter kiminotsuki

    (@kiminotsuki)

    Hi Paz2222,

    I’m glad that it’s working for you now ??

    I’ve tried the php code in the theme’s php files the same way as with the shortcode, but it doesn’t seem to work. So, I guess I’ll have to wait for someone else to respond. Thanks!

    Thread Starter kiminotsuki

    (@kiminotsuki)

    To Paz2222,

    Hi, I still haven’t been able to figure out how fix the problem with images in my theme, but I’ve successfully changed the images in my pages. So, I thought it might work for you too.

    What I did was reupload the images so that they are in the same directory (since wordpress seems to make a new directory for uploaded media each month, if you are uploading with FTP or something just make sure they are in the same folder I think) and then used the shortcode…

    [tp mylang=”y” lang=”en”]

    before the extension of the file in the img src tag. Such as…

    image[tp mylang=”y” lang=”en”].jpg

    With the two files “image.jpg” being the original and “imageen.jpg” being the English translated image. Of course change the “en” to whichever language you are translating into.

    This worked for me in pages (I haven’t tried in posts because I don’t have images in need of translating there), but it doesn’t work inside the theme, so I am still stuck there if there is anyone out there who can help.

Viewing 5 replies - 1 through 5 (of 5 total)