Flex 中的阿拉伯语区域设置支持
今天,我学习了如何本地化我的 Flex 应用程序并支持多种语言。网上的教程很棒。然而,他们都没有提到阿拉伯语言环境。
所以基本上,我通过使用以下方法在 SDK 文件夹中创建了阿拉伯语(约旦)语言环境文件:
copylocale en_US ar_JO
我导航到语言环境文件夹,并且能够在其中看到 ar_JO 文件夹...所以我假设一切一切顺利。
接下来,我按照教程 (www.babelfx.org) 进行操作,并能够将我的测试应用程序本地化为英语,法语、阿拉伯语。单击任何一种语言都会将我的简单形式的标签切换为所需的语言...但是:
- 当切换到阿拉伯语时,标签会变成空的方形符号。如果您想知道,是的,我可以打开记事本并输入阿拉伯文本并成功保存。
- 当我在文本框中输入阿拉伯语文本时,我可以看到我正确输入的阿拉伯语单词(标签仍然是方形符号)。
我在这里可能缺少什么想法吗?
我尝试将应用程序的字体(在应用程序标签上设置 fontFamily
)更改为 Windows 上默认提供的 简体阿拉伯语
。
谢谢
Today, I learn how to localize my Flex application and to support multiple languages. The tutorials on-line are great. However, non of them mention the Arabic locale.
So basically, I created the Arabic (Jordan) locale files in the SDK folder by using:
copylocale en_US ar_JO
I navigated to the locale folder and I was able to see the ar_JO
folder in there... So I assume everything went smooth.
Next, I followed the tutorials (www.babelfx.org) and was able to localize my test application in English, French, and Arabic. Clicking on any of those languages switches the labels of my simple form/into the desired language... however:
- When switching to the Arabic language the labels turn into empty square symbols. If you are wondering, yes I can open a notepad and type Arabic text and save it successfully.
- When I type Arabic text into the text boxes, I can see the Arabic words that I typed correctly (the labels are still square symbols).
Any ideas what I might be missing here??
I tried changing the font of my application (right on the application tag I set the fontFamily
) into Simplified Arabic
which comes by default on Windows.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否在
swf
中嵌入了可以呈现阿拉伯语的字体?你用的是那个字体吗?如果答案是否定的,那么我建议阅读该主题< /a>.关于 Flash 和字体,需要记住的一件事是它具有令人难以置信的功能,这种功能来自于能够将实际字体嵌入到 swf 本身中。人们还需要记住,Flash 非常挑剔,如果你不这样做,很容易发脾气。
Have you embedded a font into your
swf
which can render Arabic? Are you using that font? If the answer is no to either, then I suggest reading up on the subject.One thing to remember about Flash and fonts is that it has incredible power which comes from the fact that one is able to embed actual fonts into the swf itself. One also needs to remember that Flash is incredibly finicky and is prone to throwing fits if you fail to do so.
解决方案是将上下文类型更改为 UTF-8。在 Flex Builder 中实现此目的的三种方法:
(Option 1) Right click the file from the File Navigator and select Properties
(Option 2) With the file open, navigate to the File menu and choose Properties
(Option 3) With the file open, press Alt + Enter to bring up the file Properties
显示属性窗口后,您将看到将文件编码从默认更改为其他 (UTF-8) 的选项。
注意:至少对我来说,一旦我将内容类型更改为 UTF-8,我必须关闭未保存的文件,重新打开它,然后将内容粘贴回文件中,以便清除错误消息。然后清理项目(项目->清理...)并让它重建。
The solution is to change the context-type to UTF-8. Three ways to accomplish this from within Flex Builder:
(Option 1) Right click the file from the File Navigator and select Properties
(Option 2) With the file open, navigate to the File menu and choose Properties
(Option 3) With the file open, press Alt + Enter to bring up the file Properties
Once the properties window is displayed, you will see the option to change the file encoding from Default to Other (UTF-8).
Note: At least for me, once I changed the content-type to UTF-8, I had to close my unsaved file, open it back up, and paste my contents back into the file in order to clear the error message. Then clean the project (Project -> Clean...) and let it rebuild.
我找到了解决方案。事实上,我不需要嵌入任何字体或任何东西来让它工作。
我的问题是
resources.properties
文件中的编码。我在 Notepad++ 中打开它,然后我注意到Encoding
菜单。当时我记得读过一些关于资源文件的编码应该是UTF-8
的内容。于是我从菜单将编码转换为UTF-8
,编译,不行!经过几次重试和清理项目后,它成功了!只是提醒大家(因为我在解决这个问题时遇到了这个问题):
对于
mx
组件,嵌入字体必须将embedAsCFF
设置为false
。I found the solution. Actually, I didn't have to embed any fonts or anything in order to get it working.
My problem was the encoding in the
resources.properties
file. I opened it in Notepad++, then I noticed theEncoding
menu. At that time, I remembered reading something about that the encoding of the resources files should beUTF-8
. So I converted the encoding toUTF-8
from the menu, compiled, it didn't work! After couple of retries and cleaning the project, it worked successfully!!!Just a reminder for everybody (as I have fallen into this while working this problem out):
For
mx
components, embedded fonts must have theembedAsCFF
set tofalse
.