Title: Translating custom fields
Last modified: January 24, 2020

---

# Translating custom fields

 *  [kaiserawilum](https://wordpress.org/support/users/kaiserawilum/)
 * (@kaiserawilum)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/translating-custom-fields-4/)
 * Hi,
 * I’m need help in translating a few texts. So I installed a no longer maintained
   theme. I have almost everything up and ready but I can’t translate the slider
   and the CTA components.
 * I tried editing theme pot files but the actual texts appears nowhere. So I accesed
   to the code and found these definitions:
 *     ```
       <div class="title-wrap">
           <h3><?php echo esc_html( $avenue_options['sc_cta3_title'] ); ?></h3>
       </div>
       <p>
           <?php echo esc_html( $avenue_options['sc_cta3_text'] ); ?>
       </p>
       ```
   
 * So I started looking for possible definitions of the variables (cta1, cta2, etc)
   and I found them on functions.php:
 *  // CTA TRIO
 *  ‘sc_cta_bool’ => ‘yes’,
 *  ‘sc_cta1_title’ => __( ‘Theme Options’, ‘avenue’ ),
    ‘sc_cta1_icon’ => ‘fa-cogs’,‘
   sc_cta1_text’ => __( ‘Change typography, colors, layouts…’, ‘avenue’ ), ‘sc_cta1_url’
   => ”, ‘sc_cta1_button_text’ => __( ‘Click Here’, ‘avenue’ ),
 *  ‘sc_cta2_title’ => __( ‘Responsive Layout’, ‘avenue’ ),
    ‘sc_cta2_icon’ => ‘
   fa-mobile’, ‘sc_cta2_text’ => __( ‘Fully responsive and mobile-ready’, ‘avenue’),‘
   sc_cta2_url’ => ”, ‘sc_cta2_button_text’ => __( ‘Click Here’, ‘avenue’ ),
 *  ‘sc_cta3_title’ => __( ‘Professional Design’, ‘avenue’ ),
    ‘sc_cta3_icon’ =>‘
   fa-diamond’, ‘sc_cta3_text’ => __( ‘Modern design to give your site a professional
   look’, ‘avenue’ ), ‘sc_cta3_url’ => ”, ‘sc_cta3_button_text’ => __( ‘Click Here’,‘
   avenue’ ),
 * I changed the values cusstomizing the site, but I cannot find a way to translate
   these fields when access in a different language to my site.
 * Thanks in advance.
    -  This topic was modified 6 years, 2 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Everything else WordPress
      topic
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftranslating-custom-fields-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/translating-custom-fields-4/#post-12362520)
 * The `__()` translation functions utilize the [gettext tools](https://www.gnu.org/software/gettext/manual/gettext.html)
   to manage translations. For themes in the WP repository translations are handled
   by the i18n community. Theme authors don’t need to do much but correctly use 
   the WP translation function.
 * For unsupported themes, you need to use the gettext tools yourself. A .pot file
   is generated which is used to do translations into a .po file. The completed .
   po file is then compiled into a .mo file which WP uses to display strings in 
   the chosen language. The language displayed is based on the site’s language setting.
 * This setting is not selectable by site visitors. If you want visitors to see 
   content in their language you need a multilingual plugin.
 *  Thread Starter [kaiserawilum](https://wordpress.org/support/users/kaiserawilum/)
 * (@kaiserawilum)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/translating-custom-fields-4/#post-12372016)
 * Thanks for your response bcworkz
 * I did manage to do what I intended following this post:
 * [https://kau-boys.com/2047/wordpress/translate-customizer-options-with-polylang](https://kau-boys.com/2047/wordpress/translate-customizer-options-with-polylang)
 * It took me a while figure it out. But basically, following the post, I changed
   the teme code so each time I change the value in the customizer, the strings 
   were updated in the polylang strings.
 * Then I had to change the page templates so the used the pll_e function to display
   the translated texts.

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

The topic ‘Translating custom fields’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [kaiserawilum](https://wordpress.org/support/users/kaiserawilum/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/translating-custom-fields-4/#post-12372016)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
