I wrote three blogs, none of which I posted because the stupid proxy @ work blocked my posts. Those blows werwe’re
So insightful too. Now I’m logging from the syorm
Category Archives: Tech
Bling Bling
If you haven’t used Chrome yet, the new web browser by Google, you’re missing out. I’m singing Chrome’s praises pretty early but so far it has been impressive. From usability to speed, it’s looking pretty good, better than IE and even Firefox.
If you’re geeky, check out the story behind Chrome.
http://www.google.com/googlebooks/chrome/
After reading the story, there’s a better sense of appreciation for Chrome’s architecture. I also feel like what I do at work is complete crap compared to this. Too bad for MS, but Google has done it again.
*Edit: gripes so far… the scroll step with the mouse pad is much greater and choppier with Chrome than with Firefox… probs with Chrome and facebook…. sometimes sketchy text selection…. deny-did to our work websites…
The Gimp
Who needs Adobe Photoshop when you can use the Gimp. Gimp offers a lot of the same features that PS has. Besides an interesting name, the other noteworthy thing about Gimp is that it’s free. Woohoo!
Check it out here: GIMP
C# ResourceManager
More frustration with localization…
ResourceManager is .net’s way of loading resources (images, text, xml) to use in your assembly. I’m using RM as a way to load different language resource bundles into my class based on the cultureinfo.
Create a resource file using the “Resource File” template from the solution explorer. This creates a *.resx file. Add in your key value pairs into your resource file. To access your values in your resource file, create an instance of the ResourceManager with the CORRECT resource file and assembly as follows.
ResourceManager rm = new ResourceManager(“YourNamespace.YourResouceFile”, Assembly.GetExcecutingAssembly());
rm.GetString(“YourKey”);
Sigh. The part I got tripped up on was the “YourNamespace” of the resource file. Apparently you need the fully qualified name of the resource file you’re trying to load otherwise .net doesn’t know where to find the file. There’s probably a different way of doing it, but that’s what I’m going with for now….
@#(*$)(@*#!@*&#!@(*#
Localization Hell
Warning: This post is of little use to anybody who isn’t interested in localization or internationalization of an application. This is mainly a shared notepad for myself and anybody else who is interested (not likely).
If you’re software is never going to be sold to other countries, you’ll never have to worry about localization/internationalization. The basic premise behind these two things is that you want to separate your languages from your user controls so that you can swap in language bundles to save from having to redevelop things for different countries/languages.
I’ve been doing some [hacky] localizing for work and here are some notes I’ve taken:
- Using ResourceBundle class is a “neat” way of storing your key value pairs in a properties file. If I had a button called ButtonSexy and the caption for the button is Sexy, I might have a kvp in a properties file like ButtonSexy=Sexy
- I can have several “bundles” for different languages; one for chinese, one for arabic, one for french. Name them yourbundle_fr.properties. The .properties extension is important!!! I thought I read that Java would append a .properties extension on when it’s looking for the properties file, but apparently it doesn’t.
- Make sure the bundle is in your classpath.
- The properties file needs to be in ascii because the RB will be looking for a properties file in that format ONLY. For your non-ascii characters, put in the unicode rep as \uXXXX where XXXX is the unicode. Java will convert it for the ascii to unicode.
- The native2ascii tool (part of Java SDK) is a b!tch to use. It doesn’t work on my machine for some reason. To get the unicode \u version of my non-ascii chars, I used http://people.w3.org/rishida/scripts/uniview/conversion
More info regarding internationalization can be found here: http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/
Keywords for Google: localization java, internationalizatio java, resourcebundle, properties file, missingresourceexception, unicode properties file, i hate localization