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

i18n-remote_backend

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-remote_backend

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

I18n::RemoteBackend

I18n backend for loading remote locales via HTTP.

Installation

Put the following in your Gemfile:

gem 'i18n-remote_backend', require: 'i18n/remote_backend', git: 'git@github.com:mudasirraza/i18n-remote_backend.git'

After updating your bundle, run the installer

$ rails g i18n:remote_backend:install

It generates a new file in config/initializers named i18n_remote_backend.rb with the following content.

require 'i18n/backend/remote_backend'

I18n.backend = I18n::Backend::Chain.new(I18n::Backend::RemoteBackend.new, I18n::Backend::Simple.new)

I18n::Backend::RemoteBackend.configure do |config|
  # config.http_url = ''
end

Set the http_url accordingly. e.g https://example-url/locales The corresponding generated requests will look like: https://example-url/locales/en or https://example-url/locales/fr etc. And it should respond back with the yaml file content.

If a remote translation is unavailable, it will fall back to a local translation.

Usage

You can then use I18n.t('text').

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mudasirraza/i18n-remote_backend.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 24 Jan 2023

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