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

Support for Source String Descriptions in YAML files #9039

Closed
2 tasks done
niccokunzmann opened this issue Apr 3, 2023 · 9 comments
Closed
2 tasks done

Support for Source String Descriptions in YAML files #9039

niccokunzmann opened this issue Apr 3, 2023 · 9 comments
Assignees
Labels
documentation Improvements or additions to the documentation.
Milestone

Comments

@niccokunzmann
Copy link

niccokunzmann commented Apr 3, 2023

Describe the issue

I have a yaml file like this:

# Title of the page
# https://mywebsite/page.html#title
page-title: "Main Page"

I added these comments in order to allow the users to check out the place where the translations are on the page.

I had a look at https://docs.weblate.org/en/latest/formats.html - yaml section and the table.

Format Linguality [1] Plurals [2] Descriptions [3] Context [4] Location [5] Flags [8] Additional states [6]
YAML files mono no yes no no no

Descriptions are allowed but I do not know how to add these to the file.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

Expected behavior

I would expect the comments to turn up here:
image
But the explanations are empty.

How do I add descriptions/explanations from the yaml file?

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Apr 4, 2023

"Explanation" is provided in Weblate, the comments from the file are shown as "Source string description". See for example https://hosted.weblate.org/translate/weblate/application/cs/?checksum=39b3998dcfe68cbf

@nijel nijel added the question This is more a question for the support than an issue. label Apr 4, 2023
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@niccokunzmann
Copy link
Author

niccokunzmann commented Apr 4, 2023

Hm. Interesting. It seems like the comments have different meanings depending on how they are made:

#. Translators: Shown on wrong answer to the mathematics-based CAPTCHA
#: weblate/accounts/forms.py:513

#. is a "Source string description"
#: is a link to the file. I will see and try out a bit.

I think, I would have liked that explained or linked below the table of what supports description strings.

Hm. I do not see anything about that in the documentation. https://docs.weblate.org/en/latest/search.html?q=%23%3A&check_keywords=yes&area=default#

For me, this is unexpected behavior, not documented. I can not find the documentation. I think then, this is a "bug in the documentation".

I have added this: niccokunzmann/open-web-calendar@04d66c4
And here is the result:
https://hosted.weblate.org/translate/open-web-calendar/common-translations/de/?checksum=0e2e3d18c37eb5b5

And they do not turn up. I think, I have pulled the changes.

niccokunzmann added a commit to niccokunzmann/open-web-calendar that referenced this issue Apr 4, 2023
@niccokunzmann niccokunzmann changed the title Unclear how to add explanations from YAML files Support for Source String Descriotions in YAML files Apr 5, 2023
@niccokunzmann niccokunzmann changed the title Support for Source String Descriotions in YAML files Support for Source String Descriptions in YAML files Apr 5, 2023
@niccokunzmann
Copy link
Author

I wonder where this would be implemented. I think, since PO files can do that already and we have different types of input files, there is probably a modular structure for that that can be kind-of replicated.

@nijel nijel added wontfix Nobody will work on this. translate-toolkit Issues which need to be fixed in the translate-toolkit labels Apr 12, 2023
@nijel
Copy link
Member

nijel commented Apr 12, 2023

This syntax is specific to PO files, see https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html

Looking at YAML handler, it doesn't seem to parse comments at all: https://github.com/translate/translate/blob/master/translate/storage/yaml.py, so it needs to be implemented there. Weblate will then display comments properly.

@nijel nijel closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
@github-actions
Copy link

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

@niccokunzmann
Copy link
Author

I opened translate/translate#4883 so that the implementation part is done here. From my perspective this issue is not resolved now but a documentation issue:

The documentation claims that yaml files support Descriptions . However there is no documentation about how to add descriptions. This discussion seems to suggest that descriptions are not possible.

To close this issue:

  • Either remove the yes for yaml in the description column of the table or add an example of how to add a description in the yaml Section.

Thanks for helping so far. What are your thoughts on this?

@nijel
Copy link
Member

nijel commented Apr 13, 2023

Correct, I've removed that in 0bc286e.

PS: This table really needs to be changed, see #9077

@nijel nijel added this to the 4.17 milestone Apr 13, 2023
@nijel nijel added documentation Improvements or additions to the documentation. and removed question This is more a question for the support than an issue. wontfix Nobody will work on this. translate-toolkit Issues which need to be fixed in the translate-toolkit labels Apr 13, 2023
@nijel nijel self-assigned this Apr 13, 2023
@niccokunzmann
Copy link
Author

Thanks! I consider this issue as closed now, too :) Thank you!

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

No branches or pull requests

2 participants