KTextAddons

yandexengineclient.cpp
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "yandexengineclient.h"
8#include "translator/misc/translatorutil.h"
9#include "yandexengineplugin.h"
10#include <KLocalizedString>
11
12YandexEngineClient::YandexEngineClient(QObject *parent)
13 : TextTranslator::TranslatorEngineClient{parent}
14{
15}
16
17YandexEngineClient::~YandexEngineClient() = default;
18
19QString YandexEngineClient::name() const
20{
21 return QStringLiteral("yandex");
22}
23
24QString YandexEngineClient::translatedName() const
25{
26 return i18n("Yandex");
27}
28
29TextTranslator::TranslatorEnginePlugin *YandexEngineClient::createTranslator()
30{
31 return new YandexEnginePlugin();
32}
33
34QMap<TextTranslator::TranslatorUtil::Language, QString> YandexEngineClient::supportedFromLanguages()
35{
36 if (mFromLanguages.isEmpty()) {
37 mFromLanguages = fillLanguages();
38 }
39 return mFromLanguages;
40}
41
42QMap<TextTranslator::TranslatorUtil::Language, QString> YandexEngineClient::supportedToLanguages()
43{
44 return supportedFromLanguages();
45}
46
47TextTranslator::TranslatorEngineClient::EngineType YandexEngineClient::engineType() const
48{
49 return TextTranslator::TranslatorEngineClient::Network;
50}
51
52bool YandexEngineClient::isSupported(TextTranslator::TranslatorUtil::Language lang) const
53{
54 switch (lang) {
55 case TextTranslator::TranslatorUtil::tl:
56 return false;
57 default:
58 break;
59 }
60 return true;
61}
62
63#include "moc_yandexengineclient.cpp"
QString i18n(const char *text, const TYPE &arg...)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.