Does PostgreSQL support “accent insensitive” collations?

Update for Postgres 12 or later Postgres 12 adds nondeterministic ICU collations, enabling case-insensitive and accent-insensitive grouping and ordering. The manual: ICU locales can only be used if support for ICU was configured when PostgreSQL was built. If so, this works for you: CREATE COLLATION ignore_accent (provider = icu, locale=”und-u-ks-level1-kc-true”, deterministic = false); CREATE INDEX … Read more

How does one change the language of the command line interface of Git?

Add these lines to your ~/.bashrc, ~/.bash_profile or ~/.zprofile to force git to display all messages in English: # Set Git language to English #alias git=”LANG=en_US git” alias git=”LANG=en_GB git” The alias needs to override LC_ALL on some systems, when the environment variable LC_ALL is set, which has precedence over LANG. See the UNIX Specification … Read more

MVC DateTime binding with incorrect date format

I’ve just found the answer to this with some more exhaustive googling: Melvyn Harbour has a thorough explanation of why MVC works with dates the way it does, and how you can override this if necessary: http://weblogs.asp.net/melvynharbour/archive/2008/11/21/mvc-modelbinder-and-localization.aspx When looking for the value to parse, the framework looks in a specific order namely: RouteData (not shown … Read more

Best practice using NSLocalizedString

NSLocalizedString has a few limitations, but it is so central to Cocoa that it’s unreasonable to write custom code to handle localization, meaning you will have to use it. That said, a little tooling can help, here is how I proceed: Updating the strings file genstrings overwrites your string files, discarding all your previous translations. … Read more

Ignoring accented letters in string comparison

FWIW, knightfor’s answer below (as of this writing) should be the accepted answer. Here’s a function that strips diacritics from a string: static string RemoveDiacritics(string text) { string formD = text.Normalize(NormalizationForm.FormD); StringBuilder sb = new StringBuilder(); foreach (char ch in formD) { UnicodeCategory uc = CharUnicodeInfo.GetUnicodeCategory(ch); if (uc != UnicodeCategory.NonSpacingMark) { sb.Append(ch); } } return … Read more

Xcode 9 – “Fixed Width Constraints May Cause Clipping” and Other Localization Warnings

I was getting the same warnings even without multiple languages in my app, which led me to find out what was really going on. . . There are a few different things going on here. I was able to silence the fixed-width warnings in my own app by changing the width of the object spacings … Read more

DisplayName attribute from Resources?

If you use MVC 3 and .NET 4, you can use the new Display attribute in the System.ComponentModel.DataAnnotations namespace. This attribute replaces the DisplayName attribute and provides much more functionality, including localization support. In your case, you would use it like this: public class MyModel { [Required] [Display(Name = “labelForName”, ResourceType = typeof(Resources.Resources))] public string … Read more

Lint: How to ignore ” is not translated in ” errors?

Android Studio: “File” > “Settings” and type “MissingTranslation” into the search box Eclipse: Windows/Linux: In “Window” > “Preferences” > “Android” > “Lint Error Checking” Mac: “Eclipse” > “Preferences” > “Android” > “Lint Error Checking” Find the MissingTranslation line, and set it to Warning as seen below: