Making WordPress.org

Changeset 14172


Ignore:
Timestamp:
11/13/2024 02:53:50 AM (2 months ago)
Author:
adamwood
Message:

Support 2024: i18n for homepage 'Get started' links

Enables the slug for the welcome page to be translated, so that the 'Get started' links on the archive and homepage can be customized per locale.

Fixes https://meta.trac.wordpress.org/ticket/7821

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/archive-forum.php

    r13861 r14172  
    1616            <section>
    1717                <p><?php printf(
    18                     /* Translators: forums URL */
     18                    /* Translators: forums welcome page URL */
    1919                    __( 'Our community-based support forums are a great place to learn, share, and help each other. <a href="%s">Find out how to get started</a>.', 'wporg-forums' ),
    20                     esc_url( site_url( '/welcome/' ) )
     20                    esc_url( wporg_support_get_welcome_url() )
    2121                ) ?></p>
    2222            </section>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/functions.php

    r14104 r14172  
    13441344}
    13451345add_filter( 'bbp_is_single_user_profile', 'wporg_is_single_user_profile' );
     1346
     1347/**
     1348 * Get the URL for the forums welcome page.
     1349 * Slug is translated, so the URL will be correct for the current locale.
     1350 *
     1351 * @return string
     1352 */
     1353function wporg_support_get_welcome_url() {
     1354    return site_url(
     1355        /* Translators: slug for the welcome page, e.g. 'welcome' will produce https://wordpress.org/support/welcome/ */
     1356        esc_html__( 'welcome', 'wporg-forums' )
     1357    );
     1358}
    13461359
    13471360
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/patterns/welcome-cards.php

    r13312 r14172  
    2020
    2121                    <!-- wp:paragraph -->
    22                     <p>' . __( '<a href="https://wordpress.org/support/welcome/">Get started</a>', 'wporg-forums' ) . '</p>
     22                    <p>' . sprintf(
     23                        /* Translators: forums welcome page URL */
     24                        __( '<a href="%s">Get started</a>', 'wporg-forums' ),
     25                        esc_url( wporg_support_get_welcome_url() )
     26                    ) . '</p>
    2327                    <!-- /wp:paragraph -->
    2428
Note: See TracChangeset for help on using the changeset viewer.