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
on the client side's HTML HEAD tag you include: | |
<script src="/dictionary.js" type="text/javascript" charset="utf-8"></script> | |
<script> | |
var current_language = "italian"; | |
</script> | |
you manage current_language variable according to user's langauge | |
and where translated text is needed you use the amazing <dictkey> tag: |
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
class Node | |
attr_accessor :children | |
attr_accessor :title | |
def general_deep_copy | |
Marshal.load(Marshal.dump(self)) | |
end | |
def specific_deep_copy | |
Node.new(@title,children.map(&:specific_deep_copy)) |
NewerOlder