1 | /* |
2 | * Copyright (C) 2010 Petri Damstén <damu@iki.fi> |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU Library General Public License as |
6 | * published by the Free Software Foundation; either version 2, or |
7 | * (at your option) any later version. |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details |
13 | * |
14 | * You should have received a copy of the GNU Library General Public |
15 | * License along with this program; if not, write to the |
16 | * Free Software Foundation, Inc., |
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #include "acceleration.h" |
21 | #include "converter.h" |
22 | #include <klocale.h> |
23 | |
24 | using namespace KUnitConversion; |
25 | |
26 | Acceleration::Acceleration() : UnitCategory(AccelerationCategory) |
27 | { |
28 | setName(i18n("Acceleration" )); |
29 | setSymbolStringFormat(ki18nc("%1 value, %2 unit symbol (acceleration)" , "%1 %2" )); |
30 | |
31 | setDefaultUnit(UP(MetresPerSecondSquared, 1, |
32 | i18nc("acceleration unit symbol" , "m/s²" ), |
33 | i18nc("unit description in lists" , "meters per second squared" ), |
34 | i18nc("unit synonyms for matching user input" , |
35 | "meter per second squared;meters per second squared;m/s²;m/s2;m/s^2" ), |
36 | ki18nc("amount in units (real)" , "%1 meters per second squared" ), |
37 | ki18ncp("amount in units (integer)" , "%1 meter per second squared" , |
38 | "%1 meters per second squared" ) |
39 | )); |
40 | U(FeetPerSecondSquared, 0.3048, |
41 | i18nc("acceleration unit symbol" , "ft/s²" ), |
42 | i18nc("unit description in lists" , "feet per second squared" ), |
43 | i18nc("unit synonyms for matching user input" , |
44 | "foot per second squared;feet per second squared;ft/s²;ft/s2;ft/s^2" ), |
45 | ki18nc("amount in units (real)" , "%1 feet per second squared" ), |
46 | ki18ncp("amount in units (integer)" , "%1 foot per second squared" , |
47 | "%1 feet per second squared" ) |
48 | ); |
49 | U(StandardGravity, 9.80665, |
50 | i18nc("acceleration unit symbol" , "g" ), |
51 | i18nc("unit description in lists" , "standard gravity" ), |
52 | i18nc("unit synonyms for matching user input" , "standard gravity;g" ), |
53 | ki18nc("amount in units (real)" , "%1 times standard gravity" ), |
54 | ki18ncp("amount in units (integer)" , "%1 standard gravity" , |
55 | "%1 times standard gravity" ) |
56 | ); |
57 | |
58 | setMostCommonUnits(QList<int>() << |
59 | MetresPerSecondSquared << FeetPerSecondSquared); |
60 | } |
61 | |
62 | |