KUnitConversion

force.cpp
1/*
2 * SPDX-FileCopyrightText: 2010 Petri Damstén <damu@iki.fi>
3 * SPDX-FileCopyrightText: 2014 John Layt <jlayt@kde.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#include "force_p.h"
9#include "unit_p.h"
10
11#include <KLocalizedString>
12
13namespace KUnitConversion
14{
15UnitCategory Force::makeCategory()
16{
17 auto c = UnitCategoryPrivate::makeCategory(ForceCategory, i18n("Force"), i18n("Force"));
18 auto d = UnitCategoryPrivate::get(c);
19 KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (force", "%1 %2");
20
21 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
22 Yottanewton,
23 1e+24,
24 i18nc("force unit symbol", "YN"),
25 i18nc("unit description in lists", "yottanewtons"),
26 i18nc("unit synonyms for matching user input", "yottanewton;yottanewtons;YN"),
27 symbolString,
28 ki18nc("amount in units (real)", "%1 yottanewtons"),
29 ki18ncp("amount in units (integer)", "%1 yottanewton", "%1 yottanewtons")));
30
31 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
32 Zettanewton,
33 1e+21,
34 i18nc("force unit symbol", "ZN"),
35 i18nc("unit description in lists", "zettanewtons"),
36 i18nc("unit synonyms for matching user input", "zettanewton;zettanewtons;ZN"),
37 symbolString,
38 ki18nc("amount in units (real)", "%1 zettanewtons"),
39 ki18ncp("amount in units (integer)", "%1 zettanewton", "%1 zettanewtons")));
40
41 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
42 Exanewton,
43 1e+18,
44 i18nc("force unit symbol", "EN"),
45 i18nc("unit description in lists", "exanewtons"),
46 i18nc("unit synonyms for matching user input", "exanewton;exanewtons;EN"),
47 symbolString,
48 ki18nc("amount in units (real)", "%1 exanewtons"),
49 ki18ncp("amount in units (integer)", "%1 exanewton", "%1 exanewtons")));
50
51 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
52 Petanewton,
53 1e+15,
54 i18nc("force unit symbol", "PN"),
55 i18nc("unit description in lists", "petanewtons"),
56 i18nc("unit synonyms for matching user input", "petanewton;petanewtons;PN"),
57 symbolString,
58 ki18nc("amount in units (real)", "%1 petanewtons"),
59 ki18ncp("amount in units (integer)", "%1 petanewton", "%1 petanewtons")));
60
61 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
62 Teranewton,
63 1e+12,
64 i18nc("force unit symbol", "TN"),
65 i18nc("unit description in lists", "teranewtons"),
66 i18nc("unit synonyms for matching user input", "teranewton;teranewtons;TN"),
67 symbolString,
68 ki18nc("amount in units (real)", "%1 teranewtons"),
69 ki18ncp("amount in units (integer)", "%1 teranewton", "%1 teranewtons")));
70
71 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
72 Giganewton,
73 1e+09,
74 i18nc("force unit symbol", "GN"),
75 i18nc("unit description in lists", "giganewtons"),
76 i18nc("unit synonyms for matching user input", "giganewton;giganewtons;GN"),
77 symbolString,
78 ki18nc("amount in units (real)", "%1 giganewtons"),
79 ki18ncp("amount in units (integer)", "%1 giganewton", "%1 giganewtons")));
80
81 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
82 Meganewton,
83 1e+06,
84 i18nc("force unit symbol", "MN"),
85 i18nc("unit description in lists", "meganewtons"),
86 i18nc("unit synonyms for matching user input", "meganewton;meganewtons;MN"),
87 symbolString,
88 ki18nc("amount in units (real)", "%1 meganewtons"),
89 ki18ncp("amount in units (integer)", "%1 meganewton", "%1 meganewtons")));
90
91 d->addCommonUnit(UnitPrivate::makeUnit(ForceCategory,
92 KilonewtonForce,
93 1000,
94 i18nc("force unit symbol", "kN"),
95 i18nc("unit description in lists", "kilonewtons"),
96 i18nc("unit synonyms for matching user input", "kilonewton;kilonewtons;kN"),
97 symbolString,
98 ki18nc("amount in units (real)", "%1 kilonewtons"),
99 ki18ncp("amount in units (integer)", "%1 kilonewton", "%1 kilonewtons")));
100
101 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
102 Hectonewton,
103 100,
104 i18nc("force unit symbol", "hN"),
105 i18nc("unit description in lists", "hectonewtons"),
106 i18nc("unit synonyms for matching user input", "hectonewton;hectonewtons;hN"),
107 symbolString,
108 ki18nc("amount in units (real)", "%1 hectonewtons"),
109 ki18ncp("amount in units (integer)", "%1 hectonewton", "%1 hectonewtons")));
110
111 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
112 Decanewton,
113 10,
114 i18nc("force unit symbol", "daN"),
115 i18nc("unit description in lists", "decanewtons"),
116 i18nc("unit synonyms for matching user input", "decanewton;decanewtons;daN"),
117 symbolString,
118 ki18nc("amount in units (real)", "%1 decanewtons"),
119 ki18ncp("amount in units (integer)", "%1 decanewton", "%1 decanewtons")));
120
121 d->addDefaultUnit(UnitPrivate::makeUnit(ForceCategory,
122 Newton,
123 1,
124 i18nc("force unit symbol", "N"),
125 i18nc("unit description in lists", "newtons"),
126 i18nc("unit synonyms for matching user input", "newton;newtons;N"),
127 symbolString,
128 ki18nc("amount in units (real)", "%1 newtons"),
129 ki18ncp("amount in units (integer)", "%1 newton", "%1 newtons")));
130
131 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
132 Decinewton,
133 0.1,
134 i18nc("force unit symbol", "dN"),
135 i18nc("unit description in lists", "decinewtons"),
136 i18nc("unit synonyms for matching user input", "decinewton;decinewtons;dN"),
137 symbolString,
138 ki18nc("amount in units (real)", "%1 decinewtons"),
139 ki18ncp("amount in units (integer)", "%1 decinewton", "%1 decinewtons")));
140
141 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
142 Centinewton,
143 0.01,
144 i18nc("force unit symbol", "cN"),
145 i18nc("unit description in lists", "centinewtons"),
146 i18nc("unit synonyms for matching user input", "centinewton;centinewtons;cN"),
147 symbolString,
148 ki18nc("amount in units (real)", "%1 centinewtons"),
149 ki18ncp("amount in units (integer)", "%1 centinewton", "%1 centinewtons")));
150
151 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
152 Millinewton,
153 0.001,
154 i18nc("force unit symbol", "mN"),
155 i18nc("unit description in lists", "millinewtons"),
156 i18nc("unit synonyms for matching user input", "millinewton;millinewtons;mN"),
157 symbolString,
158 ki18nc("amount in units (real)", "%1 millinewtons"),
159 ki18ncp("amount in units (integer)", "%1 millinewton", "%1 millinewtons")));
160
161 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
162 Micronewton,
163 1e-06,
164 i18nc("force unit symbol", "µN"),
165 i18nc("unit description in lists", "micronewtons"),
166 i18nc("unit synonyms for matching user input", "micronewton;micronewtons;µm;uN"),
167 symbolString,
168 ki18nc("amount in units (real)", "%1 micronewtons"),
169 ki18ncp("amount in units (integer)", "%1 micronewton", "%1 micronewtons")));
170
171 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
172 Nanonewton,
173 1e-09,
174 i18nc("force unit symbol", "nN"),
175 i18nc("unit description in lists", "nanonewtons"),
176 i18nc("unit synonyms for matching user input", "nanonewton;nanonewtons;nN"),
177 symbolString,
178 ki18nc("amount in units (real)", "%1 nanonewtons"),
179 ki18ncp("amount in units (integer)", "%1 nanonewton", "%1 nanonewtons")));
180
181 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
182 Piconewton,
183 1e-12,
184 i18nc("force unit symbol", "pN"),
185 i18nc("unit description in lists", "piconewtons"),
186 i18nc("unit synonyms for matching user input", "piconewton;piconewtons;pN"),
187 symbolString,
188 ki18nc("amount in units (real)", "%1 piconewtons"),
189 ki18ncp("amount in units (integer)", "%1 piconewton", "%1 piconewtons")));
190
191 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
192 Femtonewton,
193 1e-15,
194 i18nc("force unit symbol", "fN"),
195 i18nc("unit description in lists", "femtonewtons"),
196 i18nc("unit synonyms for matching user input", "femtonewton;femtonewtons;fN"),
197 symbolString,
198 ki18nc("amount in units (real)", "%1 femtonewtons"),
199 ki18ncp("amount in units (integer)", "%1 femtonewton", "%1 femtonewtons")));
200
201 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
202 Attonewton,
203 1e-18,
204 i18nc("force unit symbol", "aN"),
205 i18nc("unit description in lists", "attonewtons"),
206 i18nc("unit synonyms for matching user input", "attonewton;attonewtons;aN"),
207 symbolString,
208 ki18nc("amount in units (real)", "%1 attonewtons"),
209 ki18ncp("amount in units (integer)", "%1 attonewton", "%1 attonewtons")));
210
211 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
212 Zeptonewton,
213 1e-21,
214 i18nc("force unit symbol", "zN"),
215 i18nc("unit description in lists", "zeptonewtons"),
216 i18nc("unit synonyms for matching user input", "zeptonewton;zeptonewtons;zN"),
217 symbolString,
218 ki18nc("amount in units (real)", "%1 zeptonewtons"),
219 ki18ncp("amount in units (integer)", "%1 zeptonewton", "%1 zeptonewtons")));
220
221 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
222 Yoctonewton,
223 1e-24,
224 i18nc("force unit symbol", "yN"),
225 i18nc("unit description in lists", "yoctonewtons"),
226 i18nc("unit synonyms for matching user input", "yoctonewton;yoctonewtons;yN"),
227 symbolString,
228 ki18nc("amount in units (real)", "%1 yoctonewtons"),
229 ki18ncp("amount in units (integer)", "%1 yoctonewton", "%1 yoctonewtons")));
230
231 // http://en.wikipedia.org/wiki/Force#Units_of_measurement
232 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
233 Dyne,
234 0.0001,
235 i18nc("force unit symbol", "dyn"),
236 i18nc("unit description in lists", "dynes"),
237 i18nc("unit synonyms for matching user input", "dyne;dynes;dyn"),
238 symbolString,
239 ki18nc("amount in units (real)", "%1 dynes"),
240 ki18ncp("amount in units (integer)", "%1 dyne", "%1 dynes")));
241
242 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
243 Kilopond,
244 9.80665,
245 i18nc("force unit symbol", "kp"),
246 i18nc("unit description in lists", "kiloponds"),
247 i18nc("unit synonyms for matching user input", "kilogram-force;kilopond;kiloponds;kp"),
248 symbolString,
249 ki18nc("amount in units (real)", "%1 kiloponds"),
250 ki18ncp("amount in units (integer)", "%1 kilopond", "%1 kiloponds")));
251
252 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
253 PoundForce,
254 4.448222,
255 i18nc("force unit symbol", "lbf"),
256 i18nc("unit description in lists", "pound-force"),
257 i18nc("unit synonyms for matching user input", "pound-force;lbf"),
258 symbolString,
259 ki18nc("amount in units (real)", "%1 pound-force"),
260 ki18ncp("amount in units (integer)", "%1 pound-force", "%1 pound-force")));
261
262 d->addUnit(UnitPrivate::makeUnit(ForceCategory,
263 Poundal,
264 0.138255,
265 i18nc("force unit symbol", "pdl"),
266 i18nc("unit description in lists", "poundals"),
267 i18nc("unit synonyms for matching user input", "poundal;poundals;pdl"),
268 symbolString,
269 ki18nc("amount in units (real)", "%1 poundals"),
270 ki18ncp("amount in units (integer)", "%1 poundal", "%1 poundals")));
271
272 return c;
273}
274
275} // KUnitConversion namespace
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.