いいえ。私は、頭痛のない状態でインターナショナル化を行う方法を見つけようと、ネットを回っていました。私は最終的に手段を見つけました。あなたのビルドパラメータにロケールを含めて、それをリソースマネージャのプロパティファイルにすることを-locale locale/{locale}
にしてください。Flex i18nの問題(onCreationCompleteのロケールを選択)
問題:起動時にユーザのロケールを設定できないようです。私は(のLocaleIDは文字列ベースであるため、奇数である..?)「範囲外のLocaleID指数」についてのいくつかのエラーが出る
この部分は正常に動作します:
<fx:Script>
<![CDATA[
// Shorthand resource management.
private function getLang(key:String):String
{ return resourceManager.getString(key, 'lang'); }
]]>
</fx:Script>
この部分は動作しません。 :
protected function creationCompleteHandler(event:FlexEvent):void
{
var locale:LocaleID = new LocaleID("en_GB");
trace(locale.getLanguage()); // en
trace(locale.getRegion()); // GB
trace(locale.name); // en-GB
if (!empty(saveData.data.lang)) // empty checks if str == null or trim(str).length == 0
locale = new LocaleID(saveData.data.lang);
this.setStyle("locale", locale);
}
私はロケールを設定すると、実際のエラーがスローされていませんが、UI内のオブジェクトは、それらの値を取得しようとします。完全なエラーメッセージは以下の通りです:
RangeError: Property locale value [object LocaleID] is out of range
at flashx.textLayout.property::Property$/defaultErrorHandler()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\property\Property.as:31]
at flashx.textLayout.property::Property/setHelper()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\property\Property.as:230]
at flashx.textLayout.formats::TextLayoutFormat/setStyleByProperty()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\formats\TextLayoutFormat.as:628]
at flashx.textLayout.formats::TextLayoutFormat/set locale()[C:\Vellum\branches\v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\formats\TextLayoutFormat.as:1271]
at spark.core::CSSTextLayoutFormat()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\core\CSSTextLayoutFormat.as:75]
at spark.components::RichEditableText/updateStylesIfChanged()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\RichEditableText.as:3619]
at spark.components::RichEditableText/commitProperties()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\RichEditableText.as:2491]
at mx.core::UIComponent/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:8209]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:813]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
おもしろ情報:(?) 1.私の名前はベラム 2.マイSDKには、それはC:\Program Files\Adobe\Adobe Flash Builder 4.5.1\sdks\4.5.1
にあります... E:\dev\4.5.1
ではありませんではありません。良い仕事のエラーメッセージ!
スタックトレースに表示されるビルドパスに関する問題は、フレームワークSWCの構築方法に関連しています。私は、コードヒントを作成するために使用されるすべてのASDocsとメタデータを含む「FAT SWC」を作成するときに、それらのdevパスを削除することは不可能だと思います。私は細部に少しぼやけている。それが私の理解です。 – JeffryHouser
私はこの質問を非常に厄介な方法で回避することができたので、私は答えを書くだろうと思う。私はFlexの嫌いなことを私が見ているように、毎日Flexがますます嫌いです。 – cbroughton
FYIとして、これらのランタイムエラーはtextLayoutフレームワークから生成されます。 Flexフレームワークコードからではありません。私はFlexが問題ないと言っているわけではありません。あなたの現在のエラーはそれらの一つではありません。 – JeffryHouser