Hello,
I would need to localize some labels in the whiteboard components.
Looking at the source code, it looks like you are using a private class "com.adobe.coreUI.localization.Localization".
How can I work around it to set my own resource bundle?
Cheers,
Xavier
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Xavier,
The basics here are pretty easy - essentially, we have a static accessor,
Localization.impl, which is an instance of ILocalizationManager. Here's the
interface :
public interface ILocalizationManager
{
function getString(p_inStr:String):String;
function formatString(p_inStr: String, ...args):String;
}
The default implementation just returns the input string - essentially does
nothing. For the whiteboard, all the strings you'll need are processed by
"getString", so your formatString doesn't need to do anything.
To insert your own localization, simply make your own implementation of
ILocalizationManager, then assign it :
Localization.impl = new MyCustomLocalizationManager();
I know that this doesn't conform to the resourceBundle approach Flex uses,
but we have to live across non-Flex and Flex frameworks. Still, it should be
trivial to take a resourceBundle and build an ILocalizationManager which
draws its strings from it, if that's what you'd like to do.
hope that helps!
nigel
Views
Replies
Total Likes
Hi Xavier,
The basics here are pretty easy - essentially, we have a static accessor,
Localization.impl, which is an instance of ILocalizationManager. Here's the
interface :
public interface ILocalizationManager
{
function getString(p_inStr:String):String;
function formatString(p_inStr: String, ...args):String;
}
The default implementation just returns the input string - essentially does
nothing. For the whiteboard, all the strings you'll need are processed by
"getString", so your formatString doesn't need to do anything.
To insert your own localization, simply make your own implementation of
ILocalizationManager, then assign it :
Localization.impl = new MyCustomLocalizationManager();
I know that this doesn't conform to the resourceBundle approach Flex uses,
but we have to live across non-Flex and Flex frameworks. Still, it should be
trivial to take a resourceBundle and build an ILocalizationManager which
draws its strings from it, if that's what you'd like to do.
hope that helps!
nigel
Views
Replies
Total Likes
Hi Niggel,
I saw this class and thought about creating my own implementation.
I hesitated to do so because those classes are marked as @private, hence undocumented, therefore unsupported. Am I wrong here?
But thanks anyway for confirming it.
Cheers,
Xavier
Views
Replies
Total Likes