@param string $bundle
@param string $key
@param string $language
@param string $message

@return mixed
496441
public function putMessage($bundle, $key, $language, $message)
    {
        return $this->callService(
            self::SVC_PUT_MESSAGE,
            array(
                'bundle'     => $bundle,
                'key'        => $key,
                'language'   => $language,
                'message'    => $message,
            )
        );
    }
1061381
protected function generateForm($bundle, $entity, $metadata): void
    {
        try {
            $this->getFormGenerator($bundle)->generate($bundle, $entity, $metadata[0]);
        } catch (RuntimeException $e ) {
            // form already exists
        }
    }
1115361
public function deleteTranslation($key, $language = null) {
		if($language === null) {
			$languages = $this->getLanguageList();
		}
		else {
			$languages = array($language);
		}
		foreach ($languages as $language) {
			$messageFile = $this->getMessageFile($language);
			$messageFile->deleteMessage($key);
			$messageFile->save();
			
			unset($this->messages[$language][$key]);
		}
	}
399727
public function translate($category, $message, $params, $language)
    {
        if (stripos($message, '{lang:') !== false) {
            $message = $this->removeLegacyLangTags($message);
        }

        return parent::translate($category, $message, $params, $language);
    }
1067055
public static String qualify (String bundle, String key)
    {
        // sanity check
        if (bundle.indexOf(QUAL_PREFIX) != -1 ||
            bundle.indexOf(QUAL_SEP) != -1) {
            String errmsg = "Message bundle may not contain '" + QUAL_PREFIX +
                "' or '" + QUAL_SEP + "' [bundle=" + bundle +
                ", key=" + key + "]";
            throw new IllegalArgumentException(errmsg);
        }
        return QUAL_PREFIX + bundle + QUAL_SEP + key;
    }
996631
public function putMessage($bundle, $key, $language, $message, $projectId = null)
    {
        $projectId = $projectId ?: $this->project_id;

        return $this->callService($this->url_plan['put_message'], array(
                'project_id' => $projectId,
                'bundle'     => $bundle,
                'key'        => $key,
                'language'   => $language,
                'message'    => $message,
            )
        );
    }
409355
public function translateMessage(string $locale, string $namespace, string $message, array $args = []): string
    {
        $translation = $this->getStorage()->get($locale, $namespace, $message);
        if ($translation !== null) {
            $message = $translation[BundleStorageInterface::INDEX_PAIR_VALUE];
            $locale  = $translation[BundleStorageInterface::INDEX_PAIR_LOCALE];
        }

        return static::formatMessage($locale, $message, $args);
    }
936181
public function getMessages($bundle, $key, $projectId = null)
    {
        $url = str_replace(
            array(':projectId',                     ':bundle', ':key' ),
            array($projectId ?: $this->project_id,   $bundle,   urlencode($key)),
            $this->url_plan['get_messages']);

        return $this->callService($url);
    }
137548
public function getSpecialTid($language, $key)
    {
        $languageSpecialTids = $this->getSpecialTidsForLanguage($language);

        if (!empty($languageSpecialTids[$key])) {
            return $languageSpecialTids[$key];
        }

        return null;
    }
238441
public function updateMessageIfNewest($bundle, $key, $language, $message, \DateTime $lastModification)
    {
        return $this->callService(
            self::SVC_UPDATE_MESSAGE_IF_NEWEST,
            array(
                'bundle'            => $bundle,
                'key'               => $key,
                'language'          => $language,
                'message'           => $message,
                'last_modification' => $lastModification->format('c'),

            )
        );
    }
646572
public function resolveDomain(string $bundle): string
    {
        $bundle = strtolower(str_replace(['/', '\\'], '-', $bundle));

        foreach ($this->config['domains'] as $domain => $patterns) {
            foreach ($patterns as $pattern) {
                if ($this->matcher->matches($bundle, $pattern)) {
                    return $domain;
                }
            }
        }

        //We can use bundle itself as domain
        return $bundle;
    }
707491
public function tl($key, array $args = [], $lang = null)
    {
        return $this->translate($key, $args, $lang);
    }
1111662
protected String xlate (String bundle, String message)
    {
        if (bundle != null && _ctx.getMessageManager() != null) {
            MessageBundle msgb = _ctx.getMessageManager().getBundle(bundle);
            if (msgb == null) {
                log.warning("No message bundle available to translate message", "bundle", bundle,
                            "message", message);
            } else {
                message = msgb.xlate(message);
            }
        }
        return message;
    }
363711
private static String localize(Logger logger, String message) {
        ResourceBundle bundle = logger.getResourceBundle();
        try {
            return bundle != null ? bundle.getString(message) : message;
        } catch (MissingResourceException ex) {
            //string not in the bundle
            return message;
        }
    }
873598
public static function loadBundle(&$bundle)
    {
        if (sizeof($bundle->content) == 0) {
            return;
        }
        
        // check for cached, preloaded bundle
        $bundleCache = Cache::getInstance('MEMCACHE', 'APC', 'FILE_ENCODED');
        $bundleCachePath = "xqbundle/{$bundle->bundleId}";
        
        if (!DEBUG && ($bundleCache->available() && $bundleCache->hasCached($bundleCachePath))) {
            $bundle = $bundleCache->getCached($bundleCachePath);
            return;
        }
        
        // preload
        $bundle->lastModified = null;
        $bundle->files = array();
        
        $fileNames = array();
        foreach ($bundle->content as $file) {
            $preloaded = self::getBundleFileDetails($bundle, $file);
            
            $bundle->files[] = $preloaded;
            $fileNames[] = $preloaded->path;
        }
        
        $bundle->contentType = self::getBundleContentType($bundle);
        $bundle->tag = md5($bundle->lastModified . $bundle->bundleId . implode('-', $fileNames));
        
        $bundle->output = self::getBundleContent($bundle);
        
        if (!DEBUG && $bundleCache->available()) {
            $bundleCache->cache($bundleCachePath, $bundle);
        }
    }
629450
protected function translate($key, $message)
    {
        $key = 'centaur.' . $key;

        if (Lang::has($key)) {
            $message = trans($key);
        }

        return $message;
    }
1304739
public function existsMessage($language, $category, $message)
    {
        $key = $language . '/' . $category;
        if (!isset(static::$_messages[$key])) {
            static::$_messages[$key] = $this->loadMessages($category, $language);
        }
        if (isset(static::$_messages[$key][$message]) && static::$_messages[$key][$message] !== '') return true;
        else return false;
    }