7dd1e505e6
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
34 lines
1 KiB
C++
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: */
|