libreoffice-online/common/LangUtil.hpp
Patrick Luby 7dd1e505e6 Fix issue #5841 welcome, feedback, and buy product URLs are empty on mobile
Mobile apps don't substitute these values so set them to zero length
strings.

Also, the iOS app sets the base text direction via the "dir" parameter
so add handling of that parameter in cool.html. TODO: check if the
Android and GTK apps need to implement the "dir" parameter to handle
RTL layout.

Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: Ied8268ec256011281961ef610d53baeee0efe9cd
2023-03-15 09:29:56 +01:00

34 lines
1 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <string>
namespace LangUtil
{
bool isRtlLanguage(const std::string& language)
{
if (language.rfind("ar", 0) == 0 ||
language.rfind("arc", 0) == 0 ||
language.rfind("dv", 0) == 0 ||
language.rfind("fa", 0) == 0 ||
language.rfind("ha", 0) == 0 ||
language.rfind("he", 0) == 0 ||
language.rfind("khw", 0) == 0 ||
language.rfind("ks", 0) == 0 ||
language.rfind("ku", 0) == 0 ||
language.rfind("ps", 0) == 0 ||
language.rfind("ur", 0) == 0 ||
language.rfind("yi", 0) == 0)
return true;
return false;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */