<?php
class lang {

    private static $translations = [];
    private static $initialized = false;

    // Initialize the translations
    public static function init(array $translations) {
        if (!self::$initialized) {
            self::$translations = $translations;
            self::$initialized = true;
        }
    }

    public static function get($key) {
        $returnText = isset(self::$translations[$key]) ? self::$translations[$key] : null;
        if ($returnText) {
            return $returnText;
        } else {
            return $key;
        }
    }
}