当前位置: 首页>>代码示例>>PHP>>正文


PHP AEPlatform::translate方法代码示例

本文整理汇总了PHP中AEPlatform::translate方法的典型用法代码示例。如果您正苦于以下问题:PHP AEPlatform::translate方法的具体用法?PHP AEPlatform::translate怎么用?PHP AEPlatform::translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AEPlatform的用法示例。


在下文中一共展示了AEPlatform::translate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deadOnTimeOut

/**
 * Timeout error handler
 */
function deadOnTimeOut()
{
	if( connection_status() == 1 ) {
		AEUtilLogger::WriteLog(_AE_LOG_ERROR, 'The process was aborted on user\'s request');
	}
	if( connection_status() >= 2 ) {
		AEUtilLogger::WriteLog(_AE_LOG_ERROR, AEPlatform::translate('KETTENRAD_TIMEOUT') );
	}
}
开发者ID:rkern21,项目名称:videoeditor,代码行数:12,代码来源:kettenrad.php

示例2: getJsonGuiDefinition

	/**
	 * Returns the JSON representation of the GUI definition and the associated values
	 * @return string
	 */
	public static function getJsonGuiDefinition()
	{
		// Initialize the array which will be converted to JSON representation
		$json_array = array(
			'engines' => array(),
			'installers' => array(),
			'gui' => array()
		);

		// Get a reference to the configuration
		$configuration =& AEFactory::getConfiguration();

		// Get data for all engines
		$engine_types = array('archiver','dump','scan','writer','proc');
		foreach($engine_types as $type)
		{
			$engines = self::getEnginesList($type);
			foreach($engines as $engine_name => $engine_data)
			{
				// Translate information
				foreach($engine_data['information'] as $key => $value)
				{
					switch($key)
					{
						case 'title':
						case 'description':
							$value = AEPlatform::translate($value);
							break;
					}
					$json_array['engines'][$type][$engine_name]['information'][$key] = $value;
				}
				// Process parameters
				$parameters = array();
				foreach($engine_data['parameters'] as $param_key => $param)
				{
					$param['default'] = $configuration->get( $param_key, $param['default'], false );
					foreach($param as $option_key => $option_value )
					{
						// Translate title, description, enumkeys
						switch($option_key)
						{
							case 'title':
							case 'description':
							case 'labelempty':
							case 'labelnotempty':
								$param[$option_key] = AEPlatform::translate($option_value);
								break;

							case 'enumkeys':
								$enumkeys = explode('|', $option_value);
								$new_keys = array();
								foreach($enumkeys as $old_key)
								{
									$new_keys[] = AEPlatform::translate($old_key);
								}
								$param[$option_key] = implode('|', $new_keys);
								break;

							default:

						}
					}
					$parameters[$param_key] = $param;
				}
				// Add processed parameters
				$json_array['engines'][$type][$engine_name]['parameters'] = $parameters;
			}
		}

		// Get data for GUI elements
		$json_array['gui'] = array();
		$groupdefs = self::getGUIGroups();
		foreach($groupdefs as $group_ini => $definition)
		{
			$group_name = AEPlatform::translate($definition['information']['description']);
			if( empty($group_name) ) continue; // Skip no-name groups
			$parameters = array();
			foreach($definition['parameters'] as $param_key => $param)
			{
					$param['default'] = $configuration->get( $param_key, $param['default'], FALSE );
					foreach($param as $option_key => $option_value )
					{
						// Translate title, description, enumkeys
						switch($option_key)
						{
							case 'title':
							case 'description':
								$param[$option_key] = AEPlatform::translate($option_value);
								break;

							case 'enumkeys':
								$enumkeys = explode('|', $option_value);
								$new_keys = array();
								foreach($enumkeys as $old_key)
								{
									$new_keys[] = AEPlatform::translate($old_key);
//.........这里部分代码省略.........
开发者ID:rkern21,项目名称:videoeditor,代码行数:101,代码来源:inihelper.php

示例3: getQuirk

	/**
	 * Gets a "quirk" status and adds it to the list if it is active
	 *
	 * @param array $quirks The quirks array
	 * @param string $code The Quirks code, without the Q
	 * @param string $severity Severity: 'low','medium','high'
	 */
	private static function getQuirk( &$quirks, $code, $severity )
	{
		$methodName = 'q'.$code;
		if(self::$methodName())
		{
			$description = AEPlatform::translate('Q'.$code);
			$quirks[] = array(
				'code'			=> $code,
				'severity'		=> $severity,
				'description'	=> $description,
				'help_url'		=> 'http://www.akeebabackup.com/help-support-documentation/warnings/q'.$code.'.html'
				);
		}
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:21,代码来源:quirks.php

示例4: mail_administrators

	/**
	 * Sends an email to the administrators
	 * @return bool
	 */
	private function mail_administrators()
	{
		$this->setStep('Processing emails to administrators');
		$this->setSubstep('');
		// Skip email for back-end backups
		if(AEPlatform::get_backup_origin() == 'backend' ) return true;

		$must_email = AEPlatform::get_platform_configuration_option('frontend_email_on_finish', 0) != 0;
		if(!$must_email) return true;

		AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Preparing to send e-mail to administrators");

		$email = AEPlatform::get_platform_configuration_option('frontend_email_address', '');
		$email = trim($email);
		if( !empty($email) )
		{
			$emails = array($email);
		}
		else
		{
			$emails = AEPlatform::get_administrator_emails();
		}

		if(!empty($emails))
		{
			// Fetch user's preferences
			$subject = trim(AEPlatform::get_platform_configuration_option('frontend_email_subject',''));
			$body = trim(AEPlatform::get_platform_configuration_option('frontend_email_body',''));

			// Get the statistics
			$statistics =& AEFactory::getStatistics();
			$stat = $statistics->getRecord();
			$parts = AEUtilStatistics::get_all_filenames($stat, false);

			$profile_number = AEPlatform::get_active_profile();
			$profile_name = AEPlatform::get_profile_name($profile_number);
			$parts = AEUtilStatistics::get_all_filenames($stat, false);
			$stat = (object)$stat;
			$num_parts = $stat->multipart;
			if($num_parts == 0) $num_parts = 1; // Non-split archives have a part count of 0
			$parts_list = '';
			if(!empty($parts)) foreach($parts as $file) {
				$parts_list .= "\t".basename($file)."\n";
			}

			// Do we need a default subject?
			if(empty($subject)) {
				// Get the default subject
				$subject = AEPlatform::translate('EMAIL_SUBJECT_OK');
			} else {
				// Post-process the subject
				$subject = AEUtilFilesystem::replace_archive_name_variables($subject);
			}

			// Do we need a default body?
			if(empty($body)) {
				$body = AEPlatform::translate('EMAIL_BODY_OK');
				$info_source = AEPlatform::translate('EMAIL_BODY_INFO');
				$body .= "\n\n" . sprintf($info_source, $profile_number, $num_parts) . "\n\n";
				$body .= $parts_list;
			} else {
				// Post-process the body
				$body = AEUtilFilesystem::replace_archive_name_variables($body);
				$body = str_replace('[PROFILENUMBER]', $profile_number, $body);
				$body = str_replace('[PROFILENAME]', $profile_name, $body);
				$body = str_replace('[PARTCOUNT]', $num_parts, $body);
				$body = str_replace('[FILELIST]', $parts_list, $body);
			}
			// Sometimes $body contains literal \n instead of newlines
			$body = str_replace('\\n',"\n", $body);

			foreach($emails as $email)
			{
				AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Sending email to $email");
				AEPlatform::send_email($email, $subject, $body);
			}
		}

		return true;
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:84,代码来源:finalization.php


注:本文中的AEPlatform::translate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。