Location: PHPKode > projects > Moc10 PHP Library > docs/api-docs/Moc10_Language/Moc10_Language.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html>
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Moc10_Language</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Moc10_Language</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Moc10_Language</p>
	<ul class="tags">
				<li><span class="field">author:</span> Nick Sagona, III &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
				<li><span class="field">version:</span> 1.9.7</li>
				<li><span class="field">copyright:</span> Copyright (c) 2009-2011 Moc 10 Media, LLC. (http://www.moc10media.com)</li>
				<li><span class="field">license:</span> <a href="http://www.moc10phplibrary.com/LICENSE.TXT">New BSD License</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Language.php.html">/Language.php</a> (line <span class="field">33</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_content" title="details" class="var-name">$_content</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_language" title="details" class="var-name">$_language</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																						
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$lng</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#generateLanguageFile" title="details" class="method-name">generateLanguageFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$lang</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$api</span>, [<span class="var-type">string|boolean</span>&nbsp;<span class="var-name">$dest</span> = <span class="var-default">false</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$src</span> = <span class="var-default">'en'</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tmpl</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getLanguage" title="details" class="method-name">getLanguage</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getLanguages" title="details" class="method-name">getLanguages</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$dir</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#loadFile" title="details" class="method-name">loadFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$langFile</span>)
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_e" title="details" class="method-name">_e</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_loadCurrentLanguage" title="details" class="method-name">_loadCurrentLanguage</a>
										()
									</div>
														
				<div class="method-definition">
											<span class="method-result">$str</span>
										<a href="#_translate" title="details" class="method-name">_translate</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">$str</span>
										<a href="#__" title="details" class="method-name">__</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>])
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$_content" id="$_content"><!-- --></a>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_content</span>
			 = <span class="var-default">array('source' =&gt; array(),'output'=&gt;array())</span>			(line <span class="line-number">46</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Language content</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$_language" id="$_language"><!-- --></a>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_language</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">40</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Default system language</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<a name='method_detail'></a>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">56</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
<p class="description">Instantiate the language object.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__construct
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$lng</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$lng</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgenerateLanguageFile" id="generateLanguageFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">generateLanguageFile</span> (line <span class="line-number">172</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Process and translate an new XML language document from the  template file via Google Translate using a provided API key.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			generateLanguageFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$lang</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$api</span>, [<span class="var-type">string|boolean</span>&nbsp;<span class="var-name">$dest</span> = <span class="var-default">false</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$src</span> = <span class="var-default">'en'</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tmpl</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$lang</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$api</span>			</li>
					<li>
				<span class="var-type">string|boolean</span>
				<span class="var-name">$dest</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$src</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tmpl</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetLanguage" id="getLanguage"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getLanguage</span> (line <span class="line-number">69</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get current language setting.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getLanguage
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetLanguages" id="getLanguages"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getLanguages</span> (line <span class="line-number">136</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get languages from the XML files.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getLanguages
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$dir</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$dir</span>			</li>
				</ul>
		
			
	</div>
<a name="methodloadFile" id="loadFile"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">loadFile</span> (line <span class="line-number">82</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Load language content from an XML file.</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			loadFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$langFile</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$langFile</span>			</li>
				</ul>
		
			
	</div>
<a name="method_e" id="_e"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_e</span> (line <span class="line-number">123</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Echo the translated string.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_e
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$params</span>			</li>
				</ul>
		
			
	</div>
<a name="method_loadCurrentLanguage" id="_loadCurrentLanguage"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_loadCurrentLanguage</span> (line <span class="line-number">389</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get language content from the XML file.</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_loadCurrentLanguage
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_translate" id="_translate"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_translate</span> (line <span class="line-number">364</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Translate and return the string.</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">$str</span>
		<span class="method-name">
			_translate
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$params</span>			</li>
				</ul>
		
			
	</div>
<a name="method__" id="__"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">__</span> (line <span class="line-number">109</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return the translated string</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">$str</span>
		<span class="method-name">
			__
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$params</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Wed, 12 Jan 2011 01:17:44 -0600 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>
Return current item: Moc10 PHP Library