translate_self 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +7 -0
- data/lib/translate_self/translation.rb +2 -1
- data/lib/translate_self/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7434934d496f14c0767302238db2351de6ca166dd8a137dbc53dac618198877d
|
4
|
+
data.tar.gz: b9973d4a3cb4b18129b847aec4cd95dca02ebe59d45c5180623d5d06b3146739
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f482c4f31471092e275417f5449ed87d7527ab85ed0067039b72c138dc1ec73698298621a303fa499279a9072fa4971fa67c39cc949b2acd601be70ad29bbc
|
7
|
+
data.tar.gz: 00bcd9a92d53dbd96a4672d038bd9fac0820986b03c2f7cf1052a2ee4d6f37fde69fc2d09f36ca2a9a36fe9cc93bb2f0c6c7fe20cede22398bbc695466e41109
|
data/CHANGELOG.md
CHANGED
@@ -30,4 +30,8 @@ Seems like you need to update it by hand!
|
|
30
30
|
|
31
31
|
## [0.7.0] - 2021-06-08
|
32
32
|
|
33
|
-
- Get rid of duplicated code. Update `benchmark.rb`.
|
33
|
+
- Get rid of duplicated code. Update `benchmark.rb`.
|
34
|
+
|
35
|
+
## [0.8.0] - 2021-06-08
|
36
|
+
|
37
|
+
- Add option to use the shorter `t_to_language_code` alias.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -31,6 +31,13 @@ Now you can translate it to your language of chose with this gem!
|
|
31
31
|
# 世界よ、ハローだ
|
32
32
|
```
|
33
33
|
|
34
|
+
What's even better is that you can also save some typing by using the shortened alias such as below:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
"hello world".t_to_ja # or t_to_fi, t_to_ru... endless possibilities!
|
38
|
+
# 世界よ、ハローだ
|
39
|
+
```
|
40
|
+
|
34
41
|
This gem uses the wonderful DeepL for Ruby as its backend.
|
35
42
|
|
36
43
|
https://github.com/wikiti/deepl-rb
|
@@ -33,7 +33,7 @@ module Translation
|
|
33
33
|
replace translate
|
34
34
|
end
|
35
35
|
|
36
|
-
# Translates the string itself to a language the user wants to translate it to.
|
36
|
+
# Translates the string itself to a language the user wants to translate it to.
|
37
37
|
# Sample usage:
|
38
38
|
# 'hello'.translate_to_fi
|
39
39
|
# # Hei
|
@@ -44,6 +44,7 @@ module Translation
|
|
44
44
|
define_method("translate_to_#{lan}") do |language = lan|
|
45
45
|
call_deepl(self, self.language, language)
|
46
46
|
end
|
47
|
+
alias_method "t_to_#{lan}", "translate_to_#{lan}"
|
47
48
|
end
|
48
49
|
|
49
50
|
private
|