Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

更簡潔的 reST 的 literal block 標記語法#568

Closed
mattwang44 started this conversation inGeneral
Discussion options

TL;DR

當原文以:: 結尾時,希望譯文內用使用: ::全形冒號 x1+空格 x1+半形冒號 x2)就好。

Background

README 中有一段敘述:: 的用法(如下圖):

image

也就是說當我們看到原文以:: 結尾時,應該要像這樣翻譯:

msgid"blah blah::"msgstr"""blah blah:\n""\n""::"

這樣的建議是完全正確的,因為 rst 會需要:: 來確定接續的段落不是一個 rst markup 的 block(像是 code block),但是這樣的多行寫法並不是很方便。

根據rst 文件,(英文)標示 literal block 有三種語法:

1st:::    literal block
2nd: ::    literal block
3rd::    literal block

其中:: 若前面為 line break 或空格則不會被 render、但若作為一個段落的結尾則為 render 成單個 colon。

所以在中文譯文當中,除了這種基於上述第一種的寫法(也就是 readme 建議的寫法)外

1st:::    literal block

也可以基於上述第二種寫法寫成下面這樣

2nd: ::    literal block

也就是說在 po file 中看到原文以:: 結尾時,只要像以下這樣翻譯,就能顯示全形冒號並且同時成功標記接下來的段落是一個 literal block

msgid"blah blah::"msgstr"blah blah: ::"
You must be logged in to vote

Replies: 2 comments 5 replies

Comment options

原來還有這個寫法!我對於 rst 的認知真的太淺了

如果可以這樣寫的話我支持進行更改

我也想要自己實際測試看看能不能成功

You must be logged in to vote
2 replies
@rockleona
Comment options

酷!語法檢查通過也有順利 render

image
image

@mattwang44
Comment options

mattwang44Aug 15, 2023
Maintainer Author

補充一下,這樣的實驗方式其實是有問題的XD
sphinx 在 build html 的流程看起來應該是先根據原文 render 再將字串替換成譯文,所以修改譯文其實不會影響 html 顯示(但修改 rst 原文就會)。
#542 (comment)

Comment options

這邊要更新到readme嗎

You must be logged in to vote
3 replies
@rockleona
Comment options

支持更新,這次 meetup 的時候有人遇到這個問題,
感覺簡潔版的寫法可以取代原有寫法,也比較和原文 (msgid) 的寫法較為相近

@mattwang44
Comment options

mattwang44Nov 29, 2023
Maintainer Author

feel free to update the readme 🙏🏽

@ken71301
Comment options

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
3 participants
@mattwang44@ken71301@rockleona

[8]ページ先頭

©2009-2025 Movatter.jp