WordPress.org

Making WordPress.org

Changeset 3460


Ignore:
Timestamp:
06/19/16 11:03:43 (18 months ago)
Author:
ocean90
Message:

Plugin Directory: First pass for a locale banner on plugin detail page.

Adds a new REST API endpoint and suggests languages based on the HTTP_ACCEPT_LANGUAGE header.

See #1728.

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
2 added
4 edited

Legend:

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

    r3367 r3460  
    1414        new Routes\Internal_Stats(); 
    1515        new Routes\Plugin(); 
     16        new Routes\Plugin_Translations(); 
    1617        new Routes\Popular_Categories(); 
    1718        new Routes\Query_Plugins(); 
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/css/style-rtl.css

    r3459 r3460  
    437437  margin: 0 0 1.5em; 
    438438  width: 100%; 
     439} 
     440 
     441.notification { 
     442  padding: .5rem; 
     443  background: #C7E8CA; 
     444  text-align: center; 
     445  font-size: 12.8px; 
     446  font-size: 0.8rem; 
     447} 
     448 
     449@media (min-width: 67rem) { 
     450  .notification { 
     451    margin: 1rem auto 0; 
     452    max-width: 960px; 
     453  } 
    439454} 
    440455 
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/css/style.css

    r3459 r3460  
    437437  margin: 0 0 1.5em; 
    438438  width: 100%; 
     439} 
     440 
     441.notification { 
     442  padding: .5rem; 
     443  background: #C7E8CA; 
     444  text-align: center; 
     445  font-size: 12.8px; 
     446  font-size: 0.8rem; 
     447} 
     448 
     449@media (min-width: 67rem) { 
     450  .notification { 
     451    margin: 1rem auto 0; 
     452    max-width: 960px; 
     453  } 
    439454} 
    440455 
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r3389 r3460  
    7575    if ( is_singular( 'plugin' ) ) { 
    7676        wp_enqueue_script( 'wporg-plugins-accordion', get_template_directory_uri() . '/js/section-accordion.js', array(), '20160525', true ); 
     77 
     78        $slug = get_queried_object()->post_name; 
     79        wp_enqueue_script( 'wporg-plugins-locale-banner', get_template_directory_uri() . '/js/locale-banner.js', array(), '20160525', true ); 
     80        wp_localize_script( 'wporg-plugins-locale-banner', 'wporgLocaleBanner', array( 
     81            'apiURL' => rest_url( "/plugins/v1/plugin/$slug/translations" ), 
     82        ) ); 
    7783    } 
    7884} 
Note: See TracChangeset for help on using the changeset viewer.