Skip to content

Markdown files support #3106

Closed
Closed

Description

@maicol07

Describe the solution you'd like
Markdown files support (maybe similar to Crowdin system)

Activity

  1. nijel commented on Oct 13, 2019

    @nijel
    Member

    We currently do not support translating any documents, only formats designed for localization.

    Related to #2592

  2. maicol07 commented on Oct 13, 2019

    @maicol07
    Author

    @nijel do you think will be implemented?

  3. nijel commented on Oct 14, 2019

    @nijel
    Member

    I think it will be implemented at some point. It should not be hard to implement (we already do something similar for the appstore metadata). Right now it's just not a priority for me, but this can change if somebody comes with funding for this :-).

  4. RMStoica-zivver commented on Nov 25, 2019

    @RMStoica-zivver

    @nijel What sort of funding are we talking about here? Asking for a friend.

  5. nijel commented on Nov 25, 2019

    @nijel
    Member

    @RMStoica-zivver You can use https://www.bountysource.com/issues/81891384-markdown-files-support to put funds on this issue to motivate contributors.

  6. wetneb commented on Mar 26, 2020

    @wetneb

    I have added a bounty on this issue - it's not exactly clear to me what the integration should look like but I trust @nijel to steer the idea in the right direction.

    Our own requirement is to translate documentation, represented by a set of Markdown files. Since these Markdown files will be stored in the same git repository as our UI i18n files (and the rest of our code), it would be ideal if the Markdown files could be added as an extra component in the Weblate project.

  7. changed the title [-]Markdown files support[/-] [+]Markdown files support [$250][/+] on Mar 26, 2020
  8. nijel commented on Mar 30, 2020

    @nijel
    Member
  9. guoyunhe commented on Apr 28, 2020

    @guoyunhe

    I think it can be easily supported with some simple script, converting Markdown files to JSON files.

  10. eighthave commented on Apr 28, 2020

    @eighthave
    Contributor

    If you want to go the conversion route, I recommend using po4a, a 20 year old project for doing just that. It recently got some key improvements in v0.58. Its used for things like f-droid.org and Fedora documentation.

  11. guoyunhe commented on Apr 28, 2020

    @guoyunhe

    @eighthave good to know. thanks!

  12. mquinson commented on Apr 29, 2020

    @mquinson

    About the idea of using po4a here, I think that it perfectly makes sense (disclamer: I'm one of the authors of po4a).

    We already have an existing markdown parser, but it's ... not rock stable and changing it may be more complex than rewriting a new parser. What would remain is the surrounding infrastructure of po4a, which makes the conversion between documentation formats and PO files easier, and the tests.

    My plan to improve the support of Markdown in po4a is to simplify the existing parser (its code is convoluted), and then improve its robustness using for example the tests from https://github.com/bobtfish/text-markdown/tree/master/t

    Markdown is not very complex compared to other formats we handler pretty well in po4a (eg, groff of man pages or XML plus the docbook and HTML variants). For both formats, we use internal parses with no dependency to external tool or library. This is because the kind of parsing that we are doing is specific, so we felt it easier this way.

    The groff parser is interesting in the sense that it really normalizes the input. There is maybe 6 ways to specify the inline formatting (bold, italic), and po4a converts them all to one form only to ease the life of translators. I'm not sure that it will be mandated for the markdown parser, but that's something to consider. The XML parser is interesting because it is difficult to have a line-by-line parser of XML, just as it happens to be in markdown. So the solution built in the XML parser could be useful to rework the markdown parser: instead of the line by line parser that we currently have, we could go for a block by block approach. That would help supporting the bits that are currently not supported.

    Edit: we also have some format parsers that are using external tools in po4a. The POD parser is using a dedicated Perl library while the SGML parser is using the onsgml external parser. On another front, I am considering whether asciidoctor could be used as an external parser for the AsciiDoc format. If someone knows a parser for markdown that works a bit like a SAX parser, that may be an interesting starting point, maybe.

    I'm willing to help any volunteer, but my personal schedule does not allow me to address this issue alone anytime soon.

    Oh. And po4a is written in Perl. Sorry about that...

  13. eighthave commented on Apr 29, 2020

    @eighthave
    Contributor
  14. 7 remaining items

  15. eighthave commented on May 28, 2021

    @eighthave
    Contributor
  16. wetneb commented on May 28, 2021

    @wetneb

    I have not tried it but I suspect the main issue with this workflow is that translators get to translate parts of markdown files out of context, no?

    In OpenRefine we are sadly going to go for Crowdin (for now), because it seems to be the only solution which offers a real markdown editor where you can see the entire file being translated while still working on individual parts.

    If people are interested in adding a similar Markdown support in Weblate, I could imagine finding some funding for it (the existing bounties will not get us very far I am afraid). Maybe we could pool resources with other projects interested in the feature?

  17. ilmari-lauhakangas commented on May 28, 2021

    @ilmari-lauhakangas

    I have not tried it but I suspect the main issue with this workflow is that translators get to translate parts of markdown files out of context, no?

    In OpenRefine we are sadly going to go for Crowdin (for now), because it seems to be the only solution which offers a real markdown editor where you can see the entire file being translated while still working on individual parts.

    I wouldn't extend the scope of this issue to include such a nice-to-have feature.

  18. yarons commented on Nov 28, 2021

    @yarons
    Contributor

    Is this issue is only about getting the strings out of Markdown and translating them? I would suggest supporting something similar to Crowdin's documentation localization offering.

  19. eighthave commented on Nov 29, 2021

    @eighthave
    Contributor
  20. yarons commented on Nov 29, 2021

    @yarons
    Contributor

    I'm talking about the fact that you can see the end result in a preview pane while translating, Mozilla's Pontoon also offer such capability.

  21. Mihonarium commented on May 27, 2022

    @Mihonarium

    We're translating markdown articles via weblate. Initially, we wanted to translate by inserting plain text into Weblate, but Weblate was pretty bad at handling insertions and deletions of paragraphs in the original text.

    I've looked into po4a and other ways to convert the text into formats that would allow us to easily translate and update the text, but haven't found anything that would be easy to use and wouldn't generate lots of overhead.

    So I've written a simple Golang package that splits text into paragraphs, compares to the previous version of the text (if there is one), and produces JSON of a map from keys to paragraphs in a way that keeps the paragraphs in the right order, doesn't change the keys if the text wasn't significantly changed and handles insertions and deletions in a way that avoids key collisions. It should be pretty easy to write something similar and add to how Weblate handles plain text; but if anyone's interested, I can add the documentation, examples, etc. to the tool I've written.

  22. nijel commented on Jun 6, 2022

    @nijel
    Member

    Handling of plain text files will work better since 4.13, see #7585

  23. changed the title [-]Markdown files support [$250][/-] [+]Markdown files support[/+] on Jun 1, 2023
  24. added this to the 5.0 milestone on Jul 19, 2023
  25. self-assigned this
    on Jul 19, 2023
  26. linked a pull request that will close this issueformats: Add Markdown support #9597on Jul 27, 2023
  27. github-actions commented on Aug 1, 2023

    @github-actions

    Thank you for your report; the issue you have reported has just been fixed.

    • In case you see a problem with the fix, please comment on this issue.
    • In case you see a similar problem, please open a separate issue.
    • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementAdding or requesting a new feature.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions