2024.8.23
Loading...
Searching...
No Matches
class.action.switchLang.php
Go to the documentation of this file.
1<?php
2/*
3 * Copyright (c) 2021-2024 Bearsampp
4 * License: GNU General Public License version 3 or later; see LICENSE.txt
5 * Author: Bear
6 * Website: https://bearsampp.com
7 * Github: https://github.com/Bearsampp
8 */
9
10/**
11 * Class ActionSwitchLang
12 *
13 * This class handles the action of switching the language configuration for the Bearsampp application.
14 */
16{
17 /**
18 * ActionSwitchLang constructor.
19 *
20 * @param array $args An array of arguments where the first element is expected to be the new language code.
21 */
22 public function __construct($args)
23 {
24 global $bearsamppConfig;
25
26 // Check if the first argument is set and not empty, then replace the language configuration.
27 if (isset($args[0]) && !empty($args[0])) {
28 $bearsamppConfig->replace(Config::CFG_LANG, $args[0]);
29 }
30 }
31}
const CFG_LANG
global $bearsamppConfig
Definition homepage.php:26