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

Fetch the content for About dialog #621

Closed
dgdavid opened this issue Jun 13, 2023 · 12 comments
Closed

Fetch the content for About dialog #621

dgdavid opened this issue Jun 13, 2023 · 12 comments
Labels
enhancement New feature or request needinfo nice to have It would be nice, but not strictly needed

Comments

@dgdavid
Copy link
Contributor

dgdavid commented Jun 13, 2023

Right now, the content of the About dialog is hard-coded in the component itself. But would be nice to fetch the content from somewhere in the filesystem, which would allow customizing it depending on the system/product (including to not show the About link/dialog if the file does not exist or it is empty... or display the default content).

As discussed offline, most probably we're going to use cockpit.file over fetch

@dgdavid dgdavid added enhancement New feature or request nice to have It would be nice, but not strictly needed labels Jun 13, 2023
@dgdavid dgdavid changed the title _Fetch_ the content for About dialog Fetch the content for About dialog Jun 13, 2023
@balsa-asanovic
Copy link
Contributor

Is there still interest in this?

I could work on it.

@balsa-asanovic
Copy link
Contributor

Ah, sorry, didn't notice it was already assigned to @imobachgs

I'll look for something else 😄

@imobachgs imobachgs removed their assignment Sep 21, 2023
@imobachgs
Copy link
Contributor

Hi @balsa-asanovic,

No, please, you can take this one. I am busy with other stuff. Anyway, we might need to define which file we will use. @dgdavid any preference?

@dgdavid
Copy link
Contributor Author

dgdavid commented Sep 22, 2023

I do not have strong opinion about the file path... but I fear we've to think about translations first.

This issue was open before we implemented the i18n, and now I have no clear how we should proceed to make it compatible, specially taking into account that we want to

allow customizing it depending on the system/product

which make me think that it could come from the product configuration.

In short, we have work to do before @balsa-asanovic can work on it. Although ideas from his side are, of course, more than welcome.

@lslezak
Copy link
Contributor

lslezak commented Sep 22, 2023

We already have the same problem with the product descriptions, they are not translated as well.

My idea is to write some script which uses an YAML parser and extracts the texts to a POT file. And have a reverse script which reads the translations from the PO files and writes them next to the original texts with description-<lang> key (e.g. description-de, description-es, ...). The code would then read the translated text or fall back to the original untranslated (description) if a translation is not found.

(Note: it's a bit tricky as we need to keep the YAML structure including the comments, but it seems that the JS yaml library can do this.)

@balsa-asanovic
Copy link
Contributor

We already have the same problem with the product descriptions, they are not translated as well.

My idea is to write some script which uses an YAML parser and extracts the texts to a POT file. And have a reverse script which reads the translations from the PO files and writes them next to the original texts with description-<lang> key (e.g. description-de, description-es, ...). The code would then read the translated text or fall back to the original untranslated (description) if a translation is not found.

(Note: it's a bit tricky as we need to keep the YAML structure including the comments, but it seems that the JS yaml library can do this.)

Seems like an interesting endeavour, I'll look into it and try to make those scripts.

@lslezak
Copy link
Contributor

lslezak commented Nov 9, 2023

JFYI I have implemented support for translating the description key. The translatable texts from YAML files are collected and saved to the products.pot file.

After translating in Weblate (that does not work currently) the translations are merged back to the YAML into the translations key.

We can easily add a new about key in the YAML config and translate it the same way.

@lslezak
Copy link
Contributor

lslezak commented Nov 9, 2023

BTW see related pull requests #851, #853 and #855

@balsa-asanovic
Copy link
Contributor

Hey, sorry for not getting around to doing this 😢

BTW see related pull requests #851, #853 and #855

I'll check out these PR's to see what have you done.

Is there anything more regarding this issue I could help you with?

@imobachgs
Copy link
Contributor

Hi @balsa-asanovic,

No problem! @lslezak commented on this issue because he implemented a mechanism to have the product descriptions (which now live in products.d) translated. Of course, do not hesitate to ask any questions you might have.

Actually, we have not paid attention to this issue because it is not urgent. We now display a translated text (the translation comes directly from the component) and plan to keep that the same by now.

However, if you already have done some work on this issue, we can continue. In any other case, I could suggest a different topic to work on if you want.

Thanks in advance!

@balsa-asanovic
Copy link
Contributor

Hey @imobachgs

However, if you already have done some work on this issue, we can continue. In any other case, I could suggest a different topic to work on if you want.

No, I still haven't done anything related to this, so feel free to suggest other topics, I am willing to help.

@imobachgs
Copy link
Contributor

We are not implementing this feature by now. We could re-open it if we change our mind. Thanks!

@imobachgs imobachgs closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needinfo nice to have It would be nice, but not strictly needed
Projects
None yet
Development

No branches or pull requests

4 participants