Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
h1. Globalize2
Globalize2 is the successor of Globalize for Rails.
It is compatible with and builds on the new "I18n api in Ruby on Rails":http://guides.rubyonrails.org/i18n.html. and adds model translations to ActiveRecord.
Globalize2 is much more lightweight and compatible than its predecessor was. Model translations in Globalize2 use default ActiveRecord features and do not limit any ActiveRecord functionality any more.
h2. Requirements
ActiveRecord I18n
(or Rails > 2.2)
h2. Installation
To install Globalize2 with its default setup just use:
script/plugin install git://github.com/joshmh/globalize2.git
h2. Model translations
Model translations allow you to translate your models' attribute values. E.g.
class Post < ActiveRecord::Base
translates :title, :text
end
Allows you to values for the attributes :title and :text per locale:
I18n.locale = :en
post.title # => Globalize2 rocks!
I18n.locale = :he
post.title # => גלובאלייז2 שולט!
In order to make this work, you'll need to add the appropriate translation tables. Globalize2 comes with a handy helper method to help you do this. It's called @create_translation_table!@. Here's an example:
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.timestamps
end
Post.create_translation_table! :title => :string, :text => :text
end
def self.down
drop_table :posts
Post.drop_translation_table!
end
end
Note that the ActiveRecord model @Post@ must already exist and have a @translates@ directive listing the translated fields.
h2. Migration from Globalize
See this script by Tomasz Stachewicz: http://gist.github.com/120867
h2. Changes since Globalize2 v0.1.0
h2. Alternative Solutions
h2. Related solutions
FAQs
Unknown package
We found that globalize2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.