Android: how to get the current day of the week (Monday, etc…) in the user’s language?

Use SimpleDateFormat to format dates and times into a human-readable string, with respect to the users locale. Small example to get the current day of the week (e.g. “Monday”): SimpleDateFormat sdf = new SimpleDateFormat(“EEEE”); Date d = new Date(); String dayOfTheWeek = sdf.format(d);

Internationalization in JSF, when to use message-bundle and resource-bundle?

<message-bundle> The <message-bundle> is to be used whenever you want to override JSF default warning/error messages which is been used by the JSF validation/conversion stuff. You can find keys of the default warning/error messages in chapter 2.5.2.4 of the JSF specification. For example, Messages_xx_XX.properties files in com.example.i18n package as below which overrides the default required=”true” … Read more

What is the correct way to set Python’s locale on Windows?

It seems you’re using Windows. The locale strings are different there. Take a more precise look at the doc: locale.setlocale(locale.LC_ALL, ‘de_DE’) # use German locale; name might vary with platform On Windows, I think it would be something like: locale.setlocale(locale.LC_ALL, ‘deu_deu’) MSDN has a list of language strings and of country/region strings

Set Culture in an ASP.Net MVC app

I’m using this localization method and added a route parameter that sets the culture and language whenever a user visits example.com/xx-xx/ Example: routes.MapRoute(“DefaultLocalized”, “{language}-{culture}/{controller}/{action}/{id}”, new { controller = “Home”, action = “Index”, id = “”, language = “nl”, culture = “NL” }); I have a filter that does the actual culture/language setting: using System.Globalization; using … Read more

How can I change locale programmatically with Swift

Here’s a way to change it on the fly with Swift, add an extension function to String: extension String { func localized(lang:String) ->String { let path = NSBundle.mainBundle().pathForResource(lang, ofType: “lproj”) let bundle = NSBundle(path: path!) return NSLocalizedString(self, tableName: nil, bundle: bundle!, value: “”, comment: “”) }} Swift 4: extension String { func localized(_ lang:String) ->String … Read more

Best practice to make a multi language application in C#/WinForms? [closed]

I have always used resource files for multi-language applications. The are many articles on the web explaining how to use them. I have used two different ways: A resource file per form A global resource file The resource file / form, is easier to implement, you only need to enter the values in the resource … Read more