Created
February 24, 2012 14:50
-
-
Save okeen/1901417 to your computer and use it in GitHub Desktop.
Galizanizer Rails
This file contains 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
def galizanize(text, party) | |
country_name= case party | |
when :bng then "Galiza" | |
when :pp then "la región gallega" | |
else "Galicia" | |
end | |
text.gsub "Galicia", country_name | |
end | |
This file contains 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
%p= galizanize("Galicia mola millóns", :pp ) # <p>la region gallega mola millons </p> | |
%p= galizanize("Galicia mola millóns", :bng ) # <p>Galiza mola millons </p> | |
%p= galizanize("Galicia mola millóns", :bildu ) # <p>Galicia mola millons </p> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment