This commit is contained in:
Javier Casares 2026-08-17 16:06:40 +00:00
commit a2d1320030
5 changed files with 62 additions and 7 deletions

View file

@ -167,6 +167,17 @@ $compat_warnings = 0;
$website_url = '' !== $page_url ? $page_url : $homepage;
$has_detail = ( '' !== $website_url || '' !== $desc );
// Localised description: the admin user's locale first,
// falling back to the (English) default.
$raw_translations = $entry['description_translations'] ?? '';
$translations = is_array( $raw_translations ) ? $raw_translations : array();
$user_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
$locale_text = $translations[ $user_locale ] ?? '';
$display_desc = is_string( $locale_text ) && '' !== trim( $locale_text )
? trim( $locale_text )
: $desc;
$has_detail = ( '' !== $website_url || '' !== $desc || '' !== $display_desc );
// Subscription state: premium plugins are only usable
// (install/update) with an active or in-grace subscription.
$is_premium = ( $cost > 0.0 || 'premium' === $kind );
@ -337,8 +348,8 @@ $compat_warnings = 0;
<?php if ( '' !== $website_url ) : ?>
<a href="<?php echo esc_url( $website_url ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Visit website', 'robotstxt-manager' ); ?> <span class="screen-reader-text"><?php echo esc_html( sprintf( /* translators: %s: plugin name. */ __( '(about %s)', 'robotstxt-manager' ), $name ) ); ?></span></a>
<?php endif; ?>
<?php if ( '' !== $desc ) : ?>
<span class="robotstxt-manager-detail-description"><?php echo esc_html( $desc ); ?></span>
<?php if ( '' !== $display_desc ) : ?>
<span class="robotstxt-manager-detail-description"><?php echo esc_html( $display_desc ); ?></span>
<?php endif; ?>
<?php if ( array() !== $req_slugs ) : ?>
<span class="robotstxt-manager-detail-requires">