<commit_before><?php

/**
 * This file is part of the hyyan/woo-poly-integration plugin.
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Hyyan\WPI\Taxonomies;

/**
 * ShippingCalss
 *
 * @author <NAME> <<EMAIL>>
 */
class ShippingClass implements TaxonomiesInterface
{
    /**
     * Construct object
     */
    public function __construct() {
        // Shipping method in the Cart and Checkout pages
        add_filter( 'woocommerce_shipping_rate_label', array( $this, 'translate_shipping_label' ), 10, 1 );

        // Shipping method in My Accoutn page, Order Emails and Paypal requests
        add_filter( 'woocommerce_order_shipping_method', array( $this, 'translate_order_shipping_method' ), 10, 2 );
    }

    public function translate_shipping_label( $label ) {
        return __( $label , 'woocommerce' );
    }

    public function translate_order_shipping_method( $implode, $instance ) {

        // Convert the imploded array again to an array that is easy to manipulate
        $shipping_methods = explode( ', ', $implode );

        // Array with translated shipping methods
        $translated = array();

        foreach ( $shipping_methods as $shipping ) {
            $translated[] = __( $shipping, 'woocommerce' );
        }

        // Implode array to string again
        $translated_implode = implode( ', ', $translated );

        return $translated_implode;
    }

    /**
     * @{inheritdoc}
     */
    public static function getNames()
    {
        return array('product_shipping_class');
    }

}<commit_msg>Feature separation: move translation of shipment methods to new file Shipping.php<commit_after><?php

/**
 * This file is part of the hyyan/woo-poly-integration plugin.
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Hyyan\WPI\Taxonomies;

/**
 * ShippingCalss
 *
 * @author <NAME> <<EMAIL>>
 */
class ShippingClass implements TaxonomiesInterface
{
    /**
     * @{inheritdoc}
     */
    public static function getNames()
    {
        return array('product_shipping_class');
    }

}
{'fraction_non_alphanumeric': 0.1092511013215859, 'fraction_numerical': 0.0026431718061674008, 'mean_word_length': 2.9290657439446366, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2878439', 'n_tokens_mistral': 669, 'n_tokens_neox': 640, 'n_words': 196}