Shop Categories

X

Translation of the header social icons names

Home Forums Agama Pro Translation of the header social icons names

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10225
    AlphaCE
    Participant

    Hi!

    If I translate the texts like “Email” to “E-post” (in Swedish) the social icons in the doesn’t work as expected. I’ve traced this back to the function Agama::sociali it first translates the name and then checks them against the untranslated names. Also it uses the translated names to fetch the FontAwesome icon and therefore fails to fetch the correct ones.

    Couldn’t the translation occur when the function generates the actual HTML on the lines 286 and 315 of the class-agama.php-file?

    Best regards /Johan

    #10226
    AlphaCE
    Participant

    I’ve temporarily patched the function like this – and it seams to work for me:

    `
    static function sociali( $tip_position = false, $style = false ) {
    $_target = esc_attr( get_theme_mod( ‘agama_social_url_target’, ‘_blank’ ) ); // URL target
    $social = array(
    ‘Phone’ => esc_html( get_theme_mod(‘social_phone’, ” ) ),
    ‘Facebook’ => esc_url( get_theme_mod(‘social_facebook’, ”) ),
    ‘Twitter’ => esc_url( get_theme_mod(‘social_twitter’, ”) ),
    ‘Flickr’ => esc_url( get_theme_mod(‘social_flickr’, ”) ),
    ‘Vimeo’ => esc_url( get_theme_mod(‘social_vimeo’, ”) ),
    ‘Youtube’ => esc_url( get_theme_mod(‘social_youtube’, ”) ),
    ‘Instagram’ => esc_url( get_theme_mod(‘social_instagram’, ”) ),
    ‘Pinterest’ => esc_url( get_theme_mod(‘social_pinterest’, ”) ),
    ‘Telegram’ => esc_url( get_theme_mod(‘social_telegram’, ”) ),
    ‘Tumblr’ => esc_url( get_theme_mod(‘social_tumblr’, ”) ),
    ‘Google’ => esc_url( get_theme_mod(‘social_google’, ”) ),
    ‘Dribbble’ => esc_url( get_theme_mod(‘social_dribbble’, ”) ),
    ‘Digg’ => esc_url( get_theme_mod(‘social_digg’, ”) ),
    ‘Linkedin’ => esc_url( get_theme_mod(‘social_linkedin’, ”) ),
    ‘Blogger’ => esc_url( get_theme_mod(‘social_blogger’, ”) ),
    ‘Skype’ => esc_html( get_theme_mod(‘social_skype’, ”) ),
    ‘Myspace’ => esc_url( get_theme_mod(‘social_myspace’, ”) ),
    ‘Deviantart’ => esc_url( get_theme_mod(‘social_deviantart’, ”) ),
    ‘Yahoo’ => esc_url( get_theme_mod(‘social_yahoo’, ”) ),
    ‘Reddit’ => esc_url( get_theme_mod(‘social_reddit’, ”) ),
    ‘PayPal’ => esc_url( get_theme_mod(‘social_paypal’, ”) ),
    ‘Dropbox’ => esc_url( get_theme_mod(‘social_dropbox’, ”) ),
    ‘Soundcloud’ => esc_url( get_theme_mod(‘social_soundcloud’, ”) ),
    ‘VK’ => esc_url( get_theme_mod(‘social_vk’, ”) ),
    ‘Email’ => esc_html( get_theme_mod(‘social_email’, ”) ),
    ‘RSS’ => esc_url( get_theme_mod(‘social_rss’, get_bloginfo(‘rss2_url’)) ),
    );
    if( $style == ‘animated’ ) {
    echo ‘

      ‘;
      foreach( $social as $name => $url ) {
      if( ! empty( $url ) ) {

      if( $name == ‘Phone’ ) {
      $url = ‘tel:’ . $url;
      }
      if( $name == ‘Skype’ ) {
      $url = ‘skype:’. $url .’?call’;
      }
      if( $name == ‘Email’ ) {
      $url = ‘mailto:’ . $url;
      }

      // Generate FontAwesome icon class.
      $fa_class = ‘fa-‘ . strtolower( $name );

      // Change email icon from “fa-email” to “fa-at”.
      if( $name == ‘Email’ ) {
      $fa_class = ‘fa-at’;
      }

      echo sprintf
      (

    • <span class=”tv-icon”><i class=”fa %s”></i></span><span class=”tv-text”>%s</span>
    • ‘,
      esc_attr( strtolower($name) ), $url, $_target, esc_attr( $fa_class ), esc_attr( __($name, ‘agama-pro’) )
      );
      }
      }
      echo ‘

    ‘;
    } else {
    foreach( $social as $name => $url ) {
    if( ! empty( $url ) ) {
    if( $name == ‘Phone’ ) {
    $url = ‘tel:’ . $url;
    }
    if( $name == ‘Skype’ ) {
    $url = ‘skype:’. $url .’?call’;
    }
    if( $name == ‘Email’ ) {
    $url = ‘mailto:’ . $url;
    }

    // Generate FontAwesome icon class.
    $fa_class = ‘fa-‘ . strtolower( $name );

    // Change email icon from “fa-email” to “fa-at”.
    if( $name == ‘Email’ ) {
    $fa_class = ‘fa-at’;
    }

    echo sprintf
    (
    ‘,
    esc_attr( strtolower($name) ), $url, $_target, esc_attr( $tip_position ), esc_attr( __($name, ‘agama-pro’) )
    );
    }
    }
    }
    }

    • This reply was modified 5 years, 2 months ago by AlphaCE.
    #10228
    Zex
    Moderator

    Hello AlphaCE!

    You are right,
    We already know about that issue, and that will be fixed in the next theme update.

    Thanks for the patience.

    Regards

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