Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1374: Improve Glossaries links #1375

Merged
merged 11 commits into from
May 3, 2022

Conversation

pedro-mendonca
Copy link
Member

@pedro-mendonca pedro-mendonca commented Mar 31, 2022

  • Show separate Locale and Project glossaries on project translation sets
  • Set specific title and breadcrumb Glossary name
  • If the no glossary is set and the user has permissions, show link to create, otherwise hide the glossary link
  • Add missing "Locales" link on the beginning of the breadcrumb on Locale Glossary view (67cc292)

This PR uses the same logic that already exists to check if $can_create_locale_glossary to show alternative link, or hide Locale Glossary creation if none exist, and $can_approve to show an alternative link or hide Project Locale creation if none exist.

If both exist

imagem

If one don't exist, show the Create link

imagem

Fixes #1374

Feedback please!

@pedro-mendonca pedro-mendonca requested a review from ocean90 March 31, 2022 15:30
@pedro-mendonca
Copy link
Member Author

pedro-mendonca commented Mar 31, 2022

Fix missing "Locales /" base on Glossary View breadcrumb:

Before

imagem
imagem

After

imagem

@pedro-mendonca pedro-mendonca changed the title 1374: Improve Glossaries links WIP 1374: Improve Glossaries links Mar 31, 2022
@pedro-mendonca pedro-mendonca marked this pull request as draft March 31, 2022 16:05
@pedro-mendonca pedro-mendonca changed the title WIP 1374: Improve Glossaries links 1374: Improve Glossaries links Mar 31, 2022
@pedro-mendonca pedro-mendonca marked this pull request as ready for review March 31, 2022 16:09
@ocean90 ocean90 added this to the 3.1 milestone Apr 3, 2022
Copy link
Member

@ocean90 ocean90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we need the new container for the glossary links in

<?php if ( $locale_glossary ) : ?>
<a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $locale->slug, $current_set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Locale Glossary', 'glotpress' ); ?></a>
<?php elseif ( $can_create_locale_glossary ) : ?>
<a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $locale->slug, $current_set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Create Locale Glossary', 'glotpress' ); ?></a>
<?php endif; ?>

@pedro-mendonca
Copy link
Member Author

@ocean90 I'll leave the CSS minification for after your final review.

@pedro-mendonca pedro-mendonca requested a review from ocean90 April 22, 2022 20:29
@pedro-mendonca
Copy link
Member Author

It looks like we need the new container for the glossary links in

<?php if ( $locale_glossary ) : ?>
<a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $locale->slug, $current_set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Locale Glossary', 'glotpress' ); ?></a>
<?php elseif ( $can_create_locale_glossary ) : ?>
<a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $locale->slug, $current_set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Create Locale Glossary', 'glotpress' ); ?></a>
<?php endif; ?>

Added the missing container.

ocean90
ocean90 previously approved these changes Apr 26, 2022
@ocean90 ocean90 merged commit e40df8b into GlotPress:develop May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links to Glossary
2 participants