summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2023-01-09 04:10:33 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-01-12 08:22:35 +0000
commit41caa548b4655ab9be5e778cb7835584add8470c (patch)
tree6e2e522ea36201918224fc3ae90956695952161a
parentResolves: tdf#152950 don't set_active while frozen (diff)
downloadcore-41caa548b4655ab9be5e778cb7835584add8470c.tar.gz
core-41caa548b4655ab9be5e778cb7835584add8470c.zip
Make DeepL translator experimental for now
Needs documentation. Change-Id: If77436a37b5ec40f3eb08a32f0315c1696428c12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145184 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 0a2b048482e079e4e83307ad00ba7704a4cc815e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145232 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--cui/source/options/treeopt.cxx8
-rw-r--r--sw/source/uibase/shells/textsh1.cxx8
2 files changed, 16 insertions, 0 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 805ddfc48317..8004c7f15a11 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1418,6 +1418,14 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
nPageId = static_cast<sal_uInt16>(SID_LANGUAGE_OPTIONS_RES[i].second);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
+
+ // Disable DeepL translation settings, if experimental mode is not enabled
+ if( RID_SVXPAGE_DEEPL_OPTIONS == nPageId )
+ {
+ if( ! officecfg::Office::Common::Misc::ExperimentalMode::get() )
+ continue;
+ }
+
if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || SvtCJKOptions::IsJapaneseFindEnabled() ) &&
( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || SvtCJKOptions::IsAsianTypographyEnabled() ) &&
( RID_SVXPAGE_OPTIONS_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) )
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 3b6f8baa9626..832f6d7820c1 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -105,6 +105,8 @@
#include <authfld.hxx>
#include <config_wasm_strip.h>
#if !ENABLE_WASM_STRIP_EXTRA
+#include <officecfg/Office/Common.hxx>
+#include <svl/visitem.hxx>
#include <translatelangselect.hxx>
#include <svtools/deeplcfg.hxx>
#endif // ENABLE_WASM_STRIP_EXTRA
@@ -2065,6 +2067,12 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case SID_FM_TRANSLATE:
{
#if !ENABLE_WASM_STRIP_EXTRA
+ if (!officecfg::Office::Common::Misc::ExperimentalMode::get()
+ && !comphelper::LibreOfficeKit::isActive())
+ {
+ rSet.Put(SfxVisibilityItem(nWhich, false));
+ break;
+ }
const SvxDeeplOptions& rDeeplOptions = SvxDeeplOptions::Get();
if (rDeeplOptions.getAPIUrl().isEmpty() || rDeeplOptions.getAuthKey().isEmpty())
{