Guest User

Untitled

a guest
Jun 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment