Help with using WPML to translate Email form etc.

resolved (3 posts) (2 voices)

  1. enote
    Member

    Hey guys,

    How do I go about translating the following to make my site fully multilingual:

    1) "Search" text when you hover on the search icon
    2) "Email Us", "Name*" "Email*" Submit button on the contact form, and probably the validation messages?

    If there is other stuff I'm missing out that cannot be translated through the WPML interface, please include them as well.

    Thanks in advance,
    Enote

    Posted 7 years ago #
  2. enote
    Member

    Alright I don't know if there is a more efficient/elegant way to do this or not, but this seems to work:

    For example:

    <?php if(ICL_LANGUAGE_CODE == 'en'){?><label class="textfield_label" for="contactNameWidget">Name *</label><?php }?>
    <?php if(ICL_LANGUAGE_CODE == 'xx'){?><label class="textfield_label" for="contactNameWidget">xxxx *</label><?php }?>
    would put "Name*" next to the textfield and another if statement for some other language would put the corresponding translation for that field.

    or

    echo $args['before_widget'];
    if(ICL_LANGUAGE_CODE == 'en'){
    echo $args['before_title'] .'Email Us'. $args['after_title'];
    }
    if(ICL_LANGUAGE_CODE == 'xx'){
    echo $args['before_title'] .'XXXX xxx'. $args['after_title'];
    }

    Would put the title Email Us for the contact form widget.

    Peace,
    Enote

    P.S. Is there an easier way to do this? (for validation etc)

    Posted 7 years ago #
  3. Webtreats
    Support

    Hi enote,
    Glad to hear you resolved this.

    The method you used was what I also was going to suggest. To my knowledge there currently isn't an easier way to do this.

    Posted 7 years ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme