WordPress.org

Forums

[resolved] i18n & variables manipulation (5 posts)

  1. Le-Pixel-Solitaire
    Member
    Posted 4 years ago #

    Hi all =)

    I'm working on the i18n of my youtube shortcode plugin and I face a specific issue: I have put the generated player inside a variable and if the user forgot to enter the ID of the video then this variable contains an error message. This part looks like this:

    if (empty($id)) {
       $generated_output = '<span class="error-pxsol_youtube">You must set the ID of the YouTube video.</span>';
    };

    The question: how do I included the "_e('Some texts here', 'domain');" kind of code into this output message (I tried 3 ways of coding it but the PHP part seems to be treated as text)?

  2. Le-Pixel-Solitaire
    Member
    Posted 4 years ago #

    ...is this a "WP-Advanced" question???

  3. esmi
    Forum Moderator
    Posted 4 years ago #

    if (empty($id)) {
       $generated_output = '<span class="error-pxsol_youtube">' . __('You must set the ID of the YouTube video.', 'textdomain') . '</span>';
    };
  4. Mark / t31os

    Posted 4 years ago #

  5. Le-Pixel-Solitaire
    Member
    Posted 4 years ago #

    Wow, thanx: U rock ^_^ I'll mention you both somewhere in the next release notes!

    Smile & have a nice day!

Topic Closed

This topic has been closed to new replies.

About this Topic