Changeset 3443504
- Timestamp:
- 01/20/2026 06:58:38 PM (2 months ago)
- Location:
- fetch-meditation/trunk
- Files:
-
- 4 edited
-
build.txt (modified) (1 diff)
-
fetch-meditation.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fetch-meditation/trunk/build.txt
r3435469 r3443504 1 4e773c535f86762c45da9c26122778b17c4a37ef 1 e08d66d035392c03398a7e21f8765ec6d36e45d7 -
fetch-meditation/trunk/fetch-meditation.php
r3435469 r3443504 7 7 * Contributors: pjaudiomv, bmltenabled 8 8 * Author: bmltenabled 9 * Version: 1.4. 79 * Version: 1.4.8 10 10 * Requires PHP: 8.1 11 11 * Requires at least: 6.2 … … 364 364 } 365 365 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 366 408 /** 367 409 * Render both JFT and SPAD meditations in a tabbed interface … … 432 474 // Build tabbed or accordion interface 433 475 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 ) ); 436 482 437 483 // Build tabbed interface (horizontal) … … 439 485 $content .= " <ul class=\"meditation-tab-list\" role=\"tablist\">\n"; 440 486 $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"; 442 488 $content .= " </li>\n"; 443 489 $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"; 445 491 $content .= " </li>\n"; 446 492 $content .= " </ul>\n"; … … 470 516 * @return string Rendered accordion HTML 471 517 */ 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 473 523 $content = "\n<div class=\"meditation-accordion-container\" data-instance-id=\"{$instance_counter}\" data-layout=\"accordion\">\n"; 474 524 … … 476 526 $content .= " <div class=\"meditation-accordion-item\">\n"; 477 527 $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"; 479 529 $content .= " <span class=\"meditation-accordion-icon\"></span>\n"; 480 530 $content .= " </button>\n"; … … 488 538 $content .= " <div class=\"meditation-accordion-item\">\n"; 489 539 $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"; 491 541 $content .= " <span class=\"meditation-accordion-icon\"></span>\n"; 492 542 $content .= " </button>\n"; -
fetch-meditation/trunk/readme.txt
r3435469 r3443504 6 6 Requires PHP: 8.1 7 7 Tested up to: 6.9 8 Stable tag: 1.4. 78 Stable tag: 1.4.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 57 57 58 58 == Changelog == 59 60 = 1.4.8 = 61 62 * Add tab translations. 59 63 60 64 = 1.4.7 = -
fetch-meditation/trunk/vendor/composer/installed.php
r3435469 r3443504 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 26 26 'type' => 'project', 27 27 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.