File indexing completed on 2024-12-22 04:40:14

0001 /*
0002     SPDX-FileCopyrightText: 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar>
0003     SPDX-FileCopyrightText: 2010-2022 Mladen Milinkovic <max@smoothware.net>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef LANGCODES_H
0009 #define LANGCODES_H
0010 
0011 #include <QString>
0012 
0013 class LanguageCode
0014 {
0015 public:
0016     /**
0017      * @brief toIso2
0018      * @param iso3Code ISO-3 language code
0019      * @return ISO-2 language code
0020      */
0021     static QString toIso2(const QString &iso3Code);
0022     /**
0023      * @brief toIso3
0024      * @param iso2Code ISO-2 language code
0025      * @return ISO-3 language code
0026      */
0027     static QString toIso3(const QString &iso2Code);
0028 
0029     /**
0030      * @brief nameFromIso2
0031      * @param iso2Code ISO-2 language code
0032      * @return Localized language name or "Unknown"
0033      */
0034     static QString nameFromIso2(const QString &iso2Code);
0035     /**
0036      * @brief nameFromIso3
0037      * @param iso3Code ISO-3 language code
0038      * @return Localized language name or "Unknown"
0039      */
0040     static QString nameFromIso3(const QString &iso3Code);
0041     /**
0042      * @brief nameFromIso
0043      * @param isoCode ISO-2 or ISO-3 language code
0044      * @return Localized language name or "Unknown (isoCode)"
0045      */
0046     static QString nameFromIso(const QString &isoCode);
0047 };
0048 
0049 #endif