A good date converter for Jalali Calendar in Java? [closed]

For better localization and language support, it is often convenient to use the ICU (International Components for Unicode) library from IBM. The APIs are similar to the standard Java APIs, but add additional support for localization and internationalization (e.g. time and calendar issues, sorting, formatting rules and a regex implementation with proper Unicode support). To … Read more

How to set and change the culture in WPF

I’m going to chime in here. I successfully did this using the OverrideMetadata() method that the OP mentioned: var lang = System.Windows.Markup.XmlLanguage.GetLanguage(MyCultureInfo.IetfLanguageTag); FrameworkElement.LanguageProperty.OverrideMetadata( typeof(FrameworkElement), new FrameworkPropertyMetadata(lang) ); But, I still found instances in my WPF in which the system culture was being applied for dates and number values. It turned out these were values in … Read more

Localization of input type number

The HTML5 input type=number is inadequate from the localization point of view, due to both the definition and the implementations. It is meant to be localized but as per the locale of the browser, which you cannot set or even know as a designer/author. On my Chrome, the input type=number step=0.001 accepts 1,2 (with comma) … Read more

toLocaleDateString() short format

I think the function toLocaleDateString use the default local data on the device. try this code to check the output: // America/Los_Angeles for the US // US English uses month-day-year order console.log(date.toLocaleDateString(‘en-US’)); // → “12/19/2012” // British English uses day-month-year order console.log(date.toLocaleDateString(‘en-GB’)); // → “20/12/2012” // Korean uses year-month-day order console.log(date.toLocaleDateString(‘ko-KR’)); // → “2012. 12. … Read more

Change format of md-datepicker in Angular Material with momentjs

There is a documentation for $mdDateLocaleProvider in the Angular Material docs. angular.module(‘app’).config(function($mdDateLocaleProvider) { $mdDateLocaleProvider.formatDate = function(date) { return moment(date).format(‘YYYY-MM-DD’); }; }); If you don’t use moment.js, substitute the code inside formatDate for whatever you wish to use to format the date. Here is a CodePen example based on the samples from Angular Material docs.

What’s the best database structure to keep multilingual data? [duplicate]

Similar to method 3: [languages] id (int PK) code (varchar) [products] id (int PK) neutral_fields (mixed) [products_t] id (int FK) language (int FK) translated_fields (mixed) PRIMARY KEY: id,language So for each table, make another table (in my case with “_t” suffix) which holds the translated fields. When you SELECT * FROM products, simply … LEFT … Read more

Possible to use variables and/or parameters with NSLocalizedString?

If what you want is to return the localized version of “This is an Apple/Orange/whatever”, you’d want: NSString *localizedVersion = NSLocalizedString(([NSString stringWithFormat:@”This is an %@”, @”Apple”]), nil); (I.e., the nesting of NSLocalizedString() and [NSString stringWithFormat:] are reversed.) If what you want is the format to be localized, but not the substituted-in value, do this: NSString … Read more

Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) – possible?

The only way I can see this working is by creating a class that derives from ResourceManager and then overriding the InternalGetResourceSet and GetResourceFileName methods. From there, you should be able to override where resources are obtained, given a CultureInfo instance.

how to change source file encoding in csharp project (visual studio / msbuild machine)?

Problem: Compiler launched from command line cannot process the source file because of international characters that I’ve just added. Solution: Save source file explicitly in UTF-8 encoding to preserve international characters. How To: open the problematic file in Visual Studio. on the File menu click “Advanced Save Options“ from “Encoding” combo select “Unicode (UTF-8 …“ … Read more