better sort in JavaScript

Better Sort Ordering in JavaScript

Lou Mauget Articles, Development Technologies & Tools, JavaScript, Programming, Tutorial Leave a Comment

In this post, I show how to cajole Array.sort() into producing the following order. This: [Item 1, Item 2, Item 100] instead of this…[Item 1, Item 100, Item 2].

The answer is to pass the sort function a comparator argument from the International Collator built into every major browser and Node.js. This approach is simple and declarative for lists of flat strings. The comparison function arguments default to each string being compared. For sorting objects such as a list of dropdown choices, just pass a pair of the sort field drill-downs to the comparison function.

Dynamically Localizing a WPF Application at Runtime

Tim Williams Articles, Programming, Tutorial Leave a Comment

Today, almost every facet of life deals with technology. Because of this, there is a necessity for applications to be accessible and usable by all people around the world. This means that software developers write need to provide a tailored experience for the end-users that is easy to use, provides output, and effectively captures user input. One important part of that process is localization, which will be explained later on.

The main focus of this article is to provide a solution for localizing a WPF application at runtime. This allows users of the application to change the culture/language of the UI elements through interactions, such as button clicks or menu items.