internationalization

Python: strftime a UTC timestamp to local time format

 ̄綄美尐妖づ 提交于 2019-12-25 01:47:16
问题 I'd like to use the timestamp from a database result and convert it to my locale time format. The timestamp itself is saved in UTC format: 2015-03-30 07:19:06.746037+02 . After calling print value.strftime(format) with the format %d.%m.%Y %H:%M %z the output will be 30.03.2015 07:19 +0200 . This might be the correct way to display timestamps with timezone information but unfortunately users here are not accustomed to that. What I want to achieve is the following for the given timestamp: 30.03

Add translation to I18N dynamically

回眸只為那壹抹淺笑 提交于 2019-12-25 01:45:04
问题 I have added humanized-money-accessors as described here: Decimals and commas when entering a number into a Ruby on Rails form Now I have two attributes in my model for the same type of data: the original version and the human-readable version. The problem: Since I am using activerecord-translation-yml-files, I have to put in the same translation for original attribute and the humanized_attribute, because my forms show the name of thie humanized_attribute, but on validation errors, the name

zend framework 2 get locale from view PhpRenderer

浪子不回头ぞ 提交于 2019-12-25 01:01:13
问题 How I can obtain traslator locale in my view? I want to do it starting from the variable $this (the PhpRenderer of the view). i.e. I don't want use onBootstrap nor ActionController because I don't care to have a view variables. Thank you! 回答1: You should try: <?php echo \Locale::getDefault(); ?> Many of the I18n classes make reference to PHP's Locale class (http://www.php.net/locale) - so in my opinion that would be a good starting point. 回答2: <?php echo $this->plugin('translate')-

Application Controller not being executed when accessing domain without redirect in router.rb to default locale

六月ゝ 毕业季﹏ 提交于 2019-12-25 00:28:25
问题 Using locale in my rails app. I have the following routes.rb scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do root to: 'static_pages#home' devise_for :users, :controllers => { :registrations => :registrations } resources :blogs do resources :comments end get 'tags/:tag', to: 'blogs#index', as: :tag resources :users get '/users/subregion_options' => 'users#subregion_options' resources "contacts", only: [:new, :create] match '/crew', to: 'static_pages#crew', via: 'get' .... end

How do you handle static list internationalization in asp.net mvc?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 23:45:12
问题 Say I want my app to be completetely internationalized... and a user is supposed to select from a list (dropdown) of countries in a form... Countries are not (currently) a table in my database but I am willing to change this although Im not sure whats the best idea. for instance, in spanish Germany is Alemania. many countries have different names so this needs to be in different languages. How can I do this? please help. edit for clarification: Keep in mind that this country dropdown has

How to cope with different lengths of labels– dynamic layout

旧时模样 提交于 2019-12-24 19:47:41
问题 I have to enable all the text in a winforms application to be replaced; it is an old application and is in “maintenance”. The application was written in .NET v1.1 and later bits of it in .NET v2 therefore it does not use any layout controls. The problem I have is that I need to make the UI cope when a string is longer then the default string. However I don’t wish to make lots of changes to the code due to the risk. In the past I have found that simple changes like adding a panel to a form and

Displaying text in differnt locales on one page

佐手、 提交于 2019-12-24 19:22:28
问题 I need to display sentences in my GSP in differnt locales. The following documentation states that g:message takes a locale param. I can't find an example of this anywhere. Has anyone done this? <p><g:message code="welcome.into.text1" locale="sv_SE"/></p> <p><g:message code="welcome.into.text1" locale="en_US"/></p> Obviosuly, I have messages_sv.properties & messages_en_US.properties. Thanks 回答1: To specify locale explicitely use Locale object instead of String, e.g.: <g:message code="welcome

How to prevent need for rebuilding app after changing Language/Region

南楼画角 提交于 2019-12-24 19:02:12
问题 The issue happens at XCode>'Build and run', not when running it in 'Instruments > Leaks'. So it seems an issue with Xcode. If that is the case, I don't mind doing an extra rebuild. However, if issue will also happen after app is posted in iTunes app store, and customer installs the app in her device, she would have to reinstall the app every time she changes language/region. (needles to say, that would not be acceptable). Is this issue: a) just in Xcode (not in app store)? b) not experienced

Rails internationalization is not working in production mode

送分小仙女□ 提交于 2019-12-24 18:11:08
问题 I have a non-AR model, which I use for a form/composition object. There are lots input fields, which I collect in order to do some data manipulation inside AR transaction. I use I18n for internationalization. yml: pl: activemodel: attributes: catalog/checkout: name: Imię form: = f.input :name, required: true, label: I18n.t(:'.activemodel.attributes.catalog/checkout.name') The issue is that in development and production modes (locally) I see the input having proper label taken from config

Rails internationalization is not working in production mode

丶灬走出姿态 提交于 2019-12-24 18:10:37
问题 I have a non-AR model, which I use for a form/composition object. There are lots input fields, which I collect in order to do some data manipulation inside AR transaction. I use I18n for internationalization. yml: pl: activemodel: attributes: catalog/checkout: name: Imię form: = f.input :name, required: true, label: I18n.t(:'.activemodel.attributes.catalog/checkout.name') The issue is that in development and production modes (locally) I see the input having proper label taken from config