internationalization

Tiles2 Struts Switch Locale

只谈情不闲聊 提交于 2019-12-18 09:49:09
问题 I am newbee to struts2 and tiles2, I am having an application where i m using struts2 as mvc framework and tiles2 as a view component. In my application I am using 2 languages English and Marathi the respective locales are en_US and mr_IN I have tiles.xml and tiles_mr_IN.xml when i switch locale from browser the code works fine but i want to toggle between English and Marathi and the user should be redirected to same action with same request parameters. I have tried satting request_locale

Find out the Date time format of string date in c#

江枫思渺然 提交于 2019-12-18 08:55:20
问题 I am making an application. The application uses date format such as "2012-11-21 15:22:35" . I already know that the format is "yyyy-MM-dd HH:mm:ss" . But how can I find programmatically the date & time format of an arbitrary input string? Is there any way to do this? 回答1: This might help you.. (in the array, add more formats to check) string[] formats = {"M/d/yyyy", "MM/dd/yyyy", "d/M/yyyy", "dd/MM/yyyy", "yyyy/M/d", "yyyy/MM/dd", "M-d-yyyy", "MM-dd-yyyy", "d-M-yyyy", "dd-MM-yyyy", "yyyy-M-d

iOS base internationalization: change the language at runtime

拥有回忆 提交于 2019-12-18 08:53:53
问题 We know this is an old and painful question. If you don't know - let me briefly describe the problem. Suppose we have an application and we want to use xcode built-in localization using NSLocalizedString() - the standard way recommended by Apple. All good until you want to change the language at runtime. There is no way that you can force the application to use another language, Apple recommends always use the system language, or manually load and manage the resources (of course we don't want

iOS base internationalization: change the language at runtime

牧云@^-^@ 提交于 2019-12-18 08:51:30
问题 We know this is an old and painful question. If you don't know - let me briefly describe the problem. Suppose we have an application and we want to use xcode built-in localization using NSLocalizedString() - the standard way recommended by Apple. All good until you want to change the language at runtime. There is no way that you can force the application to use another language, Apple recommends always use the system language, or manually load and manage the resources (of course we don't want

Django 1.9 to 1.10 raises NoReverseMatch: u'en-gb' is not a registered namespace

不打扰是莪最后的温柔 提交于 2019-12-18 08:22:13
问题 I am trying to update my 1.9 application to 1.10 and I am getting the following error on running all my unit tests: Traceback (most recent call last): File "/home/…/tests/views/test_configurator.py", line 261, in test_view_configurator_post args=[self.configurator.id]), File "/home/…/.virtualenvs/intranet/lib/python2.7/site-packages/django/urls/base.py", line 87, in reverse raise NoReverseMatch("%s is not a registered namespace" % key) NoReverseMatch: 'en-gb' is not a registered namespace My

Set locale via code in Struts2

五迷三道 提交于 2019-12-18 07:25:09
问题 In my application, I have to display the content based on the locale user chosen in the configuration page. I am not using browser default locale. when using s:text , it always use the default resource file. In Struts1, I have used the below code to set default locale in my filter session.setAttribute("org.apache.struts.action.LOCALE",locale); How to set the user chosen locale dynamically in Struts2 ? 回答1: This worked for me : String language = userLocale.substring(0, 2); String country =

CurrentThread.CurrentUICulture is set correctly but seems to be ignored by asp.net

不想你离开。 提交于 2019-12-18 07:24:32
问题 Im struggling with gettings the values from the correct strings.txt in my resource files in my \bin folder when switching languages. I have a domain.com (for English) and a domain.nl (for Dutch). It however doesnt seem to matter which domain I use and how I set the currentUICulture, the language shown to the user is always the same! [default.aspx.vb] Partial Class _Default Inherits System.Web.UI.Page Shared rm As ResourceManager = HttpContext.Current.Application("RM") Protected Sub Page_Load

Python parsing date and find the correct locale_setting

做~自己de王妃 提交于 2019-12-18 07:19:13
问题 I have the following date string: '3 févr. 2015 14:26:00 CET' datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S') Parsing this failed with the error: ValueError: time data '03 f\xc3\xa9vr. 2015 14:26:00' does not match format '%d %b %Y %H:%M:%S' I tried to loop over all locales with locale.locale_alias : for l in locale.locale_alias: try: locale.setlocale(locale.LC_TIME, l) print l,datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S') break except

Python parsing date and find the correct locale_setting

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 07:18:04
问题 I have the following date string: '3 févr. 2015 14:26:00 CET' datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S') Parsing this failed with the error: ValueError: time data '03 f\xc3\xa9vr. 2015 14:26:00' does not match format '%d %b %Y %H:%M:%S' I tried to loop over all locales with locale.locale_alias : for l in locale.locale_alias: try: locale.setlocale(locale.LC_TIME, l) print l,datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S') break except

Struts 2 (version 2.3.28) only accepts registered locales

若如初见. 提交于 2019-12-18 07:14:32
问题 In Struts 2 version 2.3.28, the i18n interceptor only accepts the locales which are registered to jvm, the list which is returned by Locale.getAvailableLocales() . Well, although I can extend the list of available Java Locales, as mentioned How to extend the list of available Java Locales, is it any short way that set this interceptor to accept all strings as locale (for example fa_IR ) ?! Just a note: Setting the default locale to fa_IR ( <constant name="struts.locale" value="fa_IR" /> )