Created
March 6, 2012 10:27
-
-
Save moonglum/1985578 to your computer and use it in GitHub Desktop.
Translator for Tobi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%head | |
%title I can haz chezburgerz plz? | |
%body | |
%h1 | |
Hai | |
= bronie |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'haml' | |
# read this var from yaml etc. | |
@translation = { | |
bronie: 'tobi', | |
java: 'java sucks' | |
} | |
template = File.read('./template.haml') | |
haml_engine = Haml::Engine.new(template) | |
output = haml_engine.render Object.new, @translation | |
puts output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment