Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add as_license_get_name() API #423

Open
pwithnall opened this issue Jul 25, 2022 · 3 comments
Open

Add as_license_get_name() API #423

pwithnall opened this issue Jul 25, 2022 · 3 comments

Comments

@pwithnall
Copy link
Contributor

For some functionality we want to implement in gnome-software it would be useful to have an API like:

const gchar		*as_license_get_name (const gchar *license_id);

It would return a translated string containing the human readable name of the given SPDX license ID.

This would only work for individual license IDs, not SPDX expressions because building a general-purpose translatable string to represent an arbitrary SPDX expression would be hard, and the end result would be very confusing to users (even if it could be perfectly localised).

For the case of a non-trivial SPDX expression, gnome-software will probably use a generic fallback string like “this app is licensed under a combination of free software licenses” or something.

The human-readable name of an SPDX license ID is given by the name field in licenses.json. Unfortunately it doesn’t look like they provide translated versions, so libappstream would have to carry the translations.

@ximion
Copy link
Owner

ximion commented Jul 25, 2022

This kind of ties into my long-term plan to make the whole licensing business more human-friendly (which would also involve AppStream's own license overview pages at freedesktop.org, so people have a better reference as to what AppStream thinks of their license, as well as translated quick overview information as to what a license does and doesn't permit and what that means. So, a bit like https://choosealicense.com/licenses/gpl-3.0/ but from an end-user point of view, and not just from a developer seeking to apply a license point of view.

For this particular issue, it's possibly a good idea to have the Python code generate a C struct from the JSON and export that, rather than having it generate a text file or embed the JSON and parse it every time we need license information... (this stuff is very performance sensitive when building AppStream metadata)

What I don't get is the localization - isn't "GPL" always "GPL" in every language? Or do you mean a literal translation of a string like "GNU General Public License"? If it's the latter, is that legally okay? Can we trust translators to translate license names properly so we don't run into issues, or should the translation be a static-ish list of officially legally vetted name translations?

@pwithnall
Copy link
Contributor Author

pwithnall commented Jul 25, 2022

That sounds like an appealing long-term plan!

I can’t speak authoritatively on localisation, but I certainly think the “or later” wording of licenses like GPL-3.0-or-later could be localised. As one data point, it looks like CC localise their license names on their official website.

Trusting translators to translate the names correctly would be a matter of providing appropriate guidance and perhaps some occasional review.

It would probably make sense to get input from some translation teams before committing to a particular approach, as they will know much better than me what the issues will be.

(I should say that I don’t plan to work on this at the moment, which is why I filed it as an issue rather than an MR. I’m away until October.)

@wjt
Copy link
Contributor

wjt commented Feb 28, 2023

There is prior art here.

GtkAboutDialog translates the names of a list of known licenses. Here is Nautilus' About dialog on a French system:

Capture d’écran de 2023-02-28 14-25-47

Licence publique générale GNU, version 3 ou ultérieure

And here is the À propos dialog of Kdenlive:

Capture d’écran de 2023-02-28 14-30-30

License : Version 3 de la License Générale Publique GNU

(I can't help but notice that French GTK calls it the LPG GNU, whereas French KDE calls it LGP GNU. 🤷🏻)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants