403Webshell
Server IP : 103.161.17.216  /  Your IP : 216.73.216.1
Web Server : nginx/1.18.0
System : Linux tipsysaigoncharming 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/app.houseland.info/application/services/utilities/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/app.houseland.info/application/services/utilities/Locale.php
<?php

namespace app\services\utilities;

defined('BASEPATH') or exit('No direct script access allowed');

class Locale
{
    public static function getByLanguage($language = 'english')
    {
        $locale = 'en';
        if ($language == '') {
            return $locale;
        }

        $locales = get_locales();

        if (isset($locales[$language])) {
            $locale = $locales[$language];
        } elseif (isset($locales[ucfirst($language)])) {
            $locale = $locales[ucfirst($language)];
        } else {
            foreach ($locales as $key => $val) {
                $key      = strtolower($key);
                $language = strtolower($language);
                if (strpos($key, $language) !== false) {
                    $locale = $val;
                // In case $language is bigger string then $key
                } elseif (strpos($language, $key) !== false) {
                    $locale = $val;
                }
            }
        }

        return $locale;
    }

    public static function getElFinderLangKey($locale)
    {
        if ($locale == 'ja') {
            $locale = 'jp';
        } elseif ($locale == 'pt') {
            $locale = 'pt_BR';
        } elseif ($locale == 'ug') {
            $locale = 'ug_CN';
        } elseif ($locale == 'zh') {
            $locale = 'zh_TW';
        }

        return $locale;
    }

    public static function getTinyMceLangKey($locale, $availableLanguages)
    {
        $lang = '';

        if ($locale == 'en') {
            return $lang;
        }
        
        if ($locale == 'he') {
            return 'he_IL';
        } if ($locale == 'pt') {
            return 'pt_BR';
        } elseif ($locale == 'sv') {
            return 'sv_SE';
        } elseif ($locale == 'sl') {
            return 'sl_SI';
        } elseif ($locale == 'zh') {
            return 'zh_HK';
        } elseif ($locale == 'nb') {
            return 'nb_NO';
        }

        foreach ($availableLanguages as $lang) {
            $_temp_lang = explode('.', $lang);
            if ($locale == $_temp_lang[0]) {
                return $locale;
            } elseif ($locale . '_' . strtoupper($locale) == $_temp_lang[0]) {
                return $locale . '_' . strtoupper($locale);
            }
        }

        return $lang;
    }

    public static function app()
    {
        return [
        'Estonian'    => 'et',
        'Arabic'      => 'ar',
        'Bulgarian'   => 'bg',
        'Catalan'     => 'ca',
        'Czech'       => 'cs',
        'Danish'      => 'da',
        'Albanian'    => 'sq',
        'German'      => 'de',
        'Deutsch'     => 'de',
        'Dutch'       => 'nl',
        'Greek'       => 'el',
        'English'     => 'en',
        'Finland'     => 'fi',
        'Spanish'     => 'es',
        'Persian'     => 'fa',
        'Finnish'     => 'fi',
        'French'      => 'fr',
        'Hebrew'      => 'he',
        'Hindi'       => 'hi',
        'Indonesian'  => 'id',
        'Hindi'       => 'hi',
        'Croatian'    => 'hr',
        'Hungarian'   => 'hu',
        'Icelandic'   => 'is',
        'Italian'     => 'it',
        'Japanese'    => 'ja',
        'Korean'      => 'ko',
        'Lithuanian'  => 'lt',
        'Latvian'     => 'lv',
        'Norwegian'   => 'nb',
        'Netherlands' => 'nl',
        'Polish'      => 'pl',
        'Portuguese'  => 'pt',
        'Romanian'    => 'ro',
        'Russian'     => 'ru',
        'Slovak'      => 'sk',
        'Slovenian'   => 'sl',
        'Serbian'     => 'sr',
        'Swedish'     => 'sv',
        'Thai'        => 'th',
        'Turkish'     => 'tr',
        'Ukrainian'   => 'uk',
        'Vietnamese'  => 'vi',
        'Chinese'     => 'zh',
    ];
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit