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

Translation issue due to no text domain in wc_licenses_class.php #45

Closed
k-kikuchi-waverworks opened this issue Sep 10, 2020 · 0 comments
Labels

Comments

@k-kikuchi-waverworks
Copy link

k-kikuchi-waverworks commented Sep 10, 2020

Thank you for fixing #33.
I say big thanks to you.

However, this fix caused an another issue.

You missed adding text domain so that translation is not working.

Example

<?php echo _e('Expiration'); ?>
is should be like

<?php echo esc_html__( 'Expiration', 'softwarelicensemanager' ); ?>

Especially, please rewrite following codes to apply translation.

【1】
From
<script> jQuery(document).ready(function() { jQuery('.deactivate_lic_key').click(function(event) { var id = jQuery(this).attr("id"); var lic_type = jQuery(this).attr('lic_type'); var class_name = '.lic-entry-' + id; jQuery(this).text('Removing'); jQuery.get('<?php echo get_bloginfo("url"); ?>' + '/wp-admin/admin-ajax.php?action=del_activation&id=' + id + '&lic_type=' + lic_type, function(data) { if (data == 'success') { jQuery(class_name).remove(); jQuery('.slm_ajax_msg').html('<div class="alert alert-primary" role="alert"> License key was deactivated! </div>'); } else { jQuery('.slm_ajax_msg').html('<div class="alert alert-danger" role="alert"> License key was not deactivated! </div>'); } }); }); }); </script>
to
<script> jQuery(document).ready(function() { jQuery('.deactivate_lic_key').click(function(event) { var id = jQuery(this).attr("id"); var lic_type = jQuery(this).attr('lic_type'); var class_name = '.lic-entry-' + id; jQuery(this).text('Removing'); jQuery.get('<?php echo get_bloginfo("url"); ?>' + '/wp-admin/admin-ajax.php?action=del_activation&id=' + id + '&lic_type=' + lic_type, function(data) { if (data == 'success') { jQuery(class_name).remove(); jQuery('.slm_ajax_msg').html('<div class="alert alert-primary" role="alert"><?php echo esc_html__( 'License key was deactivated!', 'softwarelicensemanager' ); ?></div>'); } else { jQuery('.slm_ajax_msg').html('<div class="alert alert-danger" role="alert"> <?php echo esc_html__( 'License key was not deactivated!', 'softwarelicensemanager' ); ?></div>'); } }); }); }); </script>

【2】
From
if (empty($result)) { echo '<div class="woocommerce-Message woocommerce-Message--info woocommerce-info"> <a class="woocommerce-Button button" href="' . get_permalink(wc_get_page_id('shop')) . '"> Browse products </a> No licenses available yet. </div>'; $slm_hide = 'style="display:none"'; }
to
if (empty($result)) { ?> <div class="woocommerce-Message woocommerce-Message--info woocommerce-info"> <a class="woocommerce-Button button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php echo esc_html__( 'Browse products', 'softwarelicensemanager' ); ?> </a> <?php echo esc_html__( 'No licenses available yet.', 'softwarelicensemanager' ); ?> </div> <?php $slm_hide = 'style="display:none"'; }

【3】
From
<div class="slm-activated-on domains-list col-md-6"> <?php SLM_Utility::get_license_activation($license_info->license_key, SLM_TBL_LIC_DOMAIN, 'Domains', $allow_domain_removal); ?> </div> <div class="slm-activated-on domains-list col-md-6"> <?php SLM_Utility::get_license_activation($license_info->license_key, SLM_TBL_LIC_DEVICES, 'Devices', $allow_domain_removal); ?> </div>
to
<div class="slm-activated-on domains-list col-md-6"> <?php SLM_Utility::get_license_activation($license_info->license_key, SLM_TBL_LIC_DOMAIN, esc_html__( 'Domains','softwarelicensemanager' ), $allow_domain_removal); ?> </div> <div class="slm-activated-on domains-list col-md-6"> <?php SLM_Utility::get_license_activation($license_info->license_key, SLM_TBL_LIC_DEVICES, esc_html__( 'Devices','softwarelicensemanager' ), $allow_domain_removal); ?> </div>

Would you ming fixing these ?

And also, I found a typography issue.
<?php echo __('Date renewwed', 'softwarelicensemanager'); ?>
is should be like

<?php echo __('Date renewed', 'softwarelicensemanager'); ?>
King Regards

KAZUKI

  • I created pull request about this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants