
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Language detection gem using detectlanguage.com api. Returns the language of a string or a symbol.
Add this line to your application's Gemfile:
gem 'tongues'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install tongues
The gem installed, you need to generate the initializer file:
rails generate tongues:initializer
Add your detectlanguage.com api key inside config/initializers/tongues.rb:
Tongues.configure do |config|
require 'tongues'
config.api_key = ''
end
You are now ready to use the gem
"how you get a String language".tongue # => "ENGLISH"
"how you get a String language code".tongue_code # => "en"
"how you get the confidence in a language detection".tongue_confidence # => 15.09
"is this english".en? # => true
"is this english".english? # => true
:"how you get a Symbol language".tongue # => "ENGLISH"
:"how you get a Symbol language code".tongue_code # => "en"
:"how you get the confidence in a language detection".tongue_confidence # => 15.09
:"is this english".en? # => true
:"is this english".english? # => true
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that tongues 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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.