README.md in translate_self-0.5.0 vs README.md in translate_self-0.6.0
- old
+ new
@@ -17,12 +17,16 @@
```sh
export DEEPL_AUTH_KEY="your-api-token"
```
-This gem currently hardcodes the free DeepL servers. # TODO
+By default this gem uses the free DeepL servers, but you can also configure your own:
+```sh
+export DEEPL_HOST="non-free-host"
+```
+
Now you can translate it to your language of chose with this gem!
```ruby
"hello world".translate_to_ja
# 世界よ、ハローだ
```
@@ -89,9 +93,26 @@
```ruby
hello = TranslatableString.new('hello', language: 'en', to_language: 'fi')
hello.translate
# "Moi"
```
+
+## Benchmark
+
+Create a string 5000000 times.
+
+```shell
+C:\home\sampo\translate_self> ruby benchmark.rb
+Rehearsal -------------------------------------------------------
+normal string 0.252435 0.000000 0.252435 ( 0.252490)
+translatable string 0.299736 0.000000 0.299736 ( 0.299789)
+---------------------------------------------- total: 0.552171sec
+
+ user system total real
+normal string 0.237091 0.000000 0.237091 ( 0.237091)
+translatable string 0.237607 0.000000 0.237607 ( 0.237611)
+```
+So... the overhead might be surprisingly low!
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.