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.
activeadmin-translate
Advanced tools
Translate your Globalize3 ActiveModel translations in ActiveAdmin, using jQueryUI tabs to switch between the locales.
Add the gem to your Gemfile
gem 'activeadmin-translate'
and install it with Bundler:
$ bundle
ActiveAdmin Translate takes the available languages from I18n.available_locales
, so you want to configure them in
your application.rb
like
config.i18n.available_locales = [:en, :de, :fr, :it]
You need to import the SASS for styling the tabs to app/assets/stylesheets/active_admin.css.scss
:
@import "active_admin/translate";
In order to access the translations of your model and be able to write them on save, you need to make attributes
accessible in your model. Globalize3 stores the model translations in a separate table that is accessible as
translations
in your model:
class GlobalizedModel < ActiveRecord::Base
attr_accessible :translations, :translations_attributes
accepts_nested_attributes_for :translations
end
To translate your form you need to use the translate_inputs
form helper:
form do |f|
f.translate_inputs do |t|
t.input :title
t.input :description
end
end
To show the attributes for all locales, you use the translate_attributes_table_for
view helper:
show do |model|
panel 'Globalized Model' do
translate_attributes_table_for model do
row :title
row :description do |p|
BlueCloth.new(p.teaser).to_html.html_safe
end
end
end
end
To localize your locale names, use the following I18n key structure per locale:
en:
active_admin:
translate:
en: "English"
and add more translations with the registered locale symbol.
Developed by Michael Kessler, mksoft.ch.
If you like ActiveAdmin Translate, you can watch the repository at GitHub and follow @netzpirat on Twitter for project updates.
You can report bugs and feature requests to GitHub Issues.
Please don't ask question in the issue tracker, instead ask them at Stackoverflow and use the activeadmin tag.
When you file a bug, please try to follow these simple rules if applicable:
It's most likely that your bug gets resolved faster if you provide as much information as possible!
Pull requests are very welcome! Please try to follow these simple rules if applicable:
See the CHANGELOG and the GitHub list of contributors.
This project has taken some ideas and code from the following projects:
Copyright (c) 2012 Michael Kessler
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that activeadmin-translate 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.
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.