active_translate_self 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/active_translate_self/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8be859b957fdf07c519a5c1afb68e870bfdee5854a81d329cf76029133a5efb6
|
4
|
+
data.tar.gz: 91231060b8ebb7a55dab987c6382d795b10b928c23e853e72637adfa76965571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5501a76025408a66aed069b2b535316943a19d7c08e9d0d2ae7400619e4bd8e95c814b6b70e08ab31375b491ae818fd6ce53de06d0065765a9951863d7adc0a1
|
7
|
+
data.tar.gz: bf8dd0cbae15e93188a2e6ffd21c0fe6710b919be289771fb9ea3f1d5ef0d24e8a8f8f6aacfb3a109654f45c61ff3e9946a5caaa0a2e43aa0063da6600b57951
|
data/README.md
CHANGED
@@ -10,8 +10,23 @@ Finnish, English, Japanese, Russian!
|
|
10
10
|
Translate Ruby strings in Rails to a language of your choice!
|
11
11
|
Any and all languages supported, as long as they're also supported by DeepL. If your language is not supported at the moment, you just need to wait a bit. Or make a PR for TranslateSelf to add Google Translate backend to it.
|
12
12
|
|
13
|
+
## Supported languages:
|
14
|
+
|
15
|
+
supported languages are: Bulgarian, Chinese, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Latvian, Lithuanian, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, and Swedish.
|
16
|
+
|
13
17
|
## Usage
|
14
18
|
Easy to use!
|
19
|
+
|
20
|
+
Now your models get superpowers if they have string fields:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
user = User.find(2020)
|
24
|
+
user.favorite_food # or any field name that is a string in Ruby
|
25
|
+
# hamburgers
|
26
|
+
user.favorite_food.to_ru # or to_fi, to_es, to_ja...
|
27
|
+
# гамбургер
|
28
|
+
```
|
29
|
+
|
15
30
|
Just get a DeepL auth key (free!), and create an initializer(`config/initializers/active_translate_self.rb`), add the auth key to your Rails credentials file with the following command:
|
16
31
|
```shell
|
17
32
|
$ EDITOR="vim" rails credentials:edit
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_translate_self
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sampo Kuokkanen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|