-
Notifications
You must be signed in to change notification settings - Fork 147
/
qtranslate_compatibility.php
69 lines (66 loc) · 2.45 KB
/
qtranslate_compatibility.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
if ( !defined( 'ABSPATH' ) ) exit;
if(!defined('QTRANS_INIT')){
define('QTRANS_INIT',true);
}
if(!function_exists('qtrans_convertURL')){
function qtrans_convertURL($url='', $lang='', $forceadmin = false, $showDefaultLanguage = false){
return qtranxf_convertURL($url, $lang, $forceadmin, $showDefaultLanguage);
}
}
if(!function_exists('qtrans_generateLanguageSelectCode')){
function qtrans_generateLanguageSelectCode($style='', $id=''){ return qtranxf_generateLanguageSelectCode($style,$id); }
}
/**
Some 3rd-party plugins (for example "Google XML Sitemaps v3 for qTranslate") use this function and expect an array in return.
*/
if(!function_exists('qtrans_getAvailableLanguages')){
function qtrans_getAvailableLanguages($text){
$langs = qtranxf_getAvailableLanguages($text);
if(is_array($langs)) return $langs;
if(empty($text)) return array();
global $q_config;
return array($q_config['default_language']);
}
}
if(!function_exists('qtrans_getLanguage')){
function qtrans_getLanguage(){ return qtranxf_getLanguage(); }
}
if(!function_exists('qtrans_getLanguageName')){
function qtrans_getLanguageName($lang = ''){ return qtranxf_getLanguageNameNative($lang); }
}
if(!function_exists('qtrans_getSortedLanguages')){
function qtrans_getSortedLanguages($reverse = false){ return qtranxf_getSortedLanguages($reverse); }
}
if(!function_exists('qtrans_join')){
function qtrans_join($texts) {
if(!is_array($texts)) $texts = qtranxf_split($texts);
return qtranxf_join_b($texts);
}
}
if(!function_exists('qtrans_split')){
function qtrans_split($text, $quicktags = true){ return qtranxf_split($text); }
}
if(!function_exists('qtrans_use')){
function qtrans_use($lang, $text, $show_available=false){
return qtranxf_use($lang, $text, $show_available);
}
}
if (!function_exists('qtrans_useCurrentLanguageIfNotFoundShowAvailable')){
function qtrans_useCurrentLanguageIfNotFoundShowAvailable($content){
return qtranxf_useCurrentLanguageIfNotFoundShowAvailable($content);
}
}
if (!function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')){
function qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($content){
return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($content);
}
}
if (!function_exists('qtrans_useDefaultLanguage')){
function qtrans_useDefaultLanguage($content){
return qtranxf_useDefaultLanguage($content);
}
}
if(!function_exists('qtrans_useTermLib')){
function qtrans_useTermLib($obj){ return qtranxf_useTermLib($obj); }
}