Git Product home page Git Product logo

sinatra-hat's Introduction

Sinatra Hat

This is a set of extensions for Sinatra and relative gems such as Sequel, Haml, GetText.

It adds following functions to your Sinatra project:

  • Automatic translation using GetText or Fast_Gettext of Haml templates, and parser for po file generation
  • Several fixes for Sequel, Rack
  • Rack reloader for Sinatra and GetText translations
  • String permalinks and date extensions

Setup

1. Install

sudo gem install sinatra-hat

Or from source:

git clone git://github.com/nanoant/sinatra-hat.git
cd sinatra-hat && rake install

Author

Adam Strzelecki [email protected]

Released under MIT license, see MIT-LICENSE for details.

sinatra-hat's People

Contributors

nanoant avatar

Stargazers

Angus H. avatar Kirill Shaplyko avatar Colin Dean avatar

Watchers

 avatar James Cloos avatar  avatar

sinatra-hat's Issues

Where to put FastGettext configuration?

Thanks for creating this. It’s a great tool.

However, I’m having trouble figuring out where in my Sinatra app to put the FastGettext.add_text_domain and .text_domain call/set.

I’m using bundler to manage gems and have sinatra-hat and fast_gettext in my Gemfile. I also have gettext for :development so I can use its tools.

Inside my app file:

include FastGettext::Translation
require ‘gettext/haml’

Then, to configure FastGettext, I’ve got in in a configure block inside the class definition,

configure do
FastGettext.add_text_domain(‘uio’, :path => ‘locale’)
FastGettext.text_domain = ‘uio’
end

but I get this when I load the page:

FastGettext::Storage::NoTextDomainConfigured at /
Current textdomain (nil) was not added, use FastGettext.add_text_domain !

I’ve tried adding what’s in that configure to just under where I’m requiring gettext/haml, but to no avail.

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.