1 | /* |
2 | * SPDX-FileCopyrightText: 2010 Petri Damstén <damu@iki.fi> |
3 | * SPDX-FileCopyrightText: 2014 John Layt <jlayt@kde.org> |
4 | * SPDX-FileCopyrightText: 2014 Garret Wassermann <gwasser@gmail.com> |
5 | * |
6 | * SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #include "electrical_current_p.h" |
10 | #include "unit_p.h" |
11 | |
12 | #include <KLocalizedString> |
13 | |
14 | namespace KUnitConversion |
15 | { |
16 | UnitCategory ElectricalCurrent::makeCategory() |
17 | { |
18 | auto c = UnitCategoryPrivate::makeCategory(id: ElectricalCurrentCategory, i18n("ElectricalCurrent" ), i18n("ElectricalCurrent" )); |
19 | auto d = UnitCategoryPrivate::get(category: c); |
20 | KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (electrical current" , "%1 %2" ); |
21 | |
22 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
23 | id: Yottaampere, |
24 | multiplier: 1e+24, |
25 | i18nc("electrical current unit symbol" , "YA" ), |
26 | i18nc("unit description in lists" , "yottaamperes" ), |
27 | i18nc("unit synonyms for matching user input" , "yottaampere;yottaamperes;YA" ), |
28 | symbolString, |
29 | ki18nc("amount in units (real)" , "%1 yottaamperes" ), |
30 | ki18ncp("amount in units (integer)" , "%1 yottaampere" , "%1 yottaamperes" ))); |
31 | |
32 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
33 | id: Zettaampere, |
34 | multiplier: 1e+21, |
35 | i18nc("electrical current unit symbol" , "ZA" ), |
36 | i18nc("unit description in lists" , "zettaamperes" ), |
37 | i18nc("unit synonyms for matching user input" , "zettaampere;zettaamperes;ZA" ), |
38 | symbolString, |
39 | ki18nc("amount in units (real)" , "%1 zettaamperes" ), |
40 | ki18ncp("amount in units (integer)" , "%1 zettaampere" , "%1 zettaamperes" ))); |
41 | |
42 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
43 | id: Exaampere, |
44 | multiplier: 1e+18, |
45 | i18nc("electrical current unit symbol" , "EA" ), |
46 | i18nc("unit description in lists" , "exaamperes" ), |
47 | i18nc("unit synonyms for matching user input" , "exaampere;exaamperes;EA" ), |
48 | symbolString, |
49 | ki18nc("amount in units (real)" , "%1 exaamperes" ), |
50 | ki18ncp("amount in units (integer)" , "%1 exaampere" , "%1 exaamperes" ))); |
51 | |
52 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
53 | id: Petaampere, |
54 | multiplier: 1e+15, |
55 | i18nc("electrical current unit symbol" , "PA" ), |
56 | i18nc("unit description in lists" , "petaamperes" ), |
57 | i18nc("unit synonyms for matching user input" , "petaampere;petaamperes;PA" ), |
58 | symbolString, |
59 | ki18nc("amount in units (real)" , "%1 petaamperes" ), |
60 | ki18ncp("amount in units (integer)" , "%1 petaampere" , "%1 petaamperes" ))); |
61 | |
62 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
63 | id: Teraampere, |
64 | multiplier: 1e+12, |
65 | i18nc("electrical current unit symbol" , "TA" ), |
66 | i18nc("unit description in lists" , "teraamperes" ), |
67 | i18nc("unit synonyms for matching user input" , "teraampere;teraamperes;TA" ), |
68 | symbolString, |
69 | ki18nc("amount in units (real)" , "%1 teraamperes" ), |
70 | ki18ncp("amount in units (integer)" , "%1 teraampere" , "%1 teraamperes" ))); |
71 | |
72 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
73 | id: Gigaampere, |
74 | multiplier: 1e+09, |
75 | i18nc("electrical current unit symbol" , "GA" ), |
76 | i18nc("unit description in lists" , "gigaamperes" ), |
77 | i18nc("unit synonyms for matching user input" , "gigaampere;gigaamperes;GA" ), |
78 | symbolString, |
79 | ki18nc("amount in units (real)" , "%1 gigaamperes" ), |
80 | ki18ncp("amount in units (integer)" , "%1 gigaampere" , "%1 gigaamperes" ))); |
81 | |
82 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
83 | id: Megaampere, |
84 | multiplier: 1e+06, |
85 | i18nc("electrical current unit symbol" , "MA" ), |
86 | i18nc("unit description in lists" , "megaamperes" ), |
87 | i18nc("unit synonyms for matching user input" , "megaampere;megaamperes;MA" ), |
88 | symbolString, |
89 | ki18nc("amount in units (real)" , "%1 megaamperes" ), |
90 | ki18ncp("amount in units (integer)" , "%1 megaampere" , "%1 megaamperes" ))); |
91 | |
92 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
93 | id: Kiloampere, |
94 | multiplier: 1000, |
95 | i18nc("electrical current unit symbol" , "kA" ), |
96 | i18nc("unit description in lists" , "kiloamperes" ), |
97 | i18nc("unit synonyms for matching user input" , "kiloampere;kiloamperes;kA" ), |
98 | symbolString, |
99 | ki18nc("amount in units (real)" , "%1 kiloamperes" ), |
100 | ki18ncp("amount in units (integer)" , "%1 kiloampere" , "%1 kiloamperes" ))); |
101 | |
102 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
103 | id: Hectoampere, |
104 | multiplier: 100, |
105 | i18nc("electrical current unit symbol" , "hA" ), |
106 | i18nc("unit description in lists" , "hectoamperes" ), |
107 | i18nc("unit synonyms for matching user input" , "hectoampere;hectoamperes;hA" ), |
108 | symbolString, |
109 | ki18nc("amount in units (real)" , "%1 hectoamperes" ), |
110 | ki18ncp("amount in units (integer)" , "%1 hectoampere" , "%1 hectoamperes" ))); |
111 | |
112 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
113 | id: Decaampere, |
114 | multiplier: 10, |
115 | i18nc("electrical current unit symbol" , "daA" ), |
116 | i18nc("unit description in lists" , "decaamperes" ), |
117 | i18nc("unit synonyms for matching user input" , "decaampere;decaamperes;daA" ), |
118 | symbolString, |
119 | ki18nc("amount in units (real)" , "%1 decaamperes" ), |
120 | ki18ncp("amount in units (integer)" , "%1 decaampere" , "%1 decaamperes" ))); |
121 | |
122 | d->addDefaultUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
123 | id: Ampere, |
124 | multiplier: 1, |
125 | i18nc("electrical current unit symbol" , "A" ), |
126 | i18nc("unit description in lists" , "amperes" ), |
127 | i18nc("unit synonyms for matching user input" , "amp;amps;ampere;amperes;A" ), |
128 | symbolString, |
129 | ki18nc("amount in units (real)" , "%1 amperes" ), |
130 | ki18ncp("amount in units (integer)" , "%1 ampere" , "%1 amperes" ))); |
131 | |
132 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
133 | id: Deciampere, |
134 | multiplier: 0.1, |
135 | i18nc("electrical current unit symbol" , "dA" ), |
136 | i18nc("unit description in lists" , "deciamperes" ), |
137 | i18nc("unit synonyms for matching user input" , "deciampere;deciamperes;dA" ), |
138 | symbolString, |
139 | ki18nc("amount in units (real)" , "%1 deciamperes" ), |
140 | ki18ncp("amount in units (integer)" , "%1 deciampere" , "%1 deciamperes" ))); |
141 | |
142 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
143 | id: Centiampere, |
144 | multiplier: 0.01, |
145 | i18nc("electrical current unit symbol" , "cA" ), |
146 | i18nc("unit description in lists" , "centiamperes" ), |
147 | i18nc("unit synonyms for matching user input" , "centiampere;centiamperes;cA" ), |
148 | symbolString, |
149 | ki18nc("amount in units (real)" , "%1 centiamperes" ), |
150 | ki18ncp("amount in units (integer)" , "%1 centiampere" , "%1 centiamperes" ))); |
151 | |
152 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
153 | id: Milliampere, |
154 | multiplier: 0.001, |
155 | i18nc("electrical current unit symbol" , "mA" ), |
156 | i18nc("unit description in lists" , "milliamperes" ), |
157 | i18nc("unit synonyms for matching user input" , "milliamp;milliamps;milliampere;milliamperes;mA" ), |
158 | symbolString, |
159 | ki18nc("amount in units (real)" , "%1 milliamperes" ), |
160 | ki18ncp("amount in units (integer)" , "%1 milliampere" , "%1 milliamperes" ))); |
161 | |
162 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
163 | id: Microampere, |
164 | multiplier: 1e-06, |
165 | i18nc("electrical current unit symbol" , "µA" ), |
166 | i18nc("unit description in lists" , "microamperes" ), |
167 | i18nc("unit synonyms for matching user input" , "microamp;microamps;microampere;microamperes;µA;uA" ), |
168 | symbolString, |
169 | ki18nc("amount in units (real)" , "%1 microamperes" ), |
170 | ki18ncp("amount in units (integer)" , "%1 microampere" , "%1 microamperes" ))); |
171 | |
172 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
173 | id: Nanoampere, |
174 | multiplier: 1e-09, |
175 | i18nc("electrical current unit symbol" , "nA" ), |
176 | i18nc("unit description in lists" , "nanoamperes" ), |
177 | i18nc("unit synonyms for matching user input" , "nanoamp;nanoamps;nanoampere;nanoamperes;nA" ), |
178 | symbolString, |
179 | ki18nc("amount in units (real)" , "%1 nanoamperes" ), |
180 | ki18ncp("amount in units (integer)" , "%1 nanoampere" , "%1 nanoamperes" ))); |
181 | |
182 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
183 | id: Picoampere, |
184 | multiplier: 1e-12, |
185 | i18nc("electrical current unit symbol" , "pA" ), |
186 | i18nc("unit description in lists" , "picoamperes" ), |
187 | i18nc("unit synonyms for matching user input" , "picoamp;picoamps;picoampere;picoamperes;pA" ), |
188 | symbolString, |
189 | ki18nc("amount in units (real)" , "%1 picoamperes" ), |
190 | ki18ncp("amount in units (integer)" , "%1 picoampere" , "%1 picoamperes" ))); |
191 | |
192 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
193 | id: Femtoampere, |
194 | multiplier: 1e-15, |
195 | i18nc("electrical current unit symbol" , "fA" ), |
196 | i18nc("unit description in lists" , "femtoamperes" ), |
197 | i18nc("unit synonyms for matching user input" , "femtoampere;femtoamperes;fA" ), |
198 | symbolString, |
199 | ki18nc("amount in units (real)" , "%1 femtoamperes" ), |
200 | ki18ncp("amount in units (integer)" , "%1 femtoampere" , "%1 femtoamperes" ))); |
201 | |
202 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
203 | id: Attoampere, |
204 | multiplier: 1e-18, |
205 | i18nc("electrical current unit symbol" , "aA" ), |
206 | i18nc("unit description in lists" , "attoamperes" ), |
207 | i18nc("unit synonyms for matching user input" , "attoampere;attoamperes;aA" ), |
208 | symbolString, |
209 | ki18nc("amount in units (real)" , "%1 attoamperes" ), |
210 | ki18ncp("amount in units (integer)" , "%1 attoampere" , "%1 attoamperes" ))); |
211 | |
212 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
213 | id: Zeptoampere, |
214 | multiplier: 1e-21, |
215 | i18nc("electrical current unit symbol" , "zA" ), |
216 | i18nc("unit description in lists" , "zeptoamperes" ), |
217 | i18nc("unit synonyms for matching user input" , "zeptoampere;zeptoamperes;zA" ), |
218 | symbolString, |
219 | ki18nc("amount in units (real)" , "%1 zeptoamperes" ), |
220 | ki18ncp("amount in units (integer)" , "%1 zeptoampere" , "%1 zeptoamperes" ))); |
221 | |
222 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalCurrentCategory, |
223 | id: Yoctoampere, |
224 | multiplier: 1e-24, |
225 | i18nc("electrical current unit symbol" , "yA" ), |
226 | i18nc("unit description in lists" , "yoctoamperes" ), |
227 | i18nc("unit synonyms for matching user input" , "yoctoampere;yoctoamperes;yA" ), |
228 | symbolString, |
229 | ki18nc("amount in units (real)" , "%1 yoctoamperes" ), |
230 | ki18ncp("amount in units (integer)" , "%1 yoctoampere" , "%1 yoctoamperes" ))); |
231 | |
232 | return c; |
233 | } |
234 | |
235 | } // KUnitConversion namespace |
236 | |