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

text inside Markdown code fences is marked as "#. type: Plain text" #195

Closed
eighthave opened this issue Mar 20, 2020 · 7 comments
Closed

Comments

@eighthave
Copy link
Contributor

eighthave commented Mar 20, 2020

I think that code inside of the fenced code block should be marked as something other than "Plain text". Most of the text in a fenced code block should not be translated, most likely it will only the code comments that will be translatable. So having this text with another status will highlight this fact to the translator. For example, if there was this code block:


​```console
which open
​```

This would be split up into a POT like this:

#. type: Code fence info string
#, no-wrap
msgid "console"
msgstd ""

#. type: Plain text
#, no-wrap
msgid "which open"
msgstd ""

And many translators would translate both the terms "which open". This would be wrong, since this is actually a UNIX command which with an argument that is the UNIX command open.

I propose that it is labeled using the code fence info string, something like #. type: "console" text. That would also then give things like:

  • #. type: "perl" text
  • #. type: "bash" text
  • #. type: "markdown" text

@uniqx

@eighthave
Copy link
Contributor Author

eighthave commented Mar 20, 2020

@uniqx do you think my proposal for type: "bash" text would be usable in Weblate checkers?

@jonassmedegaard
Copy link
Contributor

I agree, except for the proposed label.

trailing hints are optional and I would find it better to model the label taking that into account, e.g. like this:

#. type: Code block "console"
#, no-wrap
msgid "which open"
msgstd ""

(where only "Code" is mandatory, delimiting space and quotes and quoted part - which can contain multiple words! - is optional)

@eighthave
Copy link
Contributor Author

#. type: Code block "console" looks great, @uniqx work for you?

@jonassmedegaard
Copy link
Contributor

jonassmedegaard commented Mar 20, 2020 via email

@eighthave
Copy link
Contributor Author

eighthave commented Mar 20, 2020 via email

@jonassmedegaard
Copy link
Contributor

@mquinson
Copy link
Owner

Hello,

I cherry-picked the commit from the repo where it was (that is dedicated to the Debian package) and pushed it to the upstream source code on both github and salsa.

Thanks to both of you!

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

No branches or pull requests

3 participants