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

transmating

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transmating

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Transmating

Transmating adds i18n information to Mongoid documents. Simply include Transmating::I18n to your model classes which include Mongoid::Document.

class Person
  include Mongoid::Document
  include Transmating::I18n

  field :name
  field :organization
end

Transmating::I18n adds a simple embeds_many relationship to your models, which is placeholder for translated attributes. You can translate your models with calling Transmating::I18n#translate method as presented below.

# Translate your model objects
p = Person.find_by_name("Yuna Kim")
p.translate("ko", :name => "김연아", :organization => "고려대")

After translation, you can utilize it by calling Transmating::I18n#translated method.

<!-- Present translated attributes in your views -->
안녕하세요! <%= @person.translated("ko").name %>님!

That's it. Feel free to fork and add your own features!

FAQs

Package last updated on 09 Jan 2012

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