File: fcitxqti18nhelper.h

package info (click to toggle)
fcitx5-qt 5.1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,340 kB
  • sloc: cpp: 11,697; xml: 243; ansic: 46; makefile: 14; sh: 9
file content (26 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * SPDX-FileCopyrightText: 2017~2017 CSSlayer <wengxt@gmail.com>
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 *
 */
#ifndef _WIDGETSADDONS_FCITXQTI18NHELPER_H_
#define _WIDGETSADDONS_FCITXQTI18NHELPER_H_

#include <QString>
#include <fcitx-utils/i18n.h>

namespace fcitx {

inline QString tr2fcitx(const char *message, const char *comment = nullptr) {
    if (comment && comment[0] && message && message[0]) {
        return QString(C_(comment, message));
    } else if (message && message[0]) {
        return QString(_(message));
    } else {
        return QString();
    }
}
} // namespace fcitx

#endif // _WIDGETSADDONS_FCITXQTI18NHELPER_H_