KUnitConversion

acceleration.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 "acceleration_p.h"
9#include "unit_p.h"
10
11#include <KLocalizedString>
12
13namespace KUnitConversion
14{
15UnitCategory Acceleration::makeCategory()
16{
17 auto c = UnitCategoryPrivate::makeCategory(AccelerationCategory, i18n("Acceleration"), i18n("Acceleration"));
18 auto d = UnitCategoryPrivate::get(c);
19 KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (acceleration)", "%1 %2");
20
21 d->addDefaultUnit(UnitPrivate::makeUnit(AccelerationCategory,
22 MetresPerSecondSquared,
23 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(UnitPrivate::makeUnit(AccelerationCategory,
32 FeetPerSecondSquared,
33 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(UnitPrivate::makeUnit(AccelerationCategory,
42 StandardGravity,
43 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
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 Mon Nov 18 2024 12:15:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.