Flex and Localization: Setting the default new file encoding in Flex Builder

[Note: I recently presented at 360Flex San Jose on the topic of localization (L10N). During that session, several questions were asked that I did not have the answers to. Over the next few months I will be attempting to answer all of those questions and more.]

In Flex, resource bundles are used to provide localization features — that is, the ability for your application to provide the user with a different language and regional preference — to your applications. All Flex applications start up with US English as the base language here in the United States of America. Even Flex Builder's default compiler options includes "-locale en_US" making it possible for you to begin localizing your application.

The "gotcha" that hit me the first time I created a resource bundle for localization in a Flex application was the file encoding. The default file encoding setting in Flex Builder (Eclipse) is ISO-8859-1, which if you use is ok for English, but if you choose to copy this file and use it for someone to translate your English text to, say, Spanish it could cause you some problems. For instance, I had a main.properties file that I was translating line by line with Google Translate (I know, lame) from English to Spanish. When I had completed the process and saved the new file, boy was I disappointed. All the special characters that Spanish uses were replaced by triangles with question marks. Converting that ISO-8859-1 file to UTF-8 with the tools at hand made things worse. My choice at the time was to start over from scratch making certain that my English file was UTF-8 and then all my future copies would also be UTF-8.

And, of course, when I told this sad story during my presentation at 360Flex San Jose an attendee asked "Isn't there a preference setting for that inside Flex Builder?" My response at the time was, "I'm sure there is but I have not found it." But I have now!

To get to that preference setting in Flex Builder (stand alone), select "Window" > "Preferences..." and the Preferences dialog box will appear. In the left side tree open "General" and select "Content Types." The right side will have a new tree in the top. Open "Text" and select "Java Properties" and the bottom of the right side will show the File Assiociations and Default Encoding settings. You'll notice that the Default Encoding is set at ISO-8859-1. Merely change the text in that field to "UTF-8" and you'll be done. From this point forward, *.properties files that Flex Builder creates will be encoded as UTF-8.

You can also change this setting on a per-workspace level (not that I could think of a good reason to do it that way). With your Preferences dialog open and "General" selected in the left side tree, select "Workspace." You will see an option labeled "Text File Encoding". Select the "Other" radio button and use the combo box to select the encoding you desire.

Please let me know in the comments if you have a problem with these instructions in your environment.

 

Comments (4) | Print | Send | del.icio.us | Digg It! | Linking Blogs
223 Views

Twitter Causes My Site to Fail to Load (what a surprise)

I was afraid of this, and I should have known better. I believe that the Twitter pod I placed on my BlogCFC site has been preventing my site from loading. Since I updated my site this week-end, I can't be certain that the Twitter pod is the guilty party, but turning it off has certainly sped things up.

There are other Twitter widgets available, but for now I am going to do without. Perhaps I'll spend some time creating a Twitter widget in Flex for the purpose of creating an example application. We'll see.

For now, I'm going to try to keep an eye on my logs and visit my site often. If you want to follow me on Twitter, you can find me here.

 

Comments (0) | Print | Send | del.icio.us | Digg It! | Linking Blogs
192 Views

First Entry with BlogCFC, Database and Layout Updates

Greetings to you all. As you may have noticed, my blog has been dark for over a month. Although I have been extremely busy, the main reason I have not made an entry is very simply this: I hate my blog.

[More]

Comments (1) | Print | Send | del.icio.us | Digg It! | Linking Blogs
198 Views

AIR Window Explorer: I Owe Daniel Rinehart A Beer

Daniel R., if you are listening, I know that you don't know me, but I owe you a beer.

This afternoon as I was working on my 360Flex presentation and example code I became very, very frustrated with NativeWindow and Window and all the various similarities and differences in the options for creating and manipulating this much-used feature in AIR. So I thought, "Let's Google this bugger and see if there is a chart out there that can help."

No charts, but I was intrigued by a link to Daniel's site: AIR Window Explorer. You've seen the Flex Component Explorer and the Flex Style Explorer, well, Daniel's app is in the same vein. Decide on your Window options, create and open the window. Click on the "Show Code" button, and you will see the code used to create the Window. Nice! This application isn't perfect, mind you, but it does give you a a good idea of what you can do with the Window and NativeWindow classes in AIR.

So, for saving me an hour (and a lot of frustration) today, I owe Daniel R. a beer. Not a crappy beer. A really great beer.

Hopefully Daniel will be attending 360Flex in August so I can repay him properly.

 

 

Comments (1) | Print | Send | del.icio.us | Digg It! | Linking Blogs
713 Views

User Group Overload Ends with Tonight's XD Atlanta User Group Gathering

This week has been totally user group overload for me.

Tuesday we had Ryan Taylor present "Intro to Flash Player 10 and Pixel Bender" at the Adobe Flash Platform User Group of Atlanta. Ryan always wows us with his giant brain full of math. The part of his presentation that I thought was most interesting was his examples of Pixel Bender, the tool kit that lets you (yes, you. It looks like it's that simple) script filters and effects for Flash. Ryan has posted his presentation and demo files on his blog if you want to take a look.

Wednesday had me visiting the Atlanta ColdFusion User Group where I was pummeled by comments "Where the heck have you been?" and "You didn't RSVP!" Mea Culpa, my CF friends, I have been neglecting you badly. But tonight's meeting was a must-see event; John Mason gave us an overview of "BlazeDS for ColdFusion Developers" and he did so without showing a chat example (thanks for taking the high road, John). He replaced the unfortunately stereotypical chat messaging example with the much more pertinent ColdFusion error message widget example. John's presentation will be posted on his labs site.

Tonight should also be fun as Michael Hagel has arranged for the XD Atlanta User Group to have a "Summer Social Gathering" at STATS Atlanta, you know, the place where all the 360Flex parties were held (and the only place you could have seen me during 360Flex because I was too busy at work to attend sessions :-( ). It should be great. By the way, Michael, the site is looking great!

See you there!

 

Comments (0) | Print | Send | del.icio.us | Digg It! | Linking Blogs
597 Views

Tonight's Adobe Flash Platform User Group Meeting: Ryan Taylor and Flash Player 10

I am so glad that I know Ryan Taylor. Every now and then, Ryan will contact me and say "Hey, when would you like me to present?" I always seem to reply "Next month!"

Tonight, Ryan will be presenting some of the new features of Flash Player 10, currently in beta, at the Adobe Flash Platform User Group of Atlanta and Flash Meetup Atlanta meeting. You should attend.

 

Comments (2) | Print | Send | del.icio.us | Digg It! | Linking Blogs
558 Views

Kerner wants "One Brush to Rule Them All" and you should, too!

Matt Kerner popped up on my IM client with a long, expletive-laden rant (and he's actively religious, so I started paying attention immediately) about brushes in Fireworks CS3. It seems that he has a workflow issue with Fireworks that involves him moving from Photoshop and back to Fireworks all because he needed to use a specific brush that isn't available to him in Fireworks.

Wow. Who knew that is so simple as a *.abr file could effect someone's sanity. So much so, Kerner made a logo. So much so, he made t-shirts available.

If this was Flex or the Flash Player, I'd be suggesting that you go vote on the issue. Since we don't have that available, if you would find it useful for brush files be easily transferred between Photoshop, Illustrator, Fireworks, Flash, In Design, and After Effect, leave a comment here and I will make sure that Adobe hears you.

One Brush to Rule Them All

 

Comments (3) | Print | Send | del.icio.us | Digg It! | Linking Blogs
726 Views

Flex Builder: Vote For Templates! (Retracting My "Snippets" Recommendation)

Earlier this week I wrote a paragraph about the merits of adding the Snippets view into Flex Builder. I would like to retract that statement and apologize to anyone who followed my advice.

You see, my experience with snippet-like features was with the Flash Development Tool (FDT) plug-in for Eclipse. FDT does not function like the Snippets that I was recommended. In fact, the plug-in I recommended is basically unusable and could be considered harmful.

With FDT, as I recall, you would create your templates in a basic text field then name and save them. When you needed that "snippet" of text, you'd type the name and hit a specific key combination and the "snippet" would appear, replacing the name that you typed. If your "snippet" had variables, dynamically places in the "snippet" to type text, your cursor would appear immediately in that space and as you typed, every place that that variable appeared would update. Ultimately, it came down to you taking the time to create the right kinds of templates for you to really reduce your coding time and effort. Pretty nice, huh? Check out the JSEclipse templates. They use this method of creating snippets.

I assumed that Snippets, at least the plug-in that I was re-recommending via another blog's post, operated in the same manner. But no, woefully not. It's a usablility nightmare. DO NOT USE IT. I'd give you more details but it would be a waste of time — it's that bad.

So, here I go again: let's bring true coding templates to Flex Builder! It's issue FB-11842 in the Flex Bug and Issue Management System (log in required, but worth the time). Please vote for this feature. It may actually save you a week-end or two a year. Think about that.

 

Comments (3) | Print | Send | del.icio.us | Digg It! | Linking Blogs
1179 Views

Vote for Flex Builder Source Formatting (or Pedro)

I was reading a blog entry on Flex Builder Enhancements at InsideRIA last night and thought that I would bump the entry and my comment up to the surface for more exposure. RJ Owen's article laments features that are available from the Java Developer Kit and not a part of the Eclipse project itself, thus not immediately available for Flex Builder users. He cites useful features like "TODO", Snippets, Mylyn integration, and a fix to the Open Resource menu bug (something I had never run into). The article also links to where you can acquire these enhancements. All of these features are worthy of mentioning to my team here at Roundbox Global.

Snippets was one of t ne features that I was used to using in Flash Development Tool (FDT) back when I was doing Flash development on a regular basis. This feature allows developers to use templates to help speed up common coding tasks. If you want to be able to have code created for you via Snippets, you first create the template, then in your code type the string associated with the template and "bam" the code is there. All you need to do then is tab through the template variables you set up and enter the data you need. OK, so, it isn't that simple, but once you set it up and get it into your workflow it's powerful.

The comments for the article featured a few people fired up about the lack of source formatting. I mention the lack of this feature privately a while back and could never raise anyone's temperature. But someone else had thought enough about the feature to have entered a bug into the Flex Bug and Issue Management System over at Adobe. The issue, FB-8297, deserves the attention of anyone who wants source formatting in Flex Builder. At this time, the issue has 22 votes but I now feel certain that more people are interested than that.

Although FB-8297 is listed as a "Minor Enhancement", I am certain that Adobe's engineers will look at this issue as more than minor because it isn't just formatting ActionScript code similar to how Java code is structured; this task will require ActionScript, MXML and ActionScript+MXML all to be formatted by Flex Builder, something that is more than what the JDK is able to do. In the issue's comments, I've added some further enhancements to the issue — like making sure the "x" comes before "y" in the MXML which is something that drives me nuts during code reviews.

If you want this feature, vote for it.

 

Comments (0) | Print | Send | del.icio.us | Digg It! | Linking Blogs
1099 Views

Good News/Bad News: I'm Speaking at 360Flex San Jose

I was notified last night by 360Flex's Tom and John that I will be speaking at their next conference being held in San Jose, California on August 18-20. I submitted several topics to speak on, and they decided that my internationalization (I18N) topic was the one that they wanted me to speak about. I18N actually stands for Internationalization - "where 18 stands for the number of letters between the i and the n in internationalization" - Wikipedia. When I originally suggested the topic to Tom via instant message, he responded "I18N?", so the session is titled "I18N: Tom Ortega Doesn't Know It, But You Should ;-)." See the full schedule here.

Now for the bad news: I am in the last session of the conference. And I am up against Ryan Stewart's "Synchronization with AIR and LiveCycle DS." I mean seriously, Tom and John. Where is the love?

I'll be blogging about the progress I am making with this presentation, although I have already made quite a bit of progress with the presentation because I am currently using it with two projects and was putting together training for Roundbox Global's Interactive Engineering team on the subject.

Again, thanks to the 360Flex team for accepting my submission!

 

Comments (5) | Print | Send | del.icio.us | Digg It! | Linking Blogs
784 Views

More Entries