REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.09 KB
Close
/home/nshryvcy/blissfulnepal.com/wp-content/plugins/wp-rollback/src/PluginSetup/Language.php
Text
Base64
<?php /** * Language setup. * * This class is used to manage the application language. * * @package WpRollback\PluginSetup */ declare(strict_types=1); namespace WpRollback\Free\PluginSetup; use WpRollback\Free\Core\Constants; use WpRollback\SharedCore\Core\SharedCore; /** * Class Language. * */ class Language { /** */ public static function load(): void { $constants = SharedCore::container()->make(Constants::class); $pluginRelativePath = self::getRelativePath($constants); $locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale(); // Traditional WordPress plugin locale filter. $locale = apply_filters('plugin_locale', $locale, $constants->getTextDomain()); // Setup paths to current locale file. $moFile = sprintf('%1$s-%2$s.mo', $constants->getTextDomain(), $locale); $moFileLocal = trailingslashit(WP_PLUGIN_DIR) . $pluginRelativePath . $moFile; $moFileGlobal = trailingslashit(WP_LANG_DIR) . 'plugins/' . $moFile; unload_textdomain($constants->getTextDomain()); if (file_exists($moFileGlobal)) { // Look in global /wp-content/languages/plugins folder. load_textdomain($constants->getTextDomain(), $moFileGlobal); } elseif (file_exists($moFileLocal)) { // Look in local /wp-content/plugins/wp-rollback/languages/ folder. load_textdomain($constants->getTextDomain(), $moFileLocal); } else { // Load the default language files. load_plugin_textdomain($constants->getTextDomain(), false, $pluginRelativePath); } } /** * Return the plugin language dir relative path, e.g. "wp-rollback/languages/" * */ public static function getRelativePath(Constants $constants): string { $pluginRelativePath = dirname(plugin_basename($constants->getPluginFile())) . '/languages/'; $pluginRelativePath = ltrim(apply_filters('wprollback_languages_directory', $pluginRelativePath), '/\\'); return trailingslashit($pluginRelativePath); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Language.php
2.09 KB
lrw-r--r--
2026-05-06 14:06:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PluginMeta.php
2.38 KB
lrw-r--r--
2026-05-06 14:06:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PluginScripts.php
4.52 KB
lrw-r--r--
2026-05-06 14:06:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PluginSetup.php
4.60 KB
lrw-r--r--
2026-05-06 14:06:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).