We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5271a49 commit 5a5733eCopy full SHA for 5a5733e
src/deepl/translator.cr
@@ -453,7 +453,9 @@ module DeepL
453
end
454
455
def get_usage : Usage
456
- if auth_key_is_free_account?
+ if auth_key_is_mock? # FIXME: Workaround for testing
457
+ get_usage_free
458
+ elsif auth_key_is_free_account?
459
get_usage_free
460
else
461
get_usage_pro
@@ -470,6 +472,10 @@ module DeepL
470
472
auth_key.ends_with?(":fx")
471
473
474
475
+ private def auth_key_is_mock? : Bool
476
+ auth_key == "mock"
477
+ end
478
+
479
def guess_target_language : String
480
tl = ENV["DEEPL_TARGET_LANG"]?
481
return tl if tl
0 commit comments