Giter Club home page Giter Club logo

merb_global's Introduction

MerbGlobal README

A plugin for the Merb framework providing Localization (L10n) and Internationalization (i18n) support.

merb_global will have the following feature set:

  • support for model (content) localization

    • by default, localization stored in the database
      • with DataMapper (targeted 0.1)
      • with ActiveRecord (targeted 0.2)
      • with Sequel ORM
    • and, with a choice of strategies in each case:
      • single-table (c.f. globalize RoR plugin)

          |title   |varchar(100)|
          |title_de|varchar(100)|
          |title_fr|varchar(100)|
        
      • joined-table for unlimited localizations (c.f. Symfony PHP)

    • or, alternatively localizations can be stored outside of the domain model, UI Strings.
  • support for view (UI String) localization

    • choice of providers (po, yaml, database)

        Merb::Plugins.config[:merb_global] = {
          #:message_provider => "po",   # default
          :message_provider => 'yaml'
          #:message_provider => active_record
          #:message_provider => data_mapper
          #:message_provider => sequel
        }
      
    • for JRuby, wrapper allowing use of .properties files.

  • Extract, update for PO/POT files

  • Currency, Date and Language Helpers - stored either in the database, or for JRuby, wrappers around built-in functionality provided by java.util.Currency, java.util.Locale

  • support for localization of Merb generated code

  • support for non-English Inflectors.

Developer ReadMe

REQUEST : Your development support is very much appreciated. Please contact us below if you're interested in lending a hand with the development of this project.

Getting the Source

Performing a git clone on either of the following repositories will get you the latest source:

git clone git://github.com/myabc/merb_global.git
git clone git://gitorious.org/merb_global/mainline.git (on gitorious)

The following additional mirrors are available:

git://repo.or.cz/merb_global.git
http://repo.or.cz/r/merb_global.git

Installation and Setup

Dependencies:
sudo gem install gettext

Installing MerbGlobal
rake gem
sudo gem install pkg/merb_global-0.0.1.gem

Configuration options

MerbGlobal is possible to configure with:

Merb::Plugins.config[:merb_global] = {
    :message_provider => 'gettext'
    ...
 }

in init.rb or using plugins.yml file:

:merb_global:
    :message_provider: gettext
    ...

Configuration options:

  • :message_provider

    What message provider we want to use.

    Values: gettext, yaml, sequel, active_record, data_mapper Default: gettext

  • :date_provider

    What date provider we want to use.

    Values: fork Default: fork

  • :numeric_providers

    What numeric provider we want to use.

    Values: fork Default: fork

  • :flat

    Are we running merb-flat or normal merb?

    Values: true/false Default: false

  • :localedir

    Define directory where translations are stored.

    If :flat is set to true than MerbGlobal will search in #{Merb.root}+'locale'. If :flat is false than in #{Merb.root}+:localedir. When :flat is false and :localedir configuration is not defined the default will be #{Merb.root}+'app/locale'.

  • :gettext => :domain

    Name of the text domain. Which is basically name of the GetText MO file without .mo extension.

    Default: merbapp

##Configuration examples

Follwing configuraiton in plugins.yml:

:merb_global:
    :provider:  gettext
    :flat:      false
    :localedir: locale
:gettext:
    :domain:    messages

will make MerbGlobal to search translations in following places:

#{Merb.root}/locale/#{language}/LC_MESSAGES/messages.mo
#{Merb.root}/locale/#{language}/messages.mo

Where #{language} is string which defines language such as cs_CZ, en_GB or just cs, en.

No configuration will look at:

#{Merb.root}/app/locale/#{language}/LC_MESSAGES/merbapp.mo
#{Merb.root}/app/locale/#{language}/merbapp.mo

Licensing and Copyright

MerbGlobal is released under an MIT License. Copyright information, as well as a copy of the License may be found in the LICENSE file.

Support

WARNING REPEATED : MerbGlobal at an early stage of its development. You should not use this code unless you're reasonably secure with both Ruby and Merb. That said, please do get involved!

Your best sources for support are currently the wiki, IRC or our mailing list:

merb_global's People

Contributors

fbettag avatar fmardini avatar fry-devbot avatar giom avatar lastobelus avatar myabc avatar pk avatar uzytkownik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.