Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

teamon-merb-simple-translation

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

teamon-merb-simple-translation

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

h2. merb-simple-translation

A plugin for the Merb framework that provides simple UI translation

h3. Installation

h4. Gem

@gem sources -a http://gems.github.com@ @sudo gem install teamon-merb-simple-translation@

h4. Configuration

config/dependencies.rb

dependency "teamon-merb-simple-translation", :require_as => "merb-simple-translation"

config/init.rb

Merb::BootLoader.after_app_loads do
  Translation.load
end

h3. Other options

h4. Reload translation files on every request

config/environments/development.rb


Merb::Config.use { |c|
  c[:translation_debug] = true
}

h4. Change translations dir (default PROJECT_ROOT/translations) or default language

config/init.rb

Merb::BootLoader.after_app_loads do
  Translation.translations_dir = Merb.root / 'i18n' 
  Translation.default_language = 'pl'
end

h3. Translation files

Plugin lets you write translations in two ways

h4. Ruby files

translations/pl.rb

Translation.add_translations('pl', {
  "Log in" => "Zaloguj"
})

h4. YAML files

translations/pl.yml

pl:
  Homepage: Strona domowa

h3. Copy default translation files to app directory @rake merb-simple-translation:copy-defaults@

FAQs

Package last updated on 10 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc