public static function decode($value, $onEmptyValue = '')
    {
        $languages = Yii::$app->adminLanguage->getLanguages();
    
        // if its not already unserialized, decode it
        if (!is_array($value) && !empty($value)) {
            try {
                $value = Json::decode($value);
            } catch (InvalidParamException $e) {
                $value = [];
            }
        }
    
        // if value is empty, we create an empty array
        if (empty($value)) {
            $value = [];
        }
        
        // fall back for not transformed values
        if (!is_array($value)) {
            $value = (array) $value;
        }
    
        // add all not existing languages to the array (for example a language has been added after the database item has been created)
        foreach ($languages as $lang) {
            if (!array_key_exists($lang['short_code'], $value)) {
                $value[$lang['short_code']] = $onEmptyValue;
            } elseif (empty($value[$lang['short_code']])) {
                $value[$lang['short_code']] = $onEmptyValue;
            }
        }
    
        return $value;
    }