| 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2009 Petri Damstén <damu@iki.fi> |
| 3 | * SPDX-FileCopyrightText: 2014 John Layt <jlayt@kde.org> |
| 4 | * SPDX-FileCopyrightText: 2023 Nate Graham <nate@kde.org> |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.0-or-later |
| 7 | */ |
| 8 | |
| 9 | #include "weight_per_area_p.h" |
| 10 | #include "unit.h" |
| 11 | #include "unit_p.h" |
| 12 | |
| 13 | #include <KLocalizedString> |
| 14 | |
| 15 | namespace KUnitConversion |
| 16 | { |
| 17 | UnitCategory WeightPerArea::makeCategory() |
| 18 | { |
| 19 | auto c = UnitCategoryPrivate::makeCategory(id: WeightPerAreaCategory, i18n("Weight per Area" ), i18n("Weight per Area" )); |
| 20 | auto d = UnitCategoryPrivate::get(category: c); |
| 21 | KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (weight per area)" , "%1 %2" ); |
| 22 | |
| 23 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: AreaCategory, |
| 24 | id: GramsPerSquareMeter, |
| 25 | multiplier: 1, |
| 26 | i18nc("area unit symbol" , "g/m²" ), |
| 27 | i18nc("unit description in lists" , "grams per square meter" ), |
| 28 | i18nc("unit synonyms for matching user input" , "gsm;g/m;g/m2;gm2;grams per meter;grams per square meter;grams per meter²" ), |
| 29 | symbolString, |
| 30 | ki18nc("amount in units (real)" , "%1 grams per square meter" ), |
| 31 | ki18ncp("amount in units (integer)" , "%1 grams per square meter" , "%1 grams per square meter" ))); |
| 32 | |
| 33 | // source: https://www.ginifab.com/feeds/ozyd2_gm2/ |
| 34 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: AreaCategory, |
| 35 | id: OuncesPerSquareYard, |
| 36 | multiplier: 33.906, |
| 37 | i18nc("area unit symbol" , "oz/yd²" ), |
| 38 | i18nc("unit description in lists" , "ounces per square yard" ), |
| 39 | i18nc("unit synonyms for matching user input" , "ozyd;ozyd2;oz/yd;oz/yd2;ounces per yard;ounces per square yard;ounces per yard²" ), |
| 40 | symbolString, |
| 41 | ki18nc("amount in units (real)" , "%1 ounces per square yard" ), |
| 42 | ki18ncp("amount in units (integer)" , "%1 ounces per square yard" , "%1 ounces per square yard" ))); |
| 43 | |
| 44 | return c; |
| 45 | } |
| 46 | |
| 47 | } // KUnitConversion namespace |
| 48 | |