Detailed Description
Class provides language dependent substitutions for strings.
- Author
- Dodonov A.A.
Definition at line 26 of file lang_markup.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 55 of file lang_markup.php.
{
try
{
$this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
$this->Lang =
get_package(
'lang' ,
'last' , __FILE__ );
$this->Lang->get_locale();
$this->Lang->load_translations();
}
catch( Exception $e )
{
}
}
Member Function Documentation
| compile_iconv |
( |
& |
$Settings, |
|
|
|
$Data |
|
) |
| |
Function processes macro 'iconv'.
- Parameters
-
| $Settings | - Параметры компиляции. |
| $Data | - Data. |
- Returns
- HTML code.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 309 of file lang_markup.php.
{
try
{
$Code = iconv(
$this->Settings->get_setting( 'in_charset' ) ,
$this->Settings->get_setting( 'out_charset' , 'UTF-8' ) , $Data
);
return( $Code );
}
catch( Exception $e )
{
}
}
| compile_lang |
( |
& |
$Settings | ) |
|
Function processes macro 'lang'.
- Parameters
-
| $Settings | - Параметры компиляции. |
- Returns
- HTML code.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 259 of file lang_markup.php.
{
try
{
$RawSettings = $Settings->get_raw_settings();
$StringAlias = array_shift( array_keys( $RawSettings ) );
$Value = $Settings->get_setting( 'value' , 'default' );
$TransformedString = $this->Lang->get_string( $StringAlias , $Value );
if( $TransformedString == $StringAlias )
{
$DefaultTransform = $Settings->get_setting( 'default' , false );
$TransformedString =
$DefaultTransform === false ? $TransformedString : "{lang:$DefaultTransform}";
}
return( $TransformedString );
}
catch( Exception $e )
{
}
}
| compile_lang_block |
( |
& |
$Settings, |
|
|
|
$Data |
|
) |
| |
Function processes 'lang_block'.
- Parameters
-
| $Settings | - Settings. |
| $Data | - Data. |
- Returns
- Processed string.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 96 of file lang_markup.php.
{
try
{
if( $Settings->setting_exists( $this->Lang->get_locale() ) )
{
return( $Data );
}
else
{
return( '' );
}
}
catch( Exception $e )
{
}
}
| compile_lang_file |
( |
& |
$Settings | ) |
|
Function processes macro 'lang_file'.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 172 of file lang_markup.php.
{
try
{
list( $PackageName , $PackageVersion ) = $this->get_package_info( $Settings );
foreach( $PackageName as $i => $Name )
{
$Version = isset( $PackageVersion[ $i ] ) ? $PackageVersion[ $i ] : 'last';
$LangFilePath = $PackagePath.'/res/lang/'.$TopPackageName.'.'.$this->Lang->Language;
$RawData = $this->CachedMultyFS->file_get_contents( $LangFilePath , 'cleaned' );
$this->Lang->load_data( $RawData );
}
return( '' );
}
catch( Exception $e )
{
}
}
| compile_lang_file_js |
( |
& |
$Settings | ) |
|
Function processes macro 'lang_file_js'.
- Parameters
-
- Returns
- Processed string.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 220 of file lang_markup.php.
{
try
{
$PackageName = $Settings->get_setting( 'package_name' );
$PackageVersion = $Settings->get_setting( 'package_version' , 'last' );
$this->Lang->include_strings_js( $PackageName , $PackageVersion );
return( '' );
}
catch( Exception $e )
{
}
}
| compile_locale |
( |
& |
$Settings | ) |
|
Function processes macro 'locale'.
- Parameters
-
| $Str | - String to process. |
| $Changed | - true if any of the page's elements was compiled. |
- Returns
- array( $Str , $Changed ).
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 352 of file lang_markup.php.
{
try
{
return( $this->Lang->Language );
}
catch( Exception $e )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: