QVCI Library 3.2
 All Classes Namespaces Functions
Public Member Functions | List of all members
Qvc_lang Class Reference

Public Member Functions

 change_label ($label, $new_label, $lang='', $package='')
 
 clear_cache ()
 
 get_default_string ($label, $lang='', &$package='')
 
 get_default_strings_matching ($label_regex, $lang='')
 
 load_default_strings ($lang='')
 
 save_default_strings ($lang='')
 
 set_default_string ($label, $string, $lang='', $package='application')
 
 set_lang ($lang='')
 
 treat_strings ($state=true)
 
 tt ($label, $args=[])
 
 tt_set ($arg1, $arg2='', $arg3='')
 

Detailed Description

Provides multilingual support.

Member Function Documentation

Qvc_lang::change_label (   $label,
  $new_label,
  $lang = '',
  $package = '' 
)

Change (rename) a label.

Parameters
string$label
string$new_label
string$lang
string | array$packageIf empty then all packages.
Qvc_lang::clear_cache ( )

Clear the translation cache

Qvc_lang::get_default_string (   $label,
  $lang = '',
$package = '' 
)

Get the default string from the language-specific text file, if defined.

Parameters
string$label
string$lang
string$package(output) The package which provided the default string
Returns
string
Qvc_lang::get_default_strings_matching (   $label_regex,
  $lang = '' 
)

Get the default strings that match the given label, which is a regex pattern.

Parameters
string$label_regexA regular expression, with enclosing delimiters
string$lang
Returns
array
Qvc_lang::load_default_strings (   $lang = '')

Load the full set of default strings for a given language. Also initializes the search order for resolving default strings.

Parameters
string$lang
Qvc_lang::save_default_strings (   $lang = '')

Save the full set of default strings to disk.

Parameters
string$lang
Qvc_lang::set_default_string (   $label,
  $string,
  $lang = '',
  $package = 'application' 
)

Set the value of a default string.

Parameters
string$label
string$string
string$lang
string$package
Qvc_lang::set_lang (   $lang = '')

Set the current translation language.

Parameters
string$langTwo-letter language code
Qvc_lang::treat_strings (   $state = true)

Set the flag as to whether to treat strings as they are cached.

Parameters
string$state
Qvc_lang::tt (   $label,
  $args = [] 
)

Translate text, given a label and a list of substitutions

Parameters
string$label
array$args
Returns
string
Qvc_lang::tt_set (   $arg1,
  $arg2 = '',
  $arg3 = '' 
)

Set translation text for a given label or set of labels. 2016-11-25 This function is not actually used anywhere, but it may be useful one day.

Parameters
string | array$arg1Label or array of label => string
string$arg2Translation string or lang code when $arg1 is array
string$arg3Lang code

The documentation for this class was generated from the following file: