Multiple languages plugin class - qTranslate X

access public
package kocuj_sitemap

 Methods

Something to do after get author item

afterGetAuthorItem(integer $authorId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetAuthorItem()

Parameters

$authorId

integer

Author id

$locale

string

Language locale

Something to do after get authors

afterGetAuthors(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetAuthors()

Parameters

$locale

string

Language locale

Something to do after get blog name

afterGetBlogName() : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetBlogName()

Something to do after get categories

afterGetCategories(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetCategories()

Parameters

$locale

string

Language locale

Something to do after get category item

afterGetCategoryItem(integer $categoryId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetCategoryItem()

Parameters

$categoryId

integer

Category id

$locale

string

Language locale

Something to do after get custom post item

afterGetCustomPostItem(integer $customPostId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetCustomPostItem()

Parameters

$customPostId

integer

Custom post id

$locale

string

Language locale

Something to do after get custom posts

afterGetCustomPosts(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetCustomPosts()

Parameters

$locale

string

Language locale

Something to do after get home URL

afterGetHomeURL(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetHomeURL()

Parameters

$locale

string

Language locale

Something to do after get menu

afterGetMenu(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetMenu()

Parameters

$locale

string

Language locale

Something to do after get menu item

afterGetMenuItem(integer $itemId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetMenuItem()

Parameters

$itemId

integer

Menu item id

$locale

string

Language locale

Something to do after get page item

afterGetPageItem(integer $pageId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetPageItem()

Parameters

$pageId

integer

Page id

$locale

string

Language locale

Something to do after get pages

afterGetPages(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetPages()

Parameters

$locale

string

Language locale

Something to do after get post item

afterGetPostItem(integer $postId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetPostItem()

Parameters

$postId

integer

Post id

$locale

string

Language locale

Something to do after get posts

afterGetPosts(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetPosts()

Parameters

$locale

string

Language locale

Something to do after get tag item

afterGetTagItem(integer $tagId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetTagItem()

Parameters

$tagId

integer

Tag id

$locale

string

Language locale

Something to do after get tags

afterGetTags(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetTags()

Parameters

$locale

string

Language locale

Something to do after get taxonomies

afterGetTaxonomies(string $taxonomy, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetTaxonomies()

Parameters

$taxonomy

string

Taxonomy type

$locale

string

Language locale

Something to do after get taxonomy item

afterGetTaxonomyItem(integer $termId, string $taxonomy, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterGetTaxonomyItem()

Parameters

$termId

integer

Taxonomy id

$taxonomy

string

Taxonomy type

$locale

string

Language locale

Something to do after processing

afterProcess(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::afterProcess()

Parameters

$locale

string

Language locale

Something to do before get author item

beforeGetAuthorItem(integer $authorId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetAuthorItem()

Parameters

$authorId

integer

Author id

$locale

string

Language locale

Something to do before get authors

beforeGetAuthors(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetAuthors()

Parameters

$locale

string

Language locale

Something to do before get blog name

beforeGetBlogName() : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetBlogName()

Something to do before get categories

beforeGetCategories(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetCategories()

Parameters

$locale

string

Language locale

Something to do before get category item

beforeGetCategoryItem(integer $categoryId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetCategoryItem()

Parameters

$categoryId

integer

Category id

$locale

string

Language locale

Something to do before get custom post item

beforeGetCustomPostItem(integer $customPostId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetCustomPostItem()

Parameters

$customPostId

integer

Custom post id

$locale

string

Language locale

Something to do before get custom posts

beforeGetCustomPosts(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetCustomPosts()

Parameters

$locale

string

Language locale

Something to do before get home URL

beforeGetHomeURL(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetHomeURL()

Parameters

$locale

string

Language locale

Something to do before get menu

beforeGetMenu(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetMenu()

Parameters

$locale

string

Language locale

Something to do before get menu item

beforeGetMenuItem(integer $itemId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetMenuItem()

Parameters

$itemId

integer

Menu item id

$locale

string

Language locale

Something to do before get page item

beforeGetPageItem(integer $pageId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetPageItem()

Parameters

$pageId

integer

Page id

$locale

string

Language locale

Something to do before get pages

beforeGetPages(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetPages()

Parameters

$locale

string

Language locale

Something to do before get post item

beforeGetPostItem(integer $postId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetPostItem()

Parameters

$postId

integer

Post id

$locale

string

Language locale

Something to do before get posts

beforeGetPosts(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetPosts()

Parameters

$locale

string

Language locale

Something to do before get tag item

beforeGetTagItem(integer $tagId, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetTagItem()

Parameters

$tagId

integer

Tag id

$locale

string

Language locale

Something to do before get tags

beforeGetTags(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetTags()

Parameters

$locale

string

Language locale

Something to do before get taxonomies

beforeGetTaxonomies(string $taxonomy, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetTaxonomies()

Parameters

$taxonomy

string

Taxonomy type

$locale

string

Language locale

Something to do before get taxonomy item

beforeGetTaxonomyItem(integer $termId, string $taxonomy, string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeGetTaxonomyItem()

Parameters

$termId

integer

Term id

$taxonomy

string

Taxonomy type

$locale

string

Language locale

Something to do before processing

beforeProcess(string $locale) : void
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::beforeProcess()

Parameters

$locale

string

Language locale

Check if translation plugin exists; this method checks if all functions, classes, methods, properties and global variables, which are used from translation plugin, exists

checkPlugin() : boolean
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::checkPlugin()

Returns

booleanTranslation plugin exists (true) or not (false)

Filter for get terms

filterGetTerms(array $terms) : array
access public

Parameters

$terms

array

Terms

Returns

arrayModified terms

Get singleton instance

getInstance() : object
Static
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getInstance()

Returns

objectSingleton instance

Get full URL to language flag

getLanguageFlag(string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getLanguageFlag()

Parameters

$locale

string

Language locale

Returns

stringURL to language flag

Get languages list

getLanguages() : array
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getLanguages()

Returns

arrayLanguages list

Get translation plugin name; it is used in administration panel during the selection of multi-lingual plugin

getName() : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getName()

Returns

stringPlugin name

Get translation plugin filename with its directory

getPluginFile() : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getPluginFile()

Returns

stringTranslation plugin filename

Get plugin priority; it is used to sort translation plugins usage order; the lowest number is the first plugin in order, the highest number is the last plugin in order

getPriority() : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getPriority()

Returns

stringPlugin priority

Get translated author name

getTranslatedAuthorName(string $origName, integer $authorId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedAuthorName()

Parameters

$origName

string

Original author name

$authorId

integer

Author id

$locale

string

Language locale

Returns

stringTranslated author name

Get translated author URL

getTranslatedAuthorURL(string $origURL, integer $authorId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedAuthorURL()

Parameters

$origURL

string

Original author URL

$authorId

integer

Author id

$locale

string

Language locale

Returns

stringTranslated author URL

Get translated blog name with locale

getTranslatedBlogName(string $origText, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedBlogName()

Parameters

$origText

string

Original text

$locale

string

Language locale

Returns

stringTranslated text

Get translated category title

getTranslatedCategoryTitle(string $origTitle, integer $categoryId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedCategoryTitle()

Parameters

$origTitle

string

Original category title

$categoryId

integer

Category id

$locale

string

Language locale

Returns

stringTranslated category title

Get translated category URL

getTranslatedCategoryURL(string $origURL, integer $categoryId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedCategoryURL()

Parameters

$origURL

string

Original category URL

$categoryId

integer

Category id

$locale

string

Language locale

Returns

stringTranslated category URL

Get translated custom post title

getTranslatedCustomPostTitle(string $origTitle, integer $customPostId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedCustomPostTitle()

Parameters

$origTitle

string

Original custom post title

$customPostId

integer

Custom post id

$locale

string

Language locale

Returns

stringTranslated custom post title

Get translated custom post URL

getTranslatedCustomPostURL(string $origURL, integer $customPostId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedCustomPostURL()

Parameters

$origURL

string

Original custom post URL

$customPostId

integer

Custom post id

$locale

string

Language locale

Returns

stringTranslated custom post URL

Get translated home URL

getTranslatedHomeURL(string $origURL, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedHomeURL()

Parameters

$origURL

string

Original home URL

$locale

string

Language locale

Returns

stringTranslated home URL

Get translated menu title

getTranslatedMenuTitle(string $origTitle, integer $menuId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedMenuTitle()

Parameters

$origTitle

string

Original menu title

$menuId

integer

Menu id

$locale

string

Language locale

Returns

stringTranslated menu title

Get translated menu URL

getTranslatedMenuURL(string $origURL, integer $menuId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedMenuURL()

Parameters

$origURL

string

Original menu URL

$menuId

integer

Menu id

$locale

string

Language locale

Returns

stringTranslated menu URL

Get translated page title

getTranslatedPageTitle(string $origTitle, integer $pageId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedPageTitle()

Parameters

$origTitle

string

Original page title

$pageId

integer

Page id

$locale

string

Language locale

Returns

stringTranslated page title

Get translated page URL

getTranslatedPageURL(string $origURL, integer $pageId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedPageURL()

Parameters

$origURL

string

Original page URL

$pageId

integer

Page id

$locale

string

Language locale

Returns

stringTranslated page URL

Get translated post title

getTranslatedPostTitle(string $origTitle, integer $postId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedPostTitle()

Parameters

$origTitle

string

Original post title

$postId

integer

Post id

$locale

string

Language locale

Returns

stringTranslated post title

Get translated post URL

getTranslatedPostURL(string $origURL, integer $postId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedPostURL()

Parameters

$origURL

string

Original post URL

$postId

integer

Post id

$locale

string

Language locale

Returns

stringTranslated post URL

Get translated tag name

getTranslatedTagName(string $origName, integer $tagId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedTagName()

Parameters

$origName

string

Original tag name

$tagId

integer

Tag id

$locale

string

Language locale

Returns

stringTranslated tag name

Get translated tag URL

getTranslatedTagURL(string $origURL, integer $tagId, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedTagURL()

Parameters

$origURL

string

Original tag URL

$tagId

integer

Tag id

$locale

string

Language locale

Returns

stringTranslated tag URL

Get translated taxonomy title

getTranslatedTaxonomyTitle(string $origTitle, integer $termId, string $taxonomy, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedTaxonomyTitle()

Parameters

$origTitle

string

Original taxonomy title

$termId

integer

Taxonomy id

$taxonomy

string

Taxonomy type

$locale

string

Language locale

Returns

stringTranslated taxonomy title

Get translated taxonomy URL

getTranslatedTaxonomyURL(string $origURL, integer $termId, string $taxonomy, string $locale) : string
access public
inherited_from \KocujSitemapPlugin\Interfaces\Language::getTranslatedTaxonomyURL()

Parameters

$origURL

string

Original taxonomy URL

$termId

integer

Taxonomy id

$taxonomy

string

Taxonomy type

$locale

string

Language locale

Returns

stringTranslated taxonomy URL

Disable cloning of object

__clone() : void
access private

Constructor

__construct() : void
access private

Get translated data

getTranslatedData(string $origData, string $type, string $locale, string $termType = '', integer $termId = 0) : string
access private

Parameters

$origData

string

Original data

$type

string

Data type; can be "text", "url" or "term"

$locale

string

Language locale

$termType

string

Term type; used only when $type="term"; default: empty

$termId

integer

Term id; used only when $type="term"; default: empty

Returns

stringTranslated data

Get translated term

getTranslatedTerm(string $origText, string $termType, integer $termId, string $locale) : string
access private

Parameters

$origText

string

Original term name

$termType

string

Term type

$termId

integer

Term id

$locale

string

Language locale

Returns

stringTranslated term name

Get translated text

getTranslatedText(string $origText, string $locale) : string
access private

Parameters

$origText

string

Original text

$locale

string

Language locale

Returns

stringTranslated text

Get translated URL

getTranslatedURL(string $origURL, string $locale) : string
access private

Parameters

$origURL

string

Original URL

$locale

string

Language locale

Returns

stringTranslated URL

Prepare languages list if any

prepareLanguages() : void
access private

 Properties

 

Singleton instance

$instance : object

Default

NULL
Static
access private
 

Languages list

$languages : array

Default

array()
access private
 

Languages list prepared (true) or not (false)

$languagesPrepared : array

Default

false
access private
 

Locale

$locale : string

Default

''
access private

 Constants

 

Identifier for set of filters from file "admin/qtx_admin.php" in qTranslate X plugin

FILTERS_ID_ADMIN_QTX_ADMIN = 'multiple-languages-qtranslate-x-admin-qtx_admin' 
access public
 

Identifier for set of filters from file "admin/qtx_admin_class_translator.php" in qTranslate X plugin

FILTERS_ID_ADMIN_QTX_ADMIN_CLASS_TRANSLATOR = 'multiple-languages-qtranslate-x-admin-qtx_admin_class_translator' 
access public
 

Identifier for set of filters from file "admin/qtx_admin_utils.php" in qTranslate X plugin

FILTERS_ID_ADMIN_QTX_ADMIN_UTILS = 'multiple-languages-qtranslate-x-admin-qtx_admin_utils' 
access public
 

Identifier for set of filters from file "inc/qtx_class_translator.php" in qTranslate X plugin

FILTERS_ID_INC_QTX_CLASS_TRANSLATOR = 'multiple-languages-qtranslate-x-inc-qtx_class_translator' 
access public
 

Identifier for set of filters from file "qtranslate_frontend.php" in qTranslate X plugin

FILTERS_ID_QTRANSLATE_FRONTEND = 'multiple-languages-qtranslate-x-qtranslate_frontend' 
access public
 

Identifier for set of filters from file "qtranslate_hooks.php" in qTranslate X plugin

FILTERS_ID_QTRANSLATE_HOOKS = 'multiple-languages-qtranslate-x-qtranslate_hooks' 
access public
 

Identifier for set of filters from file "qtranslate_utils.php" in qTranslate X plugin

FILTERS_ID_QTRANSLATE_UTILS = 'multiple-languages-qtranslate-x-qtranslate_utils' 
access public