• Resolved Hughsp

    (@rescaes)


    Hi there,

    I can not be happier with this plugin. However I think it still has a few improvements pending translation-wise. I had to use “Loco Translate” (another awesome plugin and widely popular) to correct / add some translations correctly.

    My problem now is that, unless I’m doing something wrong, when sending the “Email invoice / order details to customer” from the orders admin backend, customers get “VAT” in the taxes field… No matter if I changed all fields of all languages including “VAT” with Loco Translate… it still showed “VAT”.

    I had to manually edit line 455 on file wc-gzd-core-functions.php (inside “includes” folder) and change the value “VAT” to “IVA” (spanish) in order to make it show correctly in the email:

    … sprintf( __( ‘%s%% IVA’, ‘woocommerce-germanized’ )…..

    It is a solution, but a pain when updating the plugin. Could it be solved?… Am I missing something?

    I hope it helps to make this plugin better. Also let me know if I can help with spanish translations.

    Cheers!

    • This topic was modified 3 years, 4 months ago by Hughsp.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi there,

    Germanized uses the official WP translation API to translate it’s strings – seems like a problem of LocoTranslate that the string is not being translated correctly. All Germanized an do is use the __() with the right text domain. Please ask the Loco Translate support for further assistance on this issue.

    Cheers

    Thread Starter Hughsp

    (@rescaes)

    Hi again, thanks!

    However, if it’s a loco problem, I don’t understand why when I deactivate Germanized, everything looks fine…

    Anyway, while finding a better solution… If possible, could you please help me adding a filter to change the “%s%% VAT” in the “function wc_gzd_get_tax_rate_label” ?… I tried myself but without success.

    I know it is not very orthodox, but would solve my conflict for now and would always be better than changing directly the code in the file.

    Thanks a bunch!

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    Germanized adds custom translations and overrides order total HTML – that’s why the issue does only show up when Germanized is activated – but that does not necessarily mean that this is a problem within the Germanized code ??

    The filter is woocommerce_gzd_tax_rate_label – you might adjust that via add_filter to your own needs, e.g.:

    
    add_filter( 'woocommerce_gzd_tax_rate_label', function( $label, $rate_percentage, $type ) {
       // Adjust $label
       return $label;
    }, 10, 3 );
    

    Cheers

    Thread Starter Hughsp

    (@rescaes)

    Hi again,

    Understood!… Holly Molly!… that worked perfectly. Even if possibly not the cleanest fix, it helps a lot by giving a decent solution to my problem. Waiting for Loco Translate (or maybe other plugin in conflict) to fix it would be a dead end.

    Too bad I can’t leave 6 stars!

    Awesome support!????????

    Thanks again.

    Thank God find the solution the code is

    
    add_filter( 'woocommerce_gzd_tax_rate_label', function( $label, $rate_percentage, $type ) {
       // Adjust $label
    
    	if ( 'incl' === $type ) {
    		$label = ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ? sprintf( __( 'incl. %s%% GST', 'woocommerce-germanized' ), wc_gzd_format_tax_rate_percentage( $rate_percentage ) ) : __( 'incl. GST', 'woocommerce-germanized' ) );
    	} else {
    		$label = ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ? sprintf( __( '%s%% GST', 'woocommerce-germanized' ), wc_gzd_format_tax_rate_percentage( $rate_percentage ) ) : __( 'GST', 'woocommerce-germanized' ) );
    	}
    
       return $label;
    }, 10, 3 );

    i want to know is there any possibilities to change VAT TO GST OR SALES TAX globally everywhere even if I install Germanized

    • This reply was modified 3 years, 1 month ago by mrshafaq.
    • This reply was modified 3 years, 1 month ago by mrshafaq. Reason: forgot to add php
    • This reply was modified 3 years, 1 month ago by mrshafaq.

    I want to change VAT TO GST in this function how do i add filter

    	public function get_tax_info() {
    		$tax_notice    = false;
    		$is_vat_exempt = ( ! empty( WC()->customer ) ? WC()->customer->is_vat_exempt() : false );
    
    		if ( $this->hide_shopmarks_due_to_missing_price() ) {
    			return false;
    		}
    
    		if ( $this->child->is_taxable() || $this->is_differential_taxed() ) {
    
    			$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
    			$tax_rates        = WC_Tax::get_rates( $this->child->get_tax_class() );
    
    			if ( ! empty( $tax_rates ) ) {
    
    				$tax_rates = array_values( $tax_rates );
    
    				// If is variable or is virtual vat exception dont show exact tax rate
    				if ( $this->is_virtual_vat_exception() || $this->child->is_type( 'variable' ) || $this->child->is_type( 'grouped' ) || get_option( 'woocommerce_gzd_hide_tax_rate_shop' ) === 'yes' ) {
    					$tax_notice = ( $tax_display_mode == 'incl' && ! $is_vat_exempt ? __( 'incl. GST', 'woocommerce-germanized' ) : __( 'excl. GST', 'woocommerce-germanized' ) );
    				} else {
    					$tax_notice = ( $tax_display_mode == 'incl' && ! $is_vat_exempt ? sprintf( __( 'incl. %s%% GST', 'woocommerce-germanized' ), ( wc_gzd_format_tax_rate_percentage( $tax_rates[0]['rate'] ) ) ) : sprintf( __( 'excl. %s%% GST', 'woocommerce-germanized' ), ( wc_gzd_format_tax_rate_percentage( $tax_rates[0]['rate'] ) ) ) );
    				}
    			}
    
    			if ( $this->is_differential_taxed() ) {
    				if ( get_option( 'woocommerce_gzd_differential_taxation_show_notice' ) === 'yes' ) {
    					$tax_notice = wc_gzd_get_differential_taxation_notice_text();
    				} else {
    					$tax_notice = __( 'incl. GST', 'woocommerce-germanized' );
    				}
    			}
    		}
    
    		/**
    		 * Filter to adjust the product tax notice.
    		 *
    		 * This filter allows you to easily change the tax notice on a per product basis.
    		 *
    		 * @param string $tax_notice The tax notice.
    		 * @param WC_GZD_Product $product The product object.
    		 *
    		 * @since 1.0.0
    		 *
    		 */
    		return apply_filters( 'woocommerce_gzd_product_tax_info', $tax_notice, $this );
    	}
    Plugin Author vendidero

    (@vendidero)

    Hi there,

    the easiest way would be to adjust the language files to your own needs (e.g. by using a plugin like loco translate) or you could use a gettext filter, e.g.: https://gist.github.com/BFTrick/7040403

    Cheers

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Translation bug ?’ is closed to new replies.