Created: 2008-03-08 16:10
Updated: 2017-07-25 13:13
License: mit


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)|
      • 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://
git clone git:// (on gitorious)

The following additional mirrors are available:


Installation and Setup

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:

    :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:

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

will make MerbGlobal to search translations in following places:


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

No configuration will look at:


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.


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:

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more