Lokalize seems to simply append a year to the "SPDX-FileCopyrightText:" line, whenever a person contributes the first time each year, resulting in long, convoluted lines like this one: # SPDX-FileCopyrightText: 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2017, 2018, 2019, 2020, 2021 Firstname Lastname <email@domain.tld> I think it would be better if "adjacent" years would be summarized into a range, so the above line would become # SPDX-FileCopyrightText: 2006, 2010-2021 Firstname Lastname <email@domain.tld> This is much easier to read and is already used in the GUI "About" dialogs all across the KDE software.
Thanks for the report. Is there a standard for these lines?
https://spdx.dev/use/specifications/
I meant specific to the format of SPDX-FileCopyrightText, for instance I don't want to change this line and then tooling that consumes the line breaks because the new format is unexpected.
8.8 says it's free form https://spdx.github.io/spdx-spec/v2.3/file-information/
(In reply to Finley Watson from comment #3) > I meant specific to the format of SPDX-FileCopyrightText, for instance I > don't want to change this line and then tooling that consumes the line > breaks because the new format is unexpected. I found these two sources: - https://reuse.software/spec-3.3/#format-of-copyright-notices - https://spdx.github.io/spdx-spec/v2.3/file-tags/ They both say that the proposed version is OK. So every tooling dealing with these lines *should* be able to parse them either way, I guess
Thanks both. I'll bear this bug in mind for a potential port to using libgettext instead of the handmade stuff Lokalize currently uses. In the mean time, I've found where the logic needs updating: https://invent.kde.org/sdk/lokalize/-/blob/master/src/catalog/gettextheaderparser.cpp?ref_type=heads#L75
(In reply to Philipp Kiemle from comment #0) > # SPDX-FileCopyrightText: 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2017, > 2018, 2019, 2020, 2021 Firstname Lastname <email@domain.tld> > > I think it would be better if "adjacent" years would be summarized into a > range, so the above line would become > > # SPDX-FileCopyrightText: 2006, 2010-2021 Firstname Lastname > <email@domain.tld> This looks wrong. Since the year 2016 is missing in the first list, I think the ranges should be: 2006, 2010-2015, 2017-2021
Yeah, you are right - I didn't see it was missing.
Git commit b005c91f8a1e0fff6af5d660d74d2232b5ff5b14 by Finley Watson, on behalf of Varun Sajith Dass. Committed on 07/02/2026 at 05:58. Pushed by finw into branch 'master'. Compress consecutive copyright years in Gettext headers ### Summary Implemented logic to automatically compress consecutive copyright years in the Gettext file headers. ### Changes * Added a static helper function `formatCopyrightYears` in `gettextheaderparser.cpp`. * The function parses existing years, sorts them, and groups consecutive sequences into ranges (e.g., "2020, 2021, 2022" becomes "2020-2022"). * Updated `updateAuthorCopyrightLine` to utilize this formatting logic. ### Testing Verified locally by running test cases against the logic: * Input: "2020, 2021, 2022" -\> Output: "2020-2022" * Input: "2020, 2021, 2023" -\> Output: "2020-2021, 2023" M +0 -1 autotests/test_gettextheaderparser.cpp M +68 -3 src/catalog/gettextheaderparser.cpp M +9 -1 src/catalog/gettextheaderparser.h https://invent.kde.org/sdk/lokalize/-/commit/b005c91f8a1e0fff6af5d660d74d2232b5ff5b14