PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.8.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.8.2
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / inc / MultiLang / class-merchant-wpml-support.php

class-merchant-wpml-support.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.8.2, at inc/MultiLang/class-merchant-wpml-support.php

66 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly
5 }
6
7 /**
8 * Merchant - WPML Support
9 *
10 * This class is not meant to be used directly. It will be used by the Merchant_Translator class.
11 */
12 if ( ! class_exists( 'Merchant_WPML_Support' ) ) {
13 class Merchant_WPML_Support implements Merchant_Language_Strategy {
14
15 /**
16 * Register a string for translation.
17 *
18 * @param string $string_to_register The string to translate.
19 * @param string $context The context of the string.
20 * @param bool $multiline Not used!.
21 */
22 public function register_string( $string_to_register, $context, $multiline = false ) {
23 /**
24 * @see https://wpml.org/wpml-hook/wpml_register_single_string/
25 *
26 * @param string $context The context of the string.
27 * @param string $string_to_register The string to translate.
28 *
29 * @since 1.8.0
30 */
31 do_action( 'wpml_register_single_string', 'Merchant', $context, $string_to_register );
32 }
33
34 /**
35 * Translate a string.
36 *
37 * @param string $string_to_translate The string to translate.
38 *
39 * @return string
40 */
41 public function translate_string( $string_to_translate ) {
42 /**
43 * @see https://wpml.org/wpml-hook/wpml_translate_single_string/
44 *
45 * @param string $string_to_translate The string to translate.
46 *
47 * @since 1.8.0
48 */
49 return apply_filters( 'wpml_translate_single_string', $string_to_translate, 'Merchant', $string_to_translate );
50 }
51
52 /**
53 * Get Current language code
54 *
55 * @return string
56 */
57 public function get_current_lang() {
58 /**
59 * @see https://wpml.org/wpml-hook/wpml_current_language/
60 *
61 * @since 1.9.0
62 */
63 return apply_filters( 'wpml_current_language', null );
64 }
65 }
66 }