Plugin Directory

Changeset 3443504


Ignore:
Timestamp:
01/20/2026 06:58:38 PM (2 months ago)
Author:
bmltenabled
Message:

Deploy version 1.4.8

Location:
fetch-meditation/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fetch-meditation/trunk/build.txt

    r3435469 r3443504  
    1 4e773c535f86762c45da9c26122778b17c4a37ef
     1e08d66d035392c03398a7e21f8765ec6d36e45d7
  • fetch-meditation/trunk/fetch-meditation.php

    r3435469 r3443504  
    77 * Contributors:      pjaudiomv, bmltenabled
    88 * Author:            bmltenabled
    9  * Version:           1.4.7
     9 * Version:           1.4.8
    1010 * Requires PHP:      8.1
    1111 * Requires at least: 6.2
     
    364364    }
    365365
     366
     367    /**
     368     * Get translated title for a book in a specific language
     369     *
     370     * @param string $book The book type (jft or spad)
     371     * @param string $language The language code
     372     * @return string Translated title
     373     */
     374    private static function get_translated_title( string $book, string $language ): string {
     375        $translations = [
     376            'jft' => [
     377                'english' => 'Just For Today',
     378                'french' => 'Juste pour aujourd\'hui',
     379                'german' => 'Nur für heute',
     380                'italian' => 'Solo per oggi',
     381                'portuguese' => 'Só por hoje',
     382                'portuguese-pt' => 'Só por hoje',
     383                'russian' => 'Только на сегодня',
     384                'spanish' => 'Sólo por hoy',
     385                'swedish' => 'Bara för idag',
     386            ],
     387            'spad' => [
     388                'english' => 'Spiritual Principle A Day',
     389                'french' => 'Principe spirituel du jour',
     390                'german' => 'Spirituelles Prinzip des Tages',
     391                'italian' => 'Principio spirituale del giorno',
     392                'portuguese' => 'Princípio espiritual do dia',
     393                'portuguese-pt' => 'Princípio espiritual do dia',
     394                'russian' => 'Духовный принцип дня',
     395                'spanish' => 'Principio espiritual del día',
     396                'swedish' => 'Andlig princip för dagen',
     397            ],
     398        ];
     399
     400        // Return translated title or fall back to English
     401        if ( isset( $translations[ $book ][ $language ] ) ) {
     402            return $translations[ $book ][ $language ];
     403        }
     404        return $translations[ $book ]['english'];
     405    }
     406
     407
    366408    /**
    367409     * Render both JFT and SPAD meditations in a tabbed interface
     
    432474        // Build tabbed or accordion interface
    433475        if ( 'accordion' === $tabs_layout ) {
    434             return static::render_accordion( $instance_counter, $jft_content, $spad_content, $jft_theme, $spad_theme );
    435         }
     476            return static::render_accordion( $instance_counter, $jft_content, $spad_content, $jft_theme, $spad_theme, $jft_language, $spad_language );
     477        }
     478
     479        // Get translated titles
     480        $jft_title = esc_html( self::get_translated_title( 'jft', $jft_language ) );
     481        $spad_title = esc_html( self::get_translated_title( 'spad', $spad_language ) );
    436482
    437483        // Build tabbed interface (horizontal)
     
    439485        $content .= "  <ul class=\"meditation-tab-list\" role=\"tablist\">\n";
    440486        $content .= "    <li role=\"presentation\">\n";
    441         $content .= "      <button class=\"meditation-tab-button\" role=\"tab\" data-tab-id=\"jft\" aria-selected=\"true\" aria-controls=\"meditation-panel-jft-{$instance_counter}\" tabindex=\"0\">Just For Today</button>\n";
     487        $content .= "      <button class=\"meditation-tab-button\" role=\"tab\" data-tab-id=\"jft\" aria-selected=\"true\" aria-controls=\"meditation-panel-jft-{$instance_counter}\" tabindex=\"0\">{$jft_title}</button>\n";
    442488        $content .= "    </li>\n";
    443489        $content .= "    <li role=\"presentation\">\n";
    444         $content .= "      <button class=\"meditation-tab-button\" role=\"tab\" data-tab-id=\"spad\" aria-selected=\"false\" aria-controls=\"meditation-panel-spad-{$instance_counter}\" tabindex=\"-1\">Spiritual Principle A Day</button>\n";
     490        $content .= "      <button class=\"meditation-tab-button\" role=\"tab\" data-tab-id=\"spad\" aria-selected=\"false\" aria-controls=\"meditation-panel-spad-{$instance_counter}\" tabindex=\"-1\">{$spad_title}</button>\n";
    445491        $content .= "    </li>\n";
    446492        $content .= "  </ul>\n";
     
    470516     * @return string Rendered accordion HTML
    471517     */
    472     private static function render_accordion( int $instance_counter, string $jft_content, string $spad_content, string $jft_theme, string $spad_theme ): string {
     518    private static function render_accordion( int $instance_counter, string $jft_content, string $spad_content, string $jft_theme, string $spad_theme, string $jft_language, string $spad_language ): string {
     519        // Get translated titles
     520        $jft_title = esc_html( self::get_translated_title( 'jft', $jft_language ) );
     521        $spad_title = esc_html( self::get_translated_title( 'spad', $spad_language ) );
     522
    473523        $content = "\n<div class=\"meditation-accordion-container\" data-instance-id=\"{$instance_counter}\" data-layout=\"accordion\">\n";
    474524
     
    476526        $content .= "  <div class=\"meditation-accordion-item\">\n";
    477527        $content .= "    <button class=\"meditation-accordion-button active\" aria-expanded=\"true\" aria-controls=\"meditation-accordion-jft-{$instance_counter}\">\n";
    478         $content .= "      <span>Just For Today</span>\n";
     528        $content .= "      <span>{$jft_title}</span>\n";
    479529        $content .= "      <span class=\"meditation-accordion-icon\"></span>\n";
    480530        $content .= "    </button>\n";
     
    488538        $content .= "  <div class=\"meditation-accordion-item\">\n";
    489539        $content .= "    <button class=\"meditation-accordion-button\" aria-expanded=\"false\" aria-controls=\"meditation-accordion-spad-{$instance_counter}\">\n";
    490         $content .= "      <span>Spiritual Principle A Day</span>\n";
     540        $content .= "      <span>{$spad_title}</span>\n";
    491541        $content .= "      <span class=\"meditation-accordion-icon\"></span>\n";
    492542        $content .= "    </button>\n";
  • fetch-meditation/trunk/readme.txt

    r3435469 r3443504  
    66Requires PHP: 8.1
    77Tested up to: 6.9
    8 Stable tag: 1.4.7
     8Stable tag: 1.4.8
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5757
    5858== Changelog ==
     59
     60= 1.4.8 =
     61
     62* Add tab translations.
    5963
    6064= 1.4.7 =
  • fetch-meditation/trunk/vendor/composer/installed.php

    r3435469 r3443504  
    22    'root' => array(
    33        'name' => 'bmlt/fetch-meditation-wp',
    4         'pretty_version' => '1.4.7',
    5         'version' => '1.4.7.0',
    6         'reference' => '4e773c535f86762c45da9c26122778b17c4a37ef',
     4        'pretty_version' => '1.4.8',
     5        'version' => '1.4.8.0',
     6        'reference' => 'e08d66d035392c03398a7e21f8765ec6d36e45d7',
    77        'type' => 'project',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'bmlt/fetch-meditation-wp' => array(
    23             'pretty_version' => '1.4.7',
    24             'version' => '1.4.7.0',
    25             'reference' => '4e773c535f86762c45da9c26122778b17c4a37ef',
     23            'pretty_version' => '1.4.8',
     24            'version' => '1.4.8.0',
     25            'reference' => 'e08d66d035392c03398a7e21f8765ec6d36e45d7',
    2626            'type' => 'project',
    2727            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.