Skip to content
Public Ticket #17929

Penci Weather via Elementor - translate Forecast Days

Conversation thread

ntar replied

Customer Reply

Thank you, everything works. In order not to install unnecessary plugins, I used the functions.php file in Child Theme.

Code:

function penci_get_tran_setting( $day ) {
        $text = array(
            'penci_weather_sun_text' => 'Sun',
            'penci_weather_mon_text' => 'Mon',
            'penci_weather_tue_text' => 'Tue',
            'penci_weather_wed_text' => 'Wed',
            'penci_weather_thu_text' => 'Thu',
            'penci_weather_fri_text' => 'Fri',
            'penci_weather_sat_text' => 'Sat',
        );
        return isset( $text[$day] ) ? $text[$day] : '';
}

PenciDesign Supporter replied

Staff Reply

Hi,

Please install the Code Snippet plugin, then create a new snippet with the following content:

if ( ! function_exists( 'penci_get_tran_setting' ) ) {
    function penci_get_tran_setting( $day ) {
        $text = array(
            'penci_weather_sun_text' => 'Sun',
            'penci_weather_mon_text' => 'Mon',
            'penci_weather_tue_text' => 'Tue',
            'penci_weather_wed_text' => 'Wed',
            'penci_weather_thu_text' => 'Thu',
            'penci_weather_fri_text' => 'Fri',
            'penci_weather_sat_text' => 'Sat',
        );
        return isset( $text[$day] ) ? $text[$day] : '';
    }
}

Replace Sun, Mon, Tue, ... with your custom text.

Regards,
PenciDesign.

ntar started the conversation

Conversation Start

Dear Penci Design,

Is it possible to translate Forecast days (Fri, Sat, Sun, Mon, Tue) directly in the panel, if not, how to do it?

Want to join this conversation or access attachments? Sign in first.