[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loolwsd.xml.in wsd/LOOLWSD.cpp

Jan Holesovsky kendy at collabora.com
Sat Jan 27 10:04:35 UTC 2018


 loolwsd.xml.in  |    2 ++
 wsd/LOOLWSD.cpp |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit e8fd8ca01f1946b835075422ab7001c3d3f896f2
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Jan 26 20:57:54 2018 +0100

    wsd: Support for configuration of the allowed languages.
    
    Change-Id: I233619b89ac61aeaab4ba96f1f52773802cfd7ae
    Reviewed-on: https://gerrit.libreoffice.org/48721
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 31ab1a07..724a3d67 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -3,6 +3,8 @@
     <!-- Note: 'default' attributes are used to document a setting's default value as well as to use as fallback. -->
     <!-- Note: When adding a new entry, a default must be set in WSD in case the entry is missing upon deployment. -->
 
+    <allowed_languages desc="List of supported languages on this instance." default="de_DE en_GB en_US es_ES fr_FR it pt_BR pt_PT ru">de_DE en_GB en_US es_ES fr_FR it pt_BR pt_PT ru</allowed_languages>
+
     <tile_cache_path desc="Path to a directory where to keep the tile cache." type="path" relative="false" default="@LOOLWSD_CACHEDIR@"></tile_cache_path>
     <sys_template_path desc="Path to a template tree with shared libraries etc to be used as source for chroot jails for child processes." type="path" relative="true" default="systemplate"></sys_template_path>
     <lo_template_path desc="Path to a LibreOffice installation tree to be copied (linked) into the jails for child processes. Should be on the same file system as systemplate." type="path" relative="false" default="@LO_PATH@"></lo_template_path>
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 591071c1..4c417d02 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -637,7 +637,8 @@ void LOOLWSD::initialize(Application& self)
 
     // Add default values of new entries here.
     static const std::map<std::string, std::string> DefAppConfig
-        = { { "tile_cache_path", LOOLWSD_CACHEDIR },
+        = { { "allowed_languages", "de_DE en_GB en_US es_ES fr_FR it pt_BR pt_PT ru" },
+            { "tile_cache_path", LOOLWSD_CACHEDIR },
             { "tile_cache_persistent", "true" },
             { "sys_template_path", "systemplate" },
             { "lo_template_path", LO_PATH },
@@ -798,6 +799,9 @@ void LOOLWSD::initialize(Application& self)
     LOOLWSD::SSLTermination.set(false);
 #endif
 
+    std::string allowedLanguages(config().getString("allowed_languages"));
+    setenv("LOK_WHITELIST_LANGUAGES", allowedLanguages.c_str(), 1);
+
     Cache = getPathFromConfig("tile_cache_path");
     SysTemplate = getPathFromConfig("sys_template_path");
     LoTemplate = getPathFromConfig("lo_template_path");


More information about the Libreoffice-commits mailing list