WordPress.org

Making WordPress.org

Changeset 4996


Ignore:
Timestamp:
02/23/2017 11:42:12 PM (3 years ago)
Author:
ocean90
Message:

Translate: Show link to locale glossary on project overviews.

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

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-project.php

    r4513 r4996  
    4848                    ?>
    4949                </li>
     50                <?php if ( $locale_glossary ) : ?>
     51                    <li class="locale-glossary">
     52                        <a href="<?php echo esc_url( gp_url_join( gp_url( '/locale' ), $locale_slug, $set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Locale Glossary', 'glotpress' ); ?></a>
     53                    </li>
     54                <?php elseif ( $can_create_locale_glossary ) : ?>
     55                    <li class="locale-glossary">
     56                        <a href="<?php echo esc_url( gp_url_join( gp_url( '/locale' ), $locale_slug, $set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Create Locale Glossary', 'glotpress' ); ?></a>
     57                    </li>
     58                <?php endif; ?>
    5059            </ul>
    5160
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-projects.php

    r2865 r4996  
    4141                ?>
    4242            </li>
     43            <?php if ( $locale_glossary ) : ?>
     44                <li class="locale-glossary">
     45                    <a href="<?php echo esc_url( gp_url_join( gp_url( '/locale' ), $locale_slug, $set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Locale Glossary', 'glotpress' ); ?></a>
     46                </li>
     47            <?php elseif ( $can_create_locale_glossary ) : ?>
     48                <li class="locale-glossary">
     49                    <a href="<?php echo esc_url( gp_url_join( gp_url( '/locale' ), $locale_slug, $set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Create Locale Glossary', 'glotpress' ); ?></a>
     50                </li>
     51            <?php endif; ?>
    4352        </ul>
    4453        <div class="contributors">
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-rosetta-roles/inc/class-plugin.php

    r4931 r4996  
    105105        // Grant permissions to Cross-Locale PTEs.
    106106        $cross_locale_pte_verdict = Cross_Locale_PTE::gp_pre_can_user( $verdict, $args );
    107     #   var_dump($cross_locale_pte_verdict);
    108107        if ( is_bool( $cross_locale_pte_verdict ) ) {
    109108            return $cross_locale_pte_verdict;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r4928 r4996  
    134134        }
    135135
     136        $can_create_locale_glossary = GP::$permission->current_user_can( 'admin' );
     137        $locale_glossary_translation_set = GP::$translation_set->by_project_id_slug_and_locale( 0, $set_slug, $locale_slug );
     138        $locale_glossary = GP::$glossary->by_set_id( $locale_glossary_translation_set->id );
     139
    136140        $this->tmpl( 'locale-projects', get_defined_vars() );
    137141    }
     
    188192
    189193        $locale_contributors = $this->get_locale_contributors( $sub_project, $locale_slug, $set_slug );
     194
     195        $can_create_locale_glossary = GP::$permission->current_user_can( 'admin' );
     196        $locale_glossary_translation_set = GP::$translation_set->by_project_id_slug_and_locale( 0, $set_slug, $locale_slug );
     197        $locale_glossary = GP::$glossary->by_set_id( $locale_glossary_translation_set->id );
    190198
    191199        $this->tmpl( 'locale-project', get_defined_vars() );
Note: See TracChangeset for help on using the changeset viewer.