Making WordPress.org

Changeset 6030


Ignore:
Timestamp:
10/14/2017 02:04:50 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: Display locale banner if a non-English locale is detected from headers, but no translations exist yet.

Fixes #2922.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php

    r6029 r6030  
    168168                                        );
    169169                                }
     170
     171                        // Non-English locale in header, no translations.
     172                        } elseif ( $locales_from_header ) {
     173                                $locale = reset( $locales_from_header );
     174
     175                                $suggest_string = sprintf(
     176                                        $this->translate( 'This plugin is not available in %1$s yet. <a href="%2$s">Help translate it!</a>', $locale ),
     177                                        \GP_Locales::by_field( 'wp_locale', $locale )->native_name,
     178                                        esc_url( 'https://translate.wordpress.org/projects/wp-plugins/' . $plugin_slug )
     179                                );
    170180                        }
    171181
Note: See TracChangeset for help on using the changeset viewer.