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

description language support in dump broken #246

Closed
hsitter opened this issue Aug 19, 2019 · 4 comments
Closed

description language support in dump broken #246

hsitter opened this issue Aug 19, 2019 · 4 comments
Labels

Comments

@hsitter
Copy link
Contributor

hsitter commented Aug 19, 2019

e.g.

root@e9d0d95d1223:/# LANGUAGE=fr appstreamcli dump org.kde.krita  
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop-application">
  <id>org.kde.krita</id>
  <name>Krita</name>
  <name xml:lang="fr">Krita</name>
  <summary>Digital Painting, Creative Freedom</summary>
  <summary xml:lang="fr">Peinture num?rique, libert? cr?atrice</summary>
  <project_license>GPL-3.0-only</project_license>
  <project_group>KDE</project_group>
  <developer_name>Krita Foundation</developer_name>
  <developer_name xml:lang="fr">La Fondation Krita</developer_name>
  <description>
    <p>Krita is the full-featured digital art studio.</p>
    <p>It is perfect for sketching and painting, and presents an end?to?end solution for creating digital painting files from scratch by masters.</p>
    <p>Krita is a great choice for creating concept art, comics, textures for rendering and matte paintings. Krita supports many colorspaces like RGB and CMYK
      at 8 and 16 bits integer channels, as well as 16 and 32 bits floating point channels.</p>
    <p>Have fun painting with the advanced brush engines, amazing filters and many handy features that make Krita enormously productive.</p>
    <p xml:lang="fr">Krita est le studio d'art num?rique complet.</p>
    <p xml:lang="fr">Il est parfait pour crayonner et peindre, et constitue une solution de bout en bout pour cr?er des fichier de peinture num?rique depuis la feuille blanche jusqu'au ?preuves finales.</p>
    <p xml:lang="fr">Krita est un tr?s bon choix pour cr?er des concepts arts, des bandes-dessin?es, des textures de rendu et des peintures. Krita prend en charge plusieurs espaces de couleurs comme RVB et CMJN avec les canaux de 8 et 16 bits entiers ainsi que les canaux de 16 et 32 bits flottants.</p>
    <p xml:lang="fr">Amusez-vous ? peindre avec les outils de brosse avanc?s, les filtres incroyables et les nombreuses fonctionnalit?s pratiques qui rendent Krita extr?mement productif.</p>
  </description>

As far as I understand the spec this should be interleaved. The english <p> should be followed by its translated <p xml:lang="fr">, then the next english followed by its translation so on and so forth. But the way it is out put is all <p> followed by all <p xml:lang="fr">.

@ximion ximion added the bug label Aug 19, 2019
@ximion
Copy link
Owner

ximion commented Aug 19, 2019

Indeed! The output is not correct (it will probably still work okay though)
I wonder whether this broke with the description paragraph changes of the last release...
AppStream internally doesn't keep the paragraph ordering, instead it will store a per-language hash table, which will also contain the untranslated tags in case they didn't have a localized equivalent.
So dump will never be able to recreate the original metainfo file, but it should try its best to do so (its primary purpose is anyway to display all data that we have on a component, not metainfo data recreation).
Thanks for raising this, I'll have a look at the code later!

@adriaandegroot
Copy link

Might be related to #116?

@ximion
Copy link
Owner

ximion commented Aug 19, 2019

Maybe... I'll have a look later. This has a unit test though, so I do think the problem is a bit more subtle.

@ximion ximion closed this as completed in 3479183 Sep 16, 2019
@ximion
Copy link
Owner

ximion commented Sep 16, 2019

The code will now try to replicate a "real" metainfo file from the stuff that is represented in memory. This works very well for complete translations, and not very well for incomplete translations. In the latter case libappstream simply has not enough information available to replicate the original metainfo input though, so getting an "almost good" result is the best we can do.

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

No branches or pull requests

3 participants