`

Change the language of flex application

    博客分类:
  • Flex
阅读更多
package it.creativesource
{
	import mx.resources.IResourceManager;	
	import mx.resources.ResourceBundle;		
	
	public class ResourceLanguage	{		
	public function ResourceLanguage()		{		}
	
	public static function setResources(resourceManager:IResourceManager):void{
		var myResources:ResourceBundle=new ResourceBundle("en_US","myResources");			
		myResources.content['TITLE']="Adobe Flex - English Version";			
		myResources.content['CONTENT']="Adobe Flex is a collection of technologies " + 
				"released by Adobe Systems for the development and deployment of cross " + 
				"platform rich Internet applications based on the proprietary Adobe Flash " + 
				"platform. The initial release in March 2004 by Macromedia included a software " + 
				"development kit, an IDE, and a J2EE integration application known as Flex Data " + 
				"Services. Since Adobe acquired Macromedia in 2005, subsequent releases of Flex " + 
				"no longer require a license for Flex Data Services, which has become a separate " + 
				"product rebranded as LiveCycle Data Services.";			
		myResources.content['ICON']="assets/us.png";			
		resourceManager.addResourceBundle(myResources);	
										
		myResources=new ResourceBundle("it_IT","myResources");			
		myResources.content['TITLE']="Adobe Flex - Versione Italiana";			
		myResources.content['CONTENT']="Adobe Flex è un insieme di tecnologie " + 
				"rilasciato da Adobe Systems per lo sviluppo e la diffusione del" + 
				" multi-piattaforma Rich Internet Applications basata sulla proprietà " + 
				"di Adobe Flash piattaforma. The initial release in March 2004 by Macromedia " + 
				"included a software development kit , an IDE , and a J2EE integration " + 
				"application known as Flex Data Services . La release iniziale nel marzo " + 
				"2004 da Macromedia incluso un kit di sviluppo software, un IDE, e un J2EE " + 
				"integrazione domanda noto come Flex Data Services. Since Adobe acquired " + 
				"Macromedia in 2005, subsequent releases of Flex no longer require a license " + 
				"for Flex Data Services, which has become a separate product rebranded as " + 
				"LiveCycle Data Services. Dato che Adobe ha acquisito Macromedia nel 2005, " + 
				"le successive versioni di Flex non necessitano più di una licenza per Flex Data " + 
				"Services, che è diventato un prodotto separato come rebranded LiveCycle Data Services.";
		myResources.content['ICON']="assets/it.png";			
		resourceManager.addResourceBundle(myResources);								
		resourceManager.update();					
	}	
}
}

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application    creationComplete="{init()}"    
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="vertical"    viewSourceURL="srcview/index.html">    
	<mx:Script>        
	<![CDATA[
	            
	import it.creativesource.ResourceLanguage;  
	          
	private function init():void{                               
		ResourceLanguage.setResources(resourceManager);            
	}            
	private function changeLocale(locale:String):void{                           
		resourceManager.localeChain=[locale];            
	}        
	]]>    
	</mx:Script>    
	
	<mx:ApplicationControlBar width="400">        
	<mx:Image source="{resourceManager.getString('myResources','ICON')}" width="16" height="11"/>        
	<mx:Label text="{resourceManager.getString('myResources','TITLE')}"  width="100%"/>        
	<mx:Button label="eng" click="changeLocale('en_US')" />        
	<mx:Button label="ita" click="changeLocale('it_IT')" />    
	</mx:ApplicationControlBar>       
	<mx:Text text="{resourceManager.getString('myResources','CONTENT')}"  width="400" height="240"/>
</mx:Application>

 

分享到:
评论

相关推荐

    Patterns of Enterprise Application Architecture

    Enterprise applications usually involve... Even if there is a fundamental change and the company installs a completely new application to handle a job, the data has to be migrated to the new application.

    The Art of Assembly Language Programming

    The 80x86 MOV Instruction 4.8 - Some Final Comments on the MOV Instructions &lt;br&gt;4.9 Laboratory Exercises 4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers 4.9.2 ...

    Carbonomics-The future of energy in the age of climate change.pdf

    标题和描述中提到的《Carbonomics-The future of energy in the age of climate change.pdf》文档,主要探讨了气候变化时代能源行业的未来走向,特别是通过技术革新和资本市场的压力重塑能源领域。文中强调了在发电...

    Some properties of the Logistic map over the finite field and its application

    Moreover, we discuss the control parameters which can change the behavior of the mapping, and also find that the maximum period can change with the control parameter. Furthermore, we analyze some ...

    Getting Started with Flex 4

    through a series of quick step-by-step tutorials, you'll learn the process of building, debugging, and deploying a complete Rich Internet Application with Flex 4. Each tutorial includes complete code...

    The Impact of Blockchain Technology on Finance A Catalyst for Change

    FRM 2020 Current Issues指定阅读材料。"The Impact of Blockchain Technology on Finance: A Catalyst for Change,” International Center for Monetary and Banking Studies, 2018.

    RadioButton Embed In The DataGrid Of Flex

    在`RadioButtonItemDataRender`类中,我们添加了一个事件监听器`this.addEventListener(Event.CHANGE, changeHandler)`,当RadioButton的选中状态改变时,`changeHandler`函数会被调用。在这个函数中,我们更新了...

    Change Language.rar

    "Change Language.rar"这个压缩包文件提供了一个关于C#中控件语言切换的示例,据描述,该示例已被测试并确认没有错误,是学习如何在C#应用程序中实现语言切换的良好参考资料。 首先,我们要理解在C#中进行语言切换...

    The Art of Multiprocessor Programming.pdf(英文,高清,带书签)

    As the computer industry changes from single-processor to multiprocessor architectures, this revolution requires a fundamental change in how programs are written. To leverage the performance and power...

    Addison.Wesley.The.Java.Programming.Language.4th.Edition.Aug.2005.chm

    or changes to classes and methods caused by the addition of generics (such as the collections utilities and the reflection classes)change permeates this entire fourth edition. &lt;br&gt;The Java ...

    This will change the shape of a sample form to pre-selected

    标题 "This will change the shape of a sample form to pre-selected" 提供的信息暗示,这是一个关于图形用户界面(GUI)设计的程序或代码示例,它能够改变一个样本表单的形状,使其符合预设的形状。这可能涉及到...

    Direction-Change Features of Imaginary Strokes

    We found suitable direction-change features of the imaginary strokes in the pen-up state for on-line handwritten cursive character recognition. Our method simultaneously uses both directional features...

    The Elements of Statistical Learning data Mining,Inference,and Prediction

    Because many readers are familiar with the layout of the first edition, we have tried to change it as little as possible. Here is a summary of the main changes: 1On the Web, this quote has been ...

    The_CSharp_Programming_Language_Third_Edition

    Description The C# project started ... As the primary Microsoft representative on the ECMA committee that standardized C#, he led the implementation of the compiler and worked on the language design.

    Applied Text Analysis with Python

    And yet, the best language models are often highly constrained and application-specific. Why is it that models trained in a specific field or domain of the language would perform better than ones ...

    PDF-XChange PDF Viewer SDK

    Viewer ActiveX SDK is a fully featured, ready to incorporate facsimile of the End User PDF-XChange Viewer, again embedded within a Window of the application, the developer is able to hide and disable ...

    The C++ Programming Language 3rd Ed

    In this brand-new third edition of The C++ Programming Language, author Bjarne Stroustrup, the creator of C++, presents the full specification for the C++ language and standard library, a spec that ...

Global site tag (gtag.js) - Google Analytics