ruby - Setting Sinatra template options works locally, broken on Heroku -
My Sinatra Web site uses a valid ghetto approach to switch between two languages, which can be used on my local machine Works perfectly, but not everyone.
My When I click on the link to the My gems are similar versions in both environments: Help, please. Suggestion to change your undoubtedly misleading way with something stronger like the I18n gem And instead of using it, the browser's language (for example) you can do something in the first filter like this and in the helpers With this help, you only need a copy of your visual template, when you have only one element (for example ), Then reducing the complexity of changing all the visuals > If you want to test your Syantra app Such that it will work on your locks so you can throw to start your server before the app.rb is as follows:
requires 'sinatra' to set '/': erb,: views = & Gt; Settings.views + "/ en" erb: index, layout = & gt; False ,: View = & gt; Setting.views end get '/ tr': erb ,: views = & gt; Retrieve settings.views + "/ tr" ('/ home') Finally set '/ en': erb ,: views = & gt; Retrieve settings.views + "/ n" ('/ Home') '/ Home': 'Home' for 'Android' and 'Make Products': Product End ...
/ en and
/ tr URLs, then type me correctly
/ home link, but there is no change in the consideration folder.
Rack (1.4.1) Rack-Protection (1.2.0) Tilting (1.3.3) Papara (1.3. 3) Bundler (1.3.2)
. Set path_info when / ^ \ / tr / again: locale, "tr" and set: locale, "n" and end
Helpers get def get_locale settings.locale end # othe end of the example
RACK_ENV = output before.
RACK_ENV = Output Ruby my_app.rb
Comments
Post a Comment