src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php
public function validateInstance() {
		$instanceName = MoufManager::getMoufManager()->findInstanceName($this);
			
		if (!file_exists(ROOT_PATH.$this->i18nMessagePath."message.php")) {
			return new MoufValidatorResult(MoufValidatorResult::ERROR, "<b>Fine: </b>Unable to find default translation file for instance: <code>".ROOT_PATH.$this->i18nMessagePath."message.php</code>.<br/>"
															."You should create the following files:<br/>"
															.$this->i18nMessagePath."message.php <a href='".ROOT_URL."vendor/mouf/mouf/editLabels/createMessageFile?name=".$instanceName."&selfedit=false&language=default'>(create this file)</a>");
		}
		else {
			$this->loadAllMessages();
			
			// The array of messages by message, then by language:
			// array(message_key => array(language => message))
			$keys = $this->getAllKeys();
			foreach ($keys as $key) {
				$msgs = $this->getMessageForAllLanguages($key);
				if (!isset($msgs['default'])) {
					$missingDefaultKeys[$instanceName][] = $key;
				}
			}
			if (empty($missingDefaultKeys)) {
				return new MoufValidatorResult(MoufValidatorResult::SUCCESS, "<b>Fine: </b>Default translation file found in instance <code>$instanceName</code>.<br />
																				Default translation is available for all messages.");
			} else {
				$html = "";
				foreach ($missingDefaultKeys as $instanceName=>$missingKeys) {
					$html .= "<b>Fine: </b>A default translation in '".$instanceName."' is missing for these messages: ";
					foreach ($missingKeys as $missingDefaultKey) {
						$html .= "<a href='".ROOT_URL."vendor/mouf/mouf/editLabels/editLabel?key=".urlencode($missingDefaultKey)."&language=default&backto=".urlencode(ROOT_URL)."mouf/&msginstancename=".urlencode($instanceName)."'>".$missingDefaultKey."</a> ";
					}
					$html .= "<hr/>";
				}
				return new MoufValidatorResult(MoufValidatorResult::WARN, $html);
			}
			
		}
	}
public function validateInstance() {
		$instanceName = MoufManager::getMoufManager()->findInstanceName($this);
			
		if (!file_exists(ROOT_PATH.$this->i18nMessagePath."message.php")) {
			return new MoufValidatorResult(MoufValidatorResult::ERROR, "<b>Fine: </b>Unable to find default translation file for instance: <code>".ROOT_PATH.$this->i18nMessagePath."message.php</code>.<br/>"
															."You should create the following files:<br/>"
															.$this->i18nMessagePath."message.php <a href='".ROOT_URL."vendor/mouf/mouf/editLabels/createMessageFile?name=".$instanceName."&selfedit=false&language=default'>(create this file)</a>");
		}
		else {
			$this->loadAllMessages();
			
			// The array of messages by message, then by language:
			// array(message_key => array(language => message))
			$keys = $this->getAllKeys();
			foreach ($keys as $key) {
				$msgs = $this->getMessageForAllLanguages($key);
				if (!isset($msgs['default'])) {
					$missingDefaultKeys[$instanceName][] = $key;
				}
			}
			if (empty($missingDefaultKeys)) {
				return new MoufValidatorResult(MoufValidatorResult::SUCCESS, "<b>Fine: </b>Default translation file found in instance <code>$instanceName</code>.<br />
																				Default translation is available for all messages.");
			} else {
				$html = "";
				foreach ($missingDefaultKeys as $instanceName=>$missingKeys) {
					$html .= "<b>Fine: </b>A default translation in '".$instanceName."' is missing for these messages: ";
					foreach ($missingKeys as $missingDefaultKey) {
						$html .= "<a href='".ROOT_URL."vendor/mouf/mouf/editLabels/editLabel?key=".urlencode($missingDefaultKey)."&language=default&backto=".urlencode(ROOT_URL)."mouf/&msginstancename=".urlencode($instanceName)."'>".$missingDefaultKey."</a> ";
					}
					$html .= "<hr/>";
				}
				return new MoufValidatorResult(MoufValidatorResult::WARN, $html);
			}
			
		}
	}
public function validateInstance ( ) { $ instanceName = MoufManager :: getMoufManager ( ) -> findInstanceName ( $ this ) ; if ( ! file_exists ( ROOT_PATH . $ this -> i18nMessagePath . "message.php" ) ) { return new MoufValidatorResult ( MoufValidatorResult :: ERROR , "<b>Fine: </b>Unable to find default translation file for instance: <code>" . ROOT_PATH . $ this -> i18nMessagePath . "message.php</code>.<br/>" . "You should create the following files:<br/>" . $ this -> i18nMessagePath . "message.php <a href='" . ROOT_URL . "vendor/mouf/mouf/editLabels/createMessageFile?name=" . $ instanceName . "&selfedit=false&language=default'>(create this file)</a>" ) ; } else { $ this -> loadAllMessages ( ) ; // The array of messages by message, then by language:
 // array(message_key => array(language => message))
 $ keys = $ this -> getAllKeys ( ) ; foreach ( $ keys as $ key ) { $ msgs = $ this -> getMessageForAllLanguages ( $ key ) ; if ( ! isset ( $ msgs [ 'default' ] ) ) { $ missingDefaultKeys [ $ instanceName ] [ ] = $ key ; } } if ( empty ( $ missingDefaultKeys ) ) { return new MoufValidatorResult ( MoufValidatorResult :: SUCCESS , "<b>Fine: </b>Default translation file found in instance <code>$instanceName</code>.<br />
																				Default translation is available for all messages." ) ; } else { $ html = "" ; foreach ( $ missingDefaultKeys as $ instanceName => $ missingKeys ) { $ html .= "<b>Fine: </b>A default translation in '" . $ instanceName . "' is missing for these messages: " ; foreach ( $ missingKeys as $ missingDefaultKey ) { $ html .= "<a href='" . ROOT_URL . "vendor/mouf/mouf/editLabels/editLabel?key=" . urlencode ( $ missingDefaultKey ) . "&language=default&backto=" . urlencode ( ROOT_URL ) . "mouf/&msginstancename=" . urlencode ( $ instanceName ) . "'>" . $ missingDefaultKey . "</a> " ; } $ html .= "<hr/>" ; } return new MoufValidatorResult ( MoufValidatorResult :: WARN , $ html ) ; } } }
Runs the validation of the instance.
Returns a MoufValidatorResult explaining the result.

@return MoufValidatorResult
Runs the validation of the instance . Returns a MoufValidatorResult explaining the result .