
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
gem 'i18n_factory', group: :development
If you run rails g model
command, an i18n file which is described for the model will be automatically created to config/locales/<model_name>/<your_locale>.yml
.
e.g.)
$ bin/rails g model Post title content:text
will also create config/locales/post/en.yml
after the model files creation.
en:
activerecord:
models:
post: Post
attributes:
post:
title: Title
content: Content
Even if you already created the model, you can generate an i18n file.
Try to run the next command. It will update or create an i18n file, which got the model columns from the database schema.
$ bin/rails g i18n_factory:update ModelName
or
$ bin/rails g i18n_factory:update_all
[!WARNING] 既存のロケールファイルがある場合はそれを壊さないよう抜けている列のみをマージするように処理していますが、もしかしたらうまく動かない場合があるかもしれません。 うまく動かないパターンがあれば、Issue で教えていただければと思います。
i18n_factory find your application locale from I18n.locale
.
If you defined locale to ja
in config/application.rb
.
module YourApplicationName
class Application < Rails::Application
# ...
config.i18n.default_locale = :ja
end
end
It will create i18n files as config/locales/xxx/ja.yml
.
Try to edit config/environments/development.rb
Rails.application.configure do
# ...
config.after_initialize do
I18nFactory.configure do |factory|
factory.locales = [:ja, 'zh-TW']
end
end
end
It will create i18n files as
config/locales/xxx/ja.yml
config/locales/xxx/zh-TW.yml
If you defined I18nFactory.config.ignore_paths
, it will skip loading the files to create locale files when rails g i18n_factory:update_all
.
I18nFactory.configure do |factory|
factory.ignore_paths = ['app/models/foo/bar.rb']
end
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that i18n_factory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.