-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fenced divs should be either "verbatim" (as now) or "translate" (new behavior) #381
Comments
I didn't new that fenced code blocks can also be written with columns (:). So far, they are possible with backquotes (`) and tildes (~). I think that the following patch solves your issue, but I'd like to have a full example to integrate to the test suite before I commit it to our git.
|
@joelnitta it would be really good if you could propose an extension to https://raw.githubusercontent.com/mquinson/po4a/master/t/fmt/txt-markdown/PandocFencedCodeBlocks.md testing "your" variant of fenced blocks, please. Just tell me what text chunk should be added, and I'll integrate properly in our test suite. |
Thanks @mquinson! I hadn't thought of this as a fenced code block, but rather as a markdown version of HTML divs (as described in the pandoc manual). But I suppose they are similar. The one thing that may differ is that pandoc I think borrowing from the pandoc manual should be fine for testing. Here are two examples. First one is non-nested.
Second one is nested.
|
Ok, I think it's fixed now. The fact that it can be nested made the patch more complex than I thought. |
Thanks @mquinson for your help with this. Sorry to make this request after you have already closed the issue, but I hope you might consider some other ways to handle this situation. The problem with this approach IMHO is that if there is a large amount of content within a fenced div, it all shows up as a single For my project I plan to crowdsource the translation part (i.e. the localization), so I want translators to be exposed to a minimum amount of code. This is an example of what happens using the current approach. Original text:
PO file (header excluded):
For comparison, this is the PO file generated before the patch:
I think having more |
Ok, then. Let's reopen this bug. What we will need is an option to alternate between fenced-div=verbatim (as I did) and fenced-div=translate (as you propose). I still think that we need both because the translate behavior may lead to some subtle difficulties when a nested div is inlined. In that case, the translators may want to change the location of the nested div in the englobing sentence. |
Thanks! A few ideas... in the later case (fenced-div=translate), if the fenced div line will show up as a |
@mquinson just checking in... is there anything I can do to help with this? (without knowing perl... sorry...) This would be a great feature to have, especially because of the heavy use of fenced divs by Quarto, which is rapidly gaining popularity as a cross-language authoring system. |
Hi @mquinson unless I'm missing something obvious, I think this should be re-opened because it does not provide an option to choose treating fenced divs as either "verbatim" or "translate". As mentioned above, the currently implementation results in unnecessary markdown formatting (especially line breaks, Thanks! |
I forgot everything about this issue since then, sorry. Feel free to reopen it it's appropriate, then. |
Thanks for the re-open. Please let me know if there's anything I can clarify. |
Actually, I'll go ahead and clarify a bit now: Ideal behavior would be if the parsed text in the PO file accounted for all markdown formatting between fenced divs (detection of |
There seem to be some possibly related issues (#291, #357, #359), but I couldn't find anything describing exactly what I'm encountering, so I am filing a new one.
I am translating markdown with input like this (let's call this file
test-long-line.md
):Note that the line with many colons ending with
instructor
is a pandoc fenced div and needs to remain one one line, and should not be translated.I generate the PO file with
po4a-updatepo -f text -m test-long-line.md -p test-long-line.po -o markdown --wrap-po newlines
, then edit it to look as follows (call thistest-long-line.po
):When I translate from the PO file, the
instructor
part gets put on a new line, even though I want to avoid this behavior.Command:
Output:
I also tried with
nobullets
as suggested in #359, but that did not work.Thanks!
po4a dev version (4cc0afd)
running in docker container joelnitta/po4a:latest
The text was updated successfully, but these errors were encountered: