translate_self 0.7.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 680f027a575420fab6eb29bbdb7a49a0410e8b6e51adb0775c6dc884539d84bc
4
- data.tar.gz: 51afe0c1d56642d3a9b0d6b2578de001da729a10f8c05b2f61a8ed04f383d639
3
+ metadata.gz: 7434934d496f14c0767302238db2351de6ca166dd8a137dbc53dac618198877d
4
+ data.tar.gz: b9973d4a3cb4b18129b847aec4cd95dca02ebe59d45c5180623d5d06b3146739
5
5
  SHA512:
6
- metadata.gz: ead7740d0183cb4959789c62ebebd6ed2bc5a3f528d1b1a4b1e97e71e3607b30dbf52686878dc5bb60e566be3516bcbdd23cfc7e9237cc2ddf0647ac0405a9f2
7
- data.tar.gz: 42b7fa5b9d7c68b98fd6884c24808834287c2b0ec63b252970c43bb3fe4083bd5c3a6c3aff5d474fac478ae7b33d8de59dc735c9ad42c9014d1f11167682e65b
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- translate_self (0.7.0)
4
+ translate_self (0.8.0)
5
5
  deepl-rb
6
6
 
7
7
  GEM
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
@@ -1,3 +1,3 @@
1
1
  module TranslateSelf
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translate_self
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen