Smart.Framework Logo

final class \SmartTextTranslations
{ } ::

Class Smart Text Translations.
It provides a Language Based Text Translations Layer for the Smart.Framework based Applications.


class Methods

public static function getAvailableLanguages ( ) {} :: ARRAY
@return: {ARRAY} The array with available language IDs ; sample: ['en', 'ro']
Regional Text :: Get Available Languages
public static function getListOfLanguages ( ) {} :: ARRAY
@return: {ARRAY} The array with available languages List ['en' => 'English', 'ro' => 'Romanian']
Regional Text :: Get (available) Languages List
public static function isDefaultLanguage ( string $y_language = "" ) {} :: BOOLEAN
@return: {BOOLEAN} Returns TRUE if the Current Language is the Default Language for the current session / or parameter otherwise returns FALSE
@param: {STRING} $y_language: Optional, the language ID to be checked ; otherwise will check the session language ; sample (for English) will be: 'en'
Regional Text :: Checks if the Current Language is the Default Language for the current session / or parameter
public static function getDefaultLanguage ( ) {} :: STRING
@return: {STRING} The language ID ; sample (for English) will return: 'en'
Regional Text :: Get the Default Language for the current session as Set by Init
public static function getLanguage ( ) {} :: STRING
@return: {STRING} The language ID ; sample (for English) will return: 'en'
Regional Text :: Get the Current Language for the current session as Set by Config / URL / Cookie / Method-Set
public static function setLanguage ( string $y_language ) {} :: BOOLEAN
@return: {BOOLEAN} TRUE if successful, FALSE if not
@param: {STRING} $y_language: The language ID ; sample (for English) will be: 'en'
Regional Text :: Set the Language for current session
public static function validateLanguage ( string $y_language ) {} :: BOOLEAN
@return: {BOOLEAN} TRUE if language defined in configs, FALSE if not
@param: {STRING} $y_language: The language ID ; sample (for English) will be: 'en'
Validate Language
public static function getTranslator ( string $y_area, string $y_subarea, string $y_custom_language = "" ) {} :: OBJECT
@return: {OBJECT} An Instance of SmartTextTranslator->
@param: {STRING} $y_area: The Translation Area
@param: {STRING} $y_subarea: The Translation Sub-Area
@param: {STRING} $y_custom_language: *OPTIONAL* a language code ; default empty ; if empty will use the current language
Regional Text :: Get the Translator object for: area, subarea and a custom language (if enforced and not using the current language)

class Properties


class Constants


Sample code: PHP

<?php

// Usage example:
 
SmartTextTranslations::some_method_of_this_class(...);

// #end php code


documentation generated on: 2023-10-19 23:15:49 +0000


Smart.Framework © 2009-2023 unix-world.org