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 "acceleration_p.h" |
9 | #include "unit_p.h" |
10 | |
11 | #include <KLocalizedString> |
12 | |
13 | namespace KUnitConversion |
14 | { |
15 | UnitCategory Acceleration::makeCategory() |
16 | { |
17 | auto c = UnitCategoryPrivate::makeCategory(id: AccelerationCategory, i18n("Acceleration" ), i18n("Acceleration" )); |
18 | auto d = UnitCategoryPrivate::get(category: c); |
19 | KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (acceleration)" , "%1 %2" ); |
20 | |
21 | d->addDefaultUnit(unit: UnitPrivate::makeUnit(categoryId: AccelerationCategory, |
22 | id: MetresPerSecondSquared, |
23 | multiplier: 1, |
24 | i18nc("acceleration unit symbol" , "m/s²" ), |
25 | i18nc("unit description in lists" , "meters per second squared" ), |
26 | i18nc("unit synonyms for matching user input" , "meter per second squared;meters per second squared;m/s²;m/s2;m/s^2" ), |
27 | symbolString, |
28 | ki18nc("amount in units (real)" , "%1 meters per second squared" ), |
29 | ki18ncp("amount in units (integer)" , "%1 meter per second squared" , "%1 meters per second squared" ))); |
30 | |
31 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: AccelerationCategory, |
32 | id: FeetPerSecondSquared, |
33 | multiplier: 0.3048, |
34 | i18nc("acceleration unit symbol" , "ft/s²" ), |
35 | i18nc("unit description in lists" , "feet per second squared" ), |
36 | i18nc("unit synonyms for matching user input" , "foot per second squared;feet per second squared;ft/s²;ft/s2;ft/s^2" ), |
37 | symbolString, |
38 | ki18nc("amount in units (real)" , "%1 feet per second squared" ), |
39 | ki18ncp("amount in units (integer)" , "%1 foot per second squared" , "%1 feet per second squared" ))); |
40 | |
41 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: AccelerationCategory, |
42 | id: StandardGravity, |
43 | multiplier: 9.80665, |
44 | i18nc("acceleration unit symbol" , "g" ), |
45 | i18nc("unit description in lists" , "standard gravity" ), |
46 | i18nc("unit synonyms for matching user input" , "standard gravity;g" ), |
47 | symbolString, |
48 | ki18nc("amount in units (real)" , "%1 times standard gravity" ), |
49 | ki18ncp("amount in units (integer)" , "%1 standard gravity" , "%1 times standard gravity" ))); |
50 | |
51 | return c; |
52 | } |
53 | |
54 | } // KUnitConversion namespace |
55 | |