KOSMIndoorMap

languages.h
1/*
2 SPDX-FileCopyrightText: 2023 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef OSM_LANGUAGES_H
7#define OSM_LANGUAGES_H
8
9#include "kosm_export.h"
10
11#include <string>
12#include <vector>
13
14class QLocale;
15
16namespace OSM {
17
18/** Languages in preference order to consider when looking up
19 * translated tag values.
20 * @see https://wiki.openstreetmap.org/wiki/Multilingual_names
21 * @see https://wiki.openstreetmap.org/wiki/Key:name#Variants
22 * @see https://wiki.openstreetmap.org/wiki/Names#Localization
23 */
25{
26public:
27 explicit Languages() = default;
28 Languages(Languages&&) noexcept = default;
29 Languages(const Languages&) = delete;
30 ~Languages() = default;
31 Languages& operator=(Languages&&) = default;
32 Languages& operator=(const Languages&) = delete;
33
34 /** Convert QLocale::uiLanguages() into an OSM::Languages set.
35 * The result should be cached in case of repeated use,
36 * QLocale::uiLanguages() is relatively expensive.
37 */
38 [[nodiscard]] KOSM_EXPORT static Languages fromQLocale(const QLocale &locale);
39
40 std::vector<std::string> languages;
41};
42
43}
44
45#endif
Languages in preference order to consider when looking up translated tag values.
Definition languages.h:25
static KOSM_EXPORT Languages fromQLocale(const QLocale &locale)
Convert QLocale::uiLanguages() into an OSM::Languages set.
Definition languages.cpp:40
Low-level types and functions to work with raw OSM data as efficiently as possible.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.