Support

Home Forums Event Espresso Premium Change in terminology in Seating Chart Add On

Change in terminology in Seating Chart Add On

Posted: June 25, 2014 at 2:35 pm

Viewing 3 reply threads


Jamie

June 25, 2014 at 2:35 pm

Would anything outside of the seating chart addon be affected if I wanted to change the terminology/labeling that the user sees in the seating chart addon from

Level, Section, to
Section, Table,

ideas?


Lorenzo Orlando Caum

  • Support Staff

June 25, 2014 at 3:24 pm

Hi Jamie,

How did you plan on changing those words?

We usually recommend a translation file or a gettext filter: https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#plugins

An str replace also comes to mind.


Lorenzo


Jamie

June 25, 2014 at 3:30 pm

Where the word LEVEL is used in the addon….I’d like to use the word SECTION
where the word SECTION is used, I’d like to use TABLE.

We use SECTION, TABLE, SEAT rather than LEVEL SECTION, SEAT

(I’d like to remove any reference to “ROW” in the mouse over if possible as well.

I’ve used string replacement apps before in text but never in code so I didn’t want to just try it without checking – in case code depended on occasions of those words (like the field headers when importing seating chart csv’s. I’d take it after doing the string replacement I could change the csv headers to coincide as well?


Josh

  • Support Staff

June 27, 2014 at 8:05 am

Hi Jamie,

Rather than changing the strings directly in the code, I recommend using a little translation function. The function can be placed in your theme’s functions.php file or into a site specific function plugin. Some example code follows:

function seatchart_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Section: ' => 'Table: ',
        'Section:' => 'Table:',
        'Section' => 'Table',
        'Section Alignment' => 'Table Alignment',
        'NOTE: Leave a field empty if you do not want to modify the value of that field. For example, if you do not want to modify the value of "Section" - leave it empty.' => 'NOTE: Leave a field empty if you do not want to modify the value of that field. For example, if you do not want to modify the value of "Table" - leave it empty.',
        'Level' => 'Section',

        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace its translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'seatchart', 'mycustom_filter_gettext', 10, 3 );
Viewing 3 reply threads

The support post ‘Change in terminology in Seating Chart Add On’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso