salix/db/routines/util/functions/lang.sql

15 lines
320 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`lang`()
RETURNS char(2) CHARSET utf8mb3 COLLATE utf8mb3_general_ci
DETERMINISTIC
NO SQL
BEGIN
/**
* Returns the current language code.
*
* @return The language code
*/
RETURN IFNULL(@lang, SUBSTR(@@lc_messages, 1, 2));
END$$
DELIMITER ;