backintime icon indicating copy to clipboard operation
backintime copied to clipboard

translation: Improve meta-data handling (authors, licence, copyright, ...)

Open buhtz opened this issue 1 year ago • 0 comments

The meta data in the po-files is messy (e.g. authors, license, version). Our Weblate platform seems not to be able to handle things like this. So we need to manage that by our own. This is an example of one po-file header

# Swedish translation for backintime
# Copyright (c) 2008 Rosetta Contributors and Canonical Ltd 2008
# This file is distributed under the same license as the backintime package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2008.
#
msgid ""
msgstr ""
"Project-Id-Version: backintime\n"
"Report-Msgid-Bugs-To: https://github.com/bit-team/backintime\n"
"POT-Creation-Date: 2024-11-13 09:21+0100\n"
"PO-Revision-Date: 2024-09-25 08:52+0000\n"
"Last-Translator: Umeaman <[email protected]>\n"
"Language-Team: Swedish <https://translate.codeberg.org/projects/backintime/common/sv/>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.7.2\n"
"X-Launchpad-Export-Date: 2022-11-06 19:32+0000\n"

This is just a bunch of ideas I need to thinking through.

  • [ ] ~~Convert TRANSLATORS file into json format.~~
  • [ ] Use msgcat to manipulate the headers.
  • [x] ~~Add all known translators (from translator-placeholder-string file) to Last-Translator field.~~
  • [ ] Use updateversion.sh with msgcat to set the Project-Id-Version field.
  • [ ] Warn in update_language_files.py if Project-Id-Version does not fit to the VERSION file.
  • [ ] SPDX meta data
    • [ ] Check if Weblate does overwrite the SPDX comments in po files. If not ...
    • [ ] Manually create SPDX header for each po file based on the TRANSLATORS file.
    • [X] Remove TRANSLATORS file.
    • [ ] ~~Use update_language_files.py script to recreate a Python readable (like language.py) list of translators usable in the About dialog.~~
    • [ ] ~~Add translators info to the AUTHORS file. Point to po-Headers, the about dialog and auto-generated translators file.~~
  • [ ] Set License field
  • [ ] Remove field X-Launchpad-Export-Date

The thing is that Weblate will overwrite all this stuff. I still don't know why and how I can change that. So we need to regenerate all that meta data while using the update_language_files.py script. Still not sure if this will work.

Edit (2025-02)

Found an interesting solution in the "Peek" project. They use translator-strings in their po files. https://hosted.weblate.org/search/peek/translations/?q=translator-credits&search=exact&source=on&type=all&ignored=False -> Is implemented.

buhtz avatar Nov 20 '24 08:11 buhtz