File indexing completed on 2024-04-28 03:58:36

0001 /*
0002  *   SPDX-FileCopyrightText: 2009 Petri Damstén <damu@iki.fi>
0003  *   SPDX-FileCopyrightText: 2014 John Layt <jlayt@kde.org>
0004  *   SPDX-FileCopyrightText: 2023 Nate Graham <nate@kde.org>
0005  *
0006  *   SPDX-License-Identifier: LGPL-2.0-or-later
0007  */
0008 
0009 #include "weight_per_area_p.h"
0010 #include "unit.h"
0011 #include "unit_p.h"
0012 
0013 #include <KLocalizedString>
0014 
0015 namespace KUnitConversion
0016 {
0017 UnitCategory WeightPerArea::makeCategory()
0018 {
0019     auto c = UnitCategoryPrivate::makeCategory(WeightPerAreaCategory, i18n("Weight per Area"), i18n("Weight per Area"));
0020     auto d = UnitCategoryPrivate::get(c);
0021     KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (weight per area)", "%1 %2");
0022 
0023     d->addCommonUnit(UnitPrivate::makeUnit(AreaCategory,
0024                                      GramsPerSquareMeter,
0025                                      1,
0026                                      i18nc("area unit symbol", "g/m²"),
0027                                      i18nc("unit description in lists", "grams per square meter"),
0028                                      i18nc("unit synonyms for matching user input", "gsm;g/m;g/m2;gm2;grams per meter;grams per square meter;grams per meter²"),
0029                                      symbolString,
0030                                      ki18nc("amount in units (real)", "%1 grams per square meter"),
0031                                      ki18ncp("amount in units (integer)", "%1 grams per square meter", "%1 grams per square meter")));
0032 
0033     // source: https://www.ginifab.com/feeds/ozyd2_gm2/
0034     d->addCommonUnit(UnitPrivate::makeUnit(AreaCategory,
0035                                            OuncesPerSquareYard,
0036                                            33.906,
0037                                            i18nc("area unit symbol", "oz/yd²"),
0038                                            i18nc("unit description in lists", "ounces per square yard"),
0039                                            i18nc("unit synonyms for matching user input", "ozyd;ozyd2;oz/yd;oz/yd2;ounces per yard;ounces per square yard;ounces per yard²"),
0040                                            symbolString,
0041                                            ki18nc("amount in units (real)", "%1 ounces per square yard"),
0042                                            ki18ncp("amount in units (integer)", "%1 ounces per square yard", "%1 ounces per square yard")));
0043 
0044     return c;
0045 }
0046 
0047 } // KUnitConversion namespace