Skip to content

Commit 6535192

Browse files
authored
kde.cfg: added some *i18n() and *i18nc() functions (#6365)
see https://api.kde.org/frameworks/ki18n/html/prg_guide.html
1 parent 1f0ab48 commit 6535192

3 files changed

Lines changed: 50 additions & 2 deletions

File tree

cfg/kde.cfg

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,41 @@
4848
<not-uninit/>
4949
</arg>
5050
</function>
51+
<!-- QString i18n(const char*) -->
52+
<!-- QString xi18n(const char*) -->
53+
<function name="i18n,xi18n">
54+
<noreturn>false</noreturn>
55+
<pure/>
56+
<leak-ignore/>
57+
<returnValue type="QString"/>
58+
<arg nr="1" direction="in"/>
59+
</function>
60+
<!-- KLocalizedString ki18n(const char*) -->
61+
<function name="ki18n">
62+
<noreturn>false</noreturn>
63+
<pure/>
64+
<leak-ignore/>
65+
<returnValue type="KLocalizedString"/>
66+
<arg nr="1" direction="in"/>
67+
</function>
68+
ki18ncp()
69+
<!-- QString i18nc(const char*, const char*) -->
70+
<!-- QString xi18nc(const char*, const char*) -->
71+
<function name="i18nc,xi18nc">
72+
<noreturn>false</noreturn>
73+
<pure/>
74+
<leak-ignore/>
75+
<returnValue type="QString"/>
76+
<arg nr="1" direction="in"/>
77+
<arg nr="2" direction="in"/>
78+
</function>
79+
<!-- KLocalizedString ki18nc(const char*, const char*) -->
80+
<function name="ki18nc">
81+
<noreturn>false</noreturn>
82+
<pure/>
83+
<leak-ignore/>
84+
<returnValue type="KLocalizedString"/>
85+
<arg nr="1" direction="in"/>
86+
<arg nr="2" direction="in"/>
87+
</function>
5188
</def>

test/cfg/kde.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <cstdio>
1111
#include <KDE/KGlobal>
1212
#include <KDE/KConfigGroup>
13+
#include <klocalizedstring.h>
1314

1415
class k_global_static_testclass1 {};
1516
K_GLOBAL_STATIC(k_global_static_testclass1, k_global_static_testinstance1);
@@ -30,3 +31,13 @@ void ignoredReturnValue(const KConfigGroup& cfgGroup)
3031
// cppcheck-suppress ignoredReturnValue
3132
cfgGroup.readEntry("test");
3233
}
34+
35+
void i18n_test()
36+
{
37+
(void)i18n("Text");
38+
(void)xi18n("Text");
39+
(void)ki18n("Text");
40+
(void)i18nc("Text", "Context");
41+
(void)xi18nc("Text", "Context");
42+
(void)ki18nc("Text", "Context");
43+
}

tools/donate_cpu_lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
1717
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
1818
# changes)
19-
CLIENT_VERSION = "1.3.57"
19+
CLIENT_VERSION = "1.3.58"
2020

2121
# Timeout for analysis with Cppcheck in seconds
2222
CPPCHECK_TIMEOUT = 30 * 60
@@ -685,7 +685,7 @@ def __init__(self):
685685
'ginac': ['<ginac/', '"ginac/'],
686686
'googletest': ['<gtest/gtest.h>'],
687687
'gtk': ['<gtk', '<glib.h>', '<glib-', '<glib/', '<gdk/', '<gnome'],
688-
'kde': ['<KGlobal>', '<KApplication>', '<KDE/'],
688+
'kde': ['<KGlobal>', '<KApplication>', '<KDE/', '<klocalizedstring.h>'],
689689
'libcerror': ['<libcerror.h>'],
690690
'libcurl': ['<curl/curl.h>'],
691691
'libsigc++': ['<sigc++/'],

0 commit comments

Comments
 (0)