
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Translate your apps with pleasure (sort of...) and for free. It's simple i18n web interface, build on top of twitter bootstrap, that one may find helpful in translating app by non-technicals.
Highly inspired by Copycopter by thoughtbot.
date.abbr_day_names
)Check wiki: Screenshots
lit
gem to your Gemfile
gem 'lit'
For Ruby < 1.9 use gem 'lit', '= 0.2.4'
, as next versions introduced new ruby hash syntax.
run bundle install
run installation generator bundle exec rails g lit:install
(for production/staging environment redis
is suggested as key value engine. hash
will not work in multi process environment)
Add config.i18n.available_locales = [...]
to application.rb
- it's required to precompile appropriate language flags in lit backend.
After doing above and restarting app, point your browser to http://app/lit
Profit!
You may want to take a look at generated initializer in config/initializers/lit.rb
and change some default configuration options.
Lit is Rails engine - it runs in it's own namespace, by default it's avaulable under /lit
. It provides UI for managing translations of your app.
Once you call I18n.t()
function from your views, Lit is asked whether it has or not proper value for it. If translation is present in database and is available for Lit, it's served back. If it does not exists, record is automatically created in database with initial value provided in default
option key. If default
key is not present, value nil
is saved to database. When app is starting, Lit will preload all keys from your local config/locale/*.yml
files - this is why app startup may take a while.
To optimize translation key lookup, Lit can use different cache engines. For production with many workers redis
is suggested, for local development hash
will be fine (hash
is stored in memory, so if you have many workers and will update translation value in backend, only one worker will have proper translation in it's cache - db will be updated anyway).
Keys ending with _html
have auto wysiwyg support.
You can also export translations using rake task
$ rake lit:export
You may also give it extra env variables to limit the export results.
$ LOCALES=en,de rake lit:export
gem 'lit', '~> 0.3.0'
bundle update lit
config.i18n.available_locales
to your application.rb
(see 3rd point from Installation info)config.i18n.enforce_available_locales = true
config to your application.rb
lit.rb
initializer with template.Add Lit::FrontendHelper
to your ApplicationController
helper Lit::FrontendHelper
In you layout file include lit assets
<% if admin_user_signed_in? %>
<%= lit_frontend_assets %>
<% end %>
You're good to go - now log in to lit (if required) and open your frontend in separate tab (to have session persisted). On the bottom-right of your page you should see "Enable / disable lit highlight" - after enabling it you'll be able to click and translate phrases directly in your frontend
Once enabled, all translations called via t
helper function be rendered inside <span />
tag, what may break your layout (ie if you're using translated values as button values or as placeholders, etc). To avoid that add skip_lit: true
to t()
call or use I18n.t
.
This feature requires jQuery! (at least for now)
Include Lit::Concerns::RequestInfoStore
concern in your ApplicationController
include Lit::Concerns::RequestInfoStore
In lit initializer (lit.rb
) set store_request_info
config to true
Lit.store_request_info = true
Add Lit::FrontendHelper
in your ApplicationController
include Lit::FrontendHelper
Include Lit::Concerns::RequestKeysStore
concern in your ApplicationController
include Lit::Concerns::RequestKeysStore
On the bottom of you layout file call lit_translations_info
helper function
<%= lit_translations_info %>
From now on you'll be able to see all translation keys that were used to render current page. This feature works great with on-site live translations!
Lit authorized user must be signed in for this feature to work! This feature requires jQuery!
date.abbr_day_names
)I18n.t('not_exising_keys', default: lambda{|_, options| 'text'})
)For local testing Appraisal gem comes into play, run tests via: bundle exec appraisal rails-4.2 rake test
.
Please remember to edit test/dummy/config/database.yml
file
Lit is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
FAQs
Unknown package
We found that motorefi-lit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.