Paket | mx.resources |
Sınıf | public class ResourceBundle |
Miras Alma | ResourceBundle Object |
Uygular | IResourceBundle |
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 3 |
Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
A Flex application typically has multiple instances of this class, all managed by a single instance of the ResourceManager class. It is possible to have ResourceBundle instances for multiple locales, one for each locale. There can be multiple ResourceBundle instances with different bundle names.
İlgili API Öğeleri
Özellik | Tanımlayan: | ||
---|---|---|---|
bundleName : String [salt okunur]
A name that identifies this resource bundle,
such as "MyResources". | ResourceBundle | ||
constructor : Object
Belirli bir nesne örneği için sınıf nesnesine veya yapıcı işlevine bir başvuru. | Object | ||
content : Object [salt okunur]
An object containing key-value pairs for the resources
in this resource bundle. | ResourceBundle | ||
locale : String [salt okunur]
The locale for which this bundle's resources have been localized. | ResourceBundle |
Yöntem | Tanımlayan: | ||
---|---|---|---|
Constructor. | ResourceBundle | ||
Bir nesnenin belirli bir özelliğinin tanımlı olup olmadığını gösterir. | Object | ||
Object sınıfının bir örneğinin parametre olarak belirtilen nesnenin prototip zincirinde olup olmadığını gösterir. | Object | ||
Belirtilen özelliğin bulunup bulunmadığını ve numaralandırılabilir olup olmadığını gösterir. | Object | ||
Dinamik bir özelliğin döngü işlemlerinde kullanılabilirliğini ayarlar. | Object | ||
Bu nesnenin, yerel ayara özel kurallara göre biçimlendirilmiş dize temsilini döndürür. | Object | ||
Belirtilen nesnenin dize olarak temsil edilen halini döndürür. | Object | ||
Belirtilen nesnenin temel değerini döndürür. | Object |
Yöntem | Tanımlayan: | ||
---|---|---|---|
When a properties file is compiled into a resource bundle,
the MXML compiler autogenerates a subclass of ResourceBundle. | ResourceBundle |
bundleName | özellik |
bundleName:String
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 3 |
Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
A name that identifies this resource bundle,
such as "MyResources"
.
This read-only property is set when a resource bundle is constructed.
Resource bundles that are automatically created from compiled
properties files have bundle names based on the names of those files.
For example, a properties file named MyResources.properties
will produce a resource bundle whose bundleName
is "MyResources"
.
The ResourceManager can manage multiple bundles with the same
bundleName
as long as they have different values
for their locale
property.
Uygulama
public function get bundleName():String
content | özellik |
content:Object
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 3 |
Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
An object containing key-value pairs for the resources in this resource bundle.
In general, you should access resources by using IResourceManager
methods such as getString()
, rather than directly
accessing them in a resource bundle.
However, if you are programmatically creating your own
resource bundles, you can initialize them with resources,
as follows:
var rb:IResourceBundle = new ResourceBundle("fr_FR", "MyResources"); rb.content["LANGUAGE"] = "Francais"; rb.content["GREETING"] = "Bonjour";
When a resource bundle is produced by compiling a properties file, its resource values are either of type String or Class. For example, if the properties file contains
LANGUAGE=English MINIMUM_AGE=18 ENABLED=true LOGO=Embed("logo.png")
then the value of the LANGUAGE
resource
is the String "English"
,
the value of the MINIMUM_AGE
resource
is the String "18"
,
the value of the ENABLED
resource
is the String "true"
,
and the value of the LOGO
resource
is a Class that represents the embedded PNG file.
You can use IResourceManager methods such as getInt()
and getBoolean()
to convert resource strings like
"18"
and "true"
into the type
that your code expects.
Uygulama
public function get content():Object
locale | özellik |
locale:String
[salt okunur] Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 3 |
Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
The locale for which this bundle's resources have been localized.
This is a String such as "en_US"
for U.S. English.
This read-only property is set when a resource bundle is constructed.
Resource bundles that are automatically created from compiled
properties files have locales based on the
-compiler.locale
option of the mxmlc or compc compilers.
For example, suppose that you compile your application with the option
-compiler.locale=en_US,ja_JP
and that you have specified
-compiler.source-path=resources/{locale}
so that
your application's resources, located in
resources/en_US/MyResources.properties and
resources/ja_JP/MyResources.properties, are found.
Then your application will have two resource bundles
whose bundleName
is "MyResources"
,
one whose locale
is "en_US"
and one whose locale
is "ja_JP"
.
Uygulama
public function get locale():String
ResourceBundle | () | Yapıcı |
public function ResourceBundle(locale:String = null, bundleName:String = null)
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 3 |
Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
Constructor.
Parametrelerlocale:String (default = null ) — A locale string, such as "en_US" .
| |
bundleName:String (default = null ) — A name that identifies this bundle,
such as "MyResources" .
|
getContent | () | yöntem |
protected function getContent():Object
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 3 |
Çalışma Zamanı Sürümleri: | Flash Player 9, AIR 1.1 |
When a properties file is compiled into a resource bundle, the MXML compiler autogenerates a subclass of ResourceBundle. The subclass overrides this method to return an Object that contains key-value pairs for the bundle's resources.
If you create your own ResourceBundle instances,
you can set the key-value pairs on the content
object.
Object — The Object that contains key-value pairs for the bundle's resources.
|
Tue Jun 12 2018, 01:09 PM Z