![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Ruby internationalization and localization (i18n) solution.
Currently maintained by @radar.
You will most commonly use this library within a Rails app.
We support Rails versions from 6.0 and up.
See the Rails Guide for an example of its usage.
We support Ruby versions from 3.0 and up.
If you want to use this library without Rails, you can simply add i18n
to your Gemfile
:
gem 'i18n'
Then configure I18n with some translations, and a default locale:
I18n.load_path += Dir[File.expand_path("config/locales") + "/*.yml"]
I18n.default_locale = :en # (note that `en` is already the default!)
A simple translation file in your project might live at config/locales/en.yml
and look like:
en:
test: "This is a test"
You can then access this translation by doing:
I18n.t(:test)
You can switch locales in your project by setting I18n.locale
to a different value:
I18n.locale = :de
I18n.t(:test) # => "Dies ist ein Test"
For more information and lots of resources see the 'Resources' page on the wiki.
You can run tests both with
rake test
or just rake
ruby -Ilib:test test/api/simple_test.rb
You can run all tests against all Gemfiles with
ruby test/run_all.rb
The structure of the test suite is a bit unusual as it uses modules to reuse particular tests in different test cases.
The reason for this is that we need to enforce the I18n API across various combinations of extensions. E.g. the Simple backend alone needs to support the same API as any combination of feature and/or optimization modules included to the Simple backend. We test this by reusing the same API definition (implemented as test methods) in test cases with different setups.
You can find the test cases that enforce the API in test/api. And you can find the API definition test methods in test/api/tests.
All other test cases (e.g. as defined in test/backend, test/core_ext) etc. follow the usual test setup and should be easy to grok.
Additional documentation can be found here: https://github.com/ruby-i18n/i18n/wiki
MIT License. See the included MIT-LICENSE file.
FAQs
Unknown package
We found that i18n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.