daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env rackup
  2.  
  3. # Load dependencies
  4. require 'rubygems'
  5. require 'ramaze'
  6. require 'ramaze/helper/localize'
  7.  
  8. # Configure localization
  9. DICTIONARY = Ramaze::Helper::Localize::Dictionary.new
  10. locales = {
  11.   'en' => [ 'en' ],
  12.   'nl' => [ 'nl-be', 'nl-nl' ]
  13. }
  14. locales.each_pair do |code, code_aliases|
  15.   code_aliases.each do |code_alias|
  16.     DICTIONARY.load(code_alias, :yaml => File.dirname(__FILE__) + "/locales/#{code}.yaml")
  17.   end
  18. end
  19.  
  20. # Create main controller
  21. class MainController < Ramaze::Controller
  22.  
  23.   helper :localize
  24.  
  25.   def index
  26.     puts "LOCALES: " + locales.inspect
  27.    
  28.     l('Hello World')
  29.   end
  30.  
  31. private
  32.  
  33.   def localize_dictionary
  34.     DICTIONARY
  35.   end
  36.  
  37. end
  38.  
  39.  
  40. # Start
  41. Ramaze.start(:started => true)
  42. run Innate
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top