Skip to content

Commit

Permalink
Prepare JS for non-variants GlotPress core.
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-mendonca committed Nov 30, 2023
1 parent 8515a87 commit 3687b2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-portuguese-ao90.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@ public static function post_template_load( $template, &$args ) {
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {

// Add Locale and Variant info to 'pt/default' and 'pt-ao90/default'.
var editable = <?php echo esc_js( GP_CONVERT_PT_AO90_EDIT ? 'true' : 'false' ); // @phpstan-ignore-line ?>;
$( 'table.gp-table.translation-sets tr td a[href$="/pt/default/"]' ).closest( 'tr' ).addClass( 'root' ).attr( 'data-locale', 'pt' );
$( 'table.gp-table.translation-sets tr td a[href$="/pt-ao90/default/"]' ).closest( 'tr' ).addClass( 'variant' ).attr( 'data-locale', 'pt-ao90' ).attr( 'data-editable', editable );

} );
</script>
<?php
Expand Down

0 comments on commit 3687b2e

Please sign in to comment.