Title: Change button values / text
Last modified: February 18, 2023

---

# Change button values / text

 *  Resolved [markosmiles](https://wordpress.org/support/users/markosmiles/)
 * (@markosmiles)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/)
 * Hi,
 * Thank you for an excellent plugin.
 * I am building a site where I would need to show the calendar in Finnish. Is there
   a way to translate the “previous” and “next” buttons to Finnish? Or change the
   buttons’ value?
 * I also noticed that my calendar is not showing by default the “month”, “year”
   and “calendar name” in the “dropdown” select fields on the left.
 * Could you please help me with renaming the button and showing the month, year
   and calendar name. Thank you very much.

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

 *  [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * (@kmacharia)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/#post-16515594)
 * Hi [@markosmiles](https://wordpress.org/support/users/markosmiles/),
 * Thanks for reaching out!
 * You can translate these buttons by adding the following code snippet on your 
   site and replacing “New Text” with the Finnish text that you want to use:
 *     ```wp-block-code
       add_filter( 'gettext', 'sugar_cal_translate_text', 20, 3 );
       /**
        * Change calendar buttons on the front end.
        *
        * @link https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
        */
       function sugar_cal_translate_text( $translated_text, $text, $domain ) {
   
               switch ( $translated_text ) {
   
                   case 'Previous' :
   
                       $translated_text = __( 'New Text', 'sugar-calendar' );
                       break;
   
                   case 'Next' :
   
                       $translated_text = __( 'New Text', 'sugar-calendar' );
                       break;
               }
   
           return $translated_text;
       }
       ```
   
 * In case it helps, here’s our tutorial with the most common [ways to add custom code](https://developers.wpforms.com/docs/how-to-add-custom-php-or-javascript-for-wpforms/)
   like this.
   For the most beginner-friendly option in that tutorial, I’d recommend
   using the [WPCode plugin](http://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/).
 * For the other issue, would you mind sharing a link to the form so that I can 
   check the issue?
 * I’m looking forward to your response.
 * Thanks!
 *  Thread Starter [markosmiles](https://wordpress.org/support/users/markosmiles/)
 * (@markosmiles)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/#post-16519107)
 * Hi [@kmacharia](https://wordpress.org/support/users/kmacharia/),
 * Thank you so much for your help! I appreciate you taking the time to speak with
   me.
 * I was able to translate the “next” and “previous” buttons with the code snippet
   you provided.
 * My calendar is on this [page](https://www.meritie.org/US/jasenten-sivut/vartiointi/)
   at the bottom of the page.
 * I would be grateful if you could take a look at the calendar and the dropdown
   fields near the left border of the calendar. At the moment I cannot see the month
   name, year or calendar name in the fields. Or should they be visible when the
   field is not clicked?
 * By the way, is it possible to also translate the “Go” button with the same code
   snippet you provided? I’d like to translate that button too.
 * I’m looking forward to hearing from you.
 * Thanks!
 *  [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * (@kmacharia)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/#post-16522030)
 * Hi [@markosmiles](https://wordpress.org/support/users/markosmiles/),
 * I’m glad to hear that the code snippet helped. To fix the dropdown issue, I would
   suggest applying the following CSS code on your site:
 *     ```wp-block-code
       #sc_events_calendar_head select{
       width:100%;
       max-width:100%;
       }
       ```
   
 * And in case it helps, here’s a tutorial on [how to add custom CSS like this to your site](https://wpforms.com/developers/how-to-add-custom-css-styles-for-wpforms/).
 * You can also extend the previous code to translate the “Go” button as shown below:
 *     ```wp-block-code
       add_filter( 'gettext', 'sugar_cal_translate_text', 20, 3 );
       /**
        * Change calendar buttons on the front end.
        *
        * @link https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
        */
       function sugar_cal_translate_text( $translated_text, $text, $domain ) {
   
               switch ( $translated_text ) {
   
                   case 'Previous' :
   
                       $translated_text = __( 'Edellinen', 'sugar-calendar' );
                       break;
   
       			case 'Next' :
   
                       $translated_text = __( 'Seuraava', 'sugar-calendar' );
                       break;
   
                   case 'Go' :
   
                       $translated_text = __( 'New Text', 'sugar-calendar' );
                       break;
               }
   
           return $translated_text;
       }
       ```
   
 * I hope this helps.
 * Thanks!
 *  Thread Starter [markosmiles](https://wordpress.org/support/users/markosmiles/)
 * (@markosmiles)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/#post-16522726)
 * Hi [@kmacharia](https://wordpress.org/support/users/kmacharia/),
 * Thank you so much!
 * The CSS code and the additional code for translating the “Go” button both worked
   perfectly.
 *  [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * (@kmacharia)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/#post-16526567)
 * Hi [@markosmiles](https://wordpress.org/support/users/markosmiles/),
 * That is great to hear! Don’t hesitate to contact us if you bump into any other
   issue. 🙂

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

The topic ‘Change button values / text’ is closed to new replies.

 * ![](https://ps.w.org/sugar-calendar-lite/assets/icon.svg?rev=3370563)
 * [Sugar Calendar - Events Calendar, Event Tickets, and Events Management Platform](https://wordpress.org/plugins/sugar-calendar-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sugar-calendar-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sugar-calendar-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/sugar-calendar-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sugar-calendar-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sugar-calendar-lite/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/change-button-values-text/#post-16526567)
 * Status: resolved