Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue with Yandex Translate #43

Closed
dordenis opened this issue Mar 15, 2023 · 4 comments
Closed

[BUG] Issue with Yandex Translate #43

dordenis opened this issue Mar 15, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@dordenis
Copy link

User report

Description: ADD A SHORT DESCRIPTION HERE


Debugger data (do not alter)

plugin_version: "1.4.4"
platform: "Desktop"
framework_version: "1.1.9"
obsidian_version: "1.1.16"

@Fevol
Copy link
Owner

Fevol commented Mar 15, 2023

Thanks for the issue report @dordenis!

Would you mind describing the bug you have with Yandex translate for me? I don't have access to the service myself sadly, so to fix it, I need to know what exactly the issue is.

Many thanks in advance!

@Fevol Fevol self-assigned this Mar 15, 2023
@Fevol Fevol added the bug Something isn't working label Mar 15, 2023
@Fevol Fevol changed the title [BUG] Yandex Translate – ADD A TITLE HERE [BUG] Issue with Yandex Translate Jun 29, 2023
@Fevol
Copy link
Owner

Fevol commented Jul 11, 2023

If you're encountering an issue with Yandex Translate, please reply in this thread and give detailed information how/in what way the service does not work.

I cannot access the service myself, so your feedback would be much appreciated.

@xsa-dev
Copy link

xsa-dev commented Feb 7, 2024

I have some issue.
Я создал сервисный аккаунт и создал API-KEY для того чтобы заполнить соответсвующее поле в плагине.
По нажатию на кнопку: TEST я получаю сообщение о том что API key is invalid.

Но этот сниппет работает нормально и токен одинаковый:

import requests

IAM_TOKEN = 'AQVNyIxmg5_jhpkURtnqB3XJywZ6G5kXYFFnikbF'
target_language = 'ru'
texts = ["Hello", "World"]

body = {
    "targetLanguageCode": target_language,
    "texts": texts,
}

headers = {
    "Content-Type": "application/json",
    "Authorization": "Api-Key {0}".format(IAM_TOKEN)
}

response = requests.post('https://translate.api.cloud.yandex.net/translate/v2/translate',
    json = body,
    headers = headers
)

print(response.text)

Результат:

image

@Fevol
Copy link
Owner

Fevol commented Feb 9, 2024

Many thanks for the detailed explanation and example, this made it much easier to debug the issue.

It turns out, I was using an older version of the API, which doesn't seem to be supported anymore (or is just buggy)

I took the liberty to test out the API a bit with the key you provided, and verified that everything works as expected. (You should probably revoke it, just in case.)

The new version should be releasing soon!


Большое спасибо за подробное объяснение и пример, это значительно облегчило отладку проблемы.

Оказывается, я использовал старую версию API, которая, похоже, больше не поддерживается (или просто глючит).

Я взял на себя смелость немного протестировать API с помощью ключа, который вы предоставили, и убедился, что все работает так, как ожидалось. (Возможно, вам следует отозвать его, на всякий случай).

Новая версия должна выйти в ближайшее время!

@Fevol Fevol closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants