Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malept/t12r
Transliterator: Ruby I18n.transliterate speedup written in Rust
https://github.com/malept/t12r
gem i18n ruby rust transliterator
Last synced: 4 days ago
JSON representation
Transliterator: Ruby I18n.transliterate speedup written in Rust
- Host: GitHub
- URL: https://github.com/malept/t12r
- Owner: malept
- License: apache-2.0
- Created: 2016-11-03T01:21:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-12T18:44:10.000Z (over 5 years ago)
- Last Synced: 2024-10-24T16:08:50.331Z (14 days ago)
- Topics: gem, i18n, ruby, rust, transliterator
- Language: Ruby
- Size: 25.4 KB
- Stars: 1
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# T12r
[![Build Status](https://travis-ci.org/data-axle/t12r.svg?branch=master)](https://travis-ci.org/data-axle/t12r)
T12r (or Transliterator) is a speedup and enhancement for the [`i18n` gem](https://rubygems.org/gems/i18n)'s
`I18n.transliterate` method, using a Rust-based native extension. It supports more characters
out-of-the-box.## Requirements
* Ruby ≥ 2.4
* [Rust](http://www.rust-lang.org/) (if you build from source)If you're using t12r on macOS without Rust installed, please note that the prebuilt binaries are built
with the following xcode versions:* macOS 10.13: xcode 10.1
* macOS 10.14: xcode 10.2Since they are built on Travis CI, prebuilt macOS binaries may require libgmp (`brew install gmp`
or equivalent).## Usage
To speed up existing calls to `I18n.transliterate`, add this `gem` line to your `Gemfile`, after you
declare `gem 'i18n'`:```ruby
gem 't12r', require: 't12r/i18n_monkeypatch'
```To only use `T12r.transliterate` directly, omit the `require` argument.
### Example
```ruby
> T12r.transliterate('…yes?')
=> '...yes?'
> T12r.transliterate('Input string…', ' ' => '-')
=> 'Input-string...'
```# Legal
This project is copyrighted by Infogroup, under the terms of the Apache License (version 2.0). See
`LICENSE` for details.