WordPress.org

Ready to get started?Download WordPress

Forums

Transposh WordPress Translation
[resolved] [Plugin: Transposh - translation filter for wordpress] How to change images based on selected langua (5 posts)

  1. jackie.taferner
    Member
    Posted 3 years ago #

    I see on the plugin's FAQ page that I can change images based on language.

    But what "descriptor" is this referring to? Can please elaborate on how to go about this?

    Thanks!

    you can use the $my_transposh_plugin->target_language as part of the image descriptor, this will load different images based on the current language.

    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

  2. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    Hello There,

    Assuming you have a file named image.jpg
    If you use the suggested variable above after it like:
    image<?php echo $my_transposh_plugin->target_language?>.jpg
    you will be able to use other images for other languages, such as imagees.jpg, imagehe.jpg, imagede.jpg etc.

    Good luck,

  3. jackie.taferner
    Member
    Posted 3 years ago #

    Thanks for the quick response!

    I tried but WordPress is not allowing php to work inside page content.

    So instead of calling the language code, this is what shows in the source:

    <img src="../../wp-content/uploads/image<?php echo $my_transposh_plugin->target_language ?>.jpg” border=”0″ alt=”” align=”left” /><br />
  4. jackie.taferner
    Member
    Posted 3 years ago #

    Ok, correction... I installed PHP Execution plugin so php would work in posts now.

    Looks like the language code letters are passed through, but in an odd location (ie not where the code is placed, but in the filepath).

    so instead of getting this:
    ../../wp-content/uploads/imagees.jpg

    I get this:
    ../../es/wp-content/uploads/image.jpg

    It's workable though, I can put a new directory and upload my images there.

    Thank you for your help!!

  5. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    Hello,

    My solution actually referred to images in themes, but I am happy that you were able to found a proper solution, I will try to find a better solution for future versions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic