Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: SourceForge.net <noreply@so...> - 2012-07-25 15:30:17
|
Patches item #3548418, was opened at 2012-07-25 08:30 Message generated for change (Tracker Item Submitted) made by ktou You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kouhei Sutou (ktou) Assigned to: Nobody/Anonymous (nobody) Summary: Add source info to term node Initial Comment: I'm using Docutils via Sphinx. I'm also using Sphinx's i18n feature. Sphinx's i18n feature has a problem. Summary: Sphinx doesn't use term in definition list as translation target message. Reason: Sphinx extract translation target message from parsed doctree. Sphinx uses nodes that are instance of nodes.TextElement and have source information as translation target messages: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-46 Docutils parses term as nodes.term (that is instace of nodes.TextElement) but it doesn't have source information. Here is a sample .rst: term-word description-paragraph "description-paragraph" is used as translation target message but "term-word" isn't used. Solution: Could you set source information to term node? I attach a patch to do it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 |
From: SourceForge.net <noreply@so...> - 2012-08-13 21:58:51
|
Patches item #3548418, was opened at 2012-07-25 08:30 Message generated for change (Comment added) made by milde You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kouhei Sutou (ktou) Assigned to: Nobody/Anonymous (nobody) Summary: Add source info to term node Initial Comment: I'm using Docutils via Sphinx. I'm also using Sphinx's i18n feature. Sphinx's i18n feature has a problem. Summary: Sphinx doesn't use term in definition list as translation target message. Reason: Sphinx extract translation target message from parsed doctree. Sphinx uses nodes that are instance of nodes.TextElement and have source information as translation target messages: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-46 Docutils parses term as nodes.term (that is instace of nodes.TextElement) but it doesn't have source information. Here is a sample .rst: term-word description-paragraph "description-paragraph" is used as translation target message but "term-word" isn't used. Solution: Could you set source information to term node? I attach a patch to do it. ---------------------------------------------------------------------- >Comment By: Günter Milde (milde) Date: 2012-08-13 14:58 Message: A more local patch would be: --- states.py (Revision 7485) +++ states.py (Arbeitskopie) @@ -2783,6 +2783,8 @@ assert len(lines) == 1 text_nodes, messages = self.inline_text(lines[0], lineno) term_node = nodes.term() + (term_node.source, + term_node.line) = self.state_machine.get_source_and_line(lineno) node_list = [term_node] for i in range(len(text_nodes)): node = text_nodes[i] +1 no change to "Text.term" method arguments - robust and backwards compatible. -1 additional call to self.state_machine.get_source_and_line() Why do you also add term_node.rawsource = lines[0] in your patch and are you sure this is the right thing? (All other occurences of rawsource use rawsource = unescape(string[matchstart:textend], 1)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 |
From: SourceForge.net <noreply@so...> - 2012-08-14 12:26:54
|
Patches item #3548418, was opened at 2012-07-25 08:30 Message generated for change (Comment added) made by ktou You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kouhei Sutou (ktou) Assigned to: Nobody/Anonymous (nobody) Summary: Add source info to term node Initial Comment: I'm using Docutils via Sphinx. I'm also using Sphinx's i18n feature. Sphinx's i18n feature has a problem. Summary: Sphinx doesn't use term in definition list as translation target message. Reason: Sphinx extract translation target message from parsed doctree. Sphinx uses nodes that are instance of nodes.TextElement and have source information as translation target messages: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-46 Docutils parses term as nodes.term (that is instace of nodes.TextElement) but it doesn't have source information. Here is a sample .rst: term-word description-paragraph "description-paragraph" is used as translation target message but "term-word" isn't used. Solution: Could you set source information to term node? I attach a patch to do it. ---------------------------------------------------------------------- >Comment By: Kouhei Sutou (ktou) Date: 2012-08-14 05:26 Message: > A more local patch would be: (snip) Should I recreate and attach my patch like the patch? If you mean that I'll do it. > Why do you also add > > term_node.rawsource = lines[0] > > in your patch and are you sure this is the right thing? > (All other occurences of rawsource use rawsource = > unescape(string[matchstart:textend], 1)) Setting rawsource is the right thing. But missing unescape is not the right thing. rawsource is needed for Sphinx. Sphinx's i18n feature uses rawsource for translation target message: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-55 ---------------------------------------------------------------------- Comment By: Günter Milde (milde) Date: 2012-08-13 14:58 Message: A more local patch would be: --- states.py (Revision 7485) +++ states.py (Arbeitskopie) @@ -2783,6 +2783,8 @@ assert len(lines) == 1 text_nodes, messages = self.inline_text(lines[0], lineno) term_node = nodes.term() + (term_node.source, + term_node.line) = self.state_machine.get_source_and_line(lineno) node_list = [term_node] for i in range(len(text_nodes)): node = text_nodes[i] +1 no change to "Text.term" method arguments - robust and backwards compatible. -1 additional call to self.state_machine.get_source_and_line() Why do you also add term_node.rawsource = lines[0] in your patch and are you sure this is the right thing? (All other occurences of rawsource use rawsource = unescape(string[matchstart:textend], 1)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 |
From: SourceForge.net <noreply@so...> - 2012-08-16 14:52:45
|
Patches item #3548418, was opened at 2012-07-25 08:30 Message generated for change (Comment added) made by milde You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Kouhei Sutou (ktou) Assigned to: Nobody/Anonymous (nobody) Summary: Add source info to term node Initial Comment: I'm using Docutils via Sphinx. I'm also using Sphinx's i18n feature. Sphinx's i18n feature has a problem. Summary: Sphinx doesn't use term in definition list as translation target message. Reason: Sphinx extract translation target message from parsed doctree. Sphinx uses nodes that are instance of nodes.TextElement and have source information as translation target messages: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-46 Docutils parses term as nodes.term (that is instace of nodes.TextElement) but it doesn't have source information. Here is a sample .rst: term-word description-paragraph "description-paragraph" is used as translation target message but "term-word" isn't used. Solution: Could you set source information to term node? I attach a patch to do it. ---------------------------------------------------------------------- >Comment By: Günter Milde (milde) Date: 2012-08-16 07:52 Message: I applied the updated patch to the SVN repo. Please test if it works as expected (also with non-trivial terms like:: *hello* brave_ new world ). ---------------------------------------------------------------------- Comment By: Kouhei Sutou (ktou) Date: 2012-08-14 05:26 Message: > A more local patch would be: (snip) Should I recreate and attach my patch like the patch? If you mean that I'll do it. > Why do you also add > > term_node.rawsource = lines[0] > > in your patch and are you sure this is the right thing? > (All other occurences of rawsource use rawsource = > unescape(string[matchstart:textend], 1)) Setting rawsource is the right thing. But missing unescape is not the right thing. rawsource is needed for Sphinx. Sphinx's i18n feature uses rawsource for translation target message: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-55 ---------------------------------------------------------------------- Comment By: Günter Milde (milde) Date: 2012-08-13 14:58 Message: A more local patch would be: --- states.py (Revision 7485) +++ states.py (Arbeitskopie) @@ -2783,6 +2783,8 @@ assert len(lines) == 1 text_nodes, messages = self.inline_text(lines[0], lineno) term_node = nodes.term() + (term_node.source, + term_node.line) = self.state_machine.get_source_and_line(lineno) node_list = [term_node] for i in range(len(text_nodes)): node = text_nodes[i] +1 no change to "Text.term" method arguments - robust and backwards compatible. -1 additional call to self.state_machine.get_source_and_line() Why do you also add term_node.rawsource = lines[0] in your patch and are you sure this is the right thing? (All other occurences of rawsource use rawsource = unescape(string[matchstart:textend], 1)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 |
From: SourceForge.net <noreply@so...> - 2012-08-17 13:52:03
|
Patches item #3548418, was opened at 2012-07-25 08:30 Message generated for change (Comment added) made by ktou You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Kouhei Sutou (ktou) Assigned to: Nobody/Anonymous (nobody) Summary: Add source info to term node Initial Comment: I'm using Docutils via Sphinx. I'm also using Sphinx's i18n feature. Sphinx's i18n feature has a problem. Summary: Sphinx doesn't use term in definition list as translation target message. Reason: Sphinx extract translation target message from parsed doctree. Sphinx uses nodes that are instance of nodes.TextElement and have source information as translation target messages: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-46 Docutils parses term as nodes.term (that is instace of nodes.TextElement) but it doesn't have source information. Here is a sample .rst: term-word description-paragraph "description-paragraph" is used as translation target message but "term-word" isn't used. Solution: Could you set source information to term node? I attach a patch to do it. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (ktou) Date: 2012-08-17 06:52 Message: Thanks! I've confirmed that trunk works well with Sphinx! ---------------------------------------------------------------------- Comment By: Günter Milde (milde) Date: 2012-08-16 07:52 Message: I applied the updated patch to the SVN repo. Please test if it works as expected (also with non-trivial terms like:: *hello* brave_ new world ). ---------------------------------------------------------------------- Comment By: Kouhei Sutou (ktou) Date: 2012-08-14 05:26 Message: > A more local patch would be: (snip) Should I recreate and attach my patch like the patch? If you mean that I'll do it. > Why do you also add > > term_node.rawsource = lines[0] > > in your patch and are you sure this is the right thing? > (All other occurences of rawsource use rawsource = > unescape(string[matchstart:textend], 1)) Setting rawsource is the right thing. But missing unescape is not the right thing. rawsource is needed for Sphinx. Sphinx's i18n feature uses rawsource for translation target message: https://bitbucket.org/birkenfeld/sphinx/src/348224ae1fd5/sphinx/util/nodes.py#cl-55 ---------------------------------------------------------------------- Comment By: Günter Milde (milde) Date: 2012-08-13 14:58 Message: A more local patch would be: --- states.py (Revision 7485) +++ states.py (Arbeitskopie) @@ -2783,6 +2783,8 @@ assert len(lines) == 1 text_nodes, messages = self.inline_text(lines[0], lineno) term_node = nodes.term() + (term_node.source, + term_node.line) = self.state_machine.get_source_and_line(lineno) node_list = [term_node] for i in range(len(text_nodes)): node = text_nodes[i] +1 no change to "Text.term" method arguments - robust and backwards compatible. -1 additional call to self.state_machine.get_source_and_line() Why do you also add term_node.rawsource = lines[0] in your patch and are you sure this is the right thing? (All other occurences of rawsource use rawsource = unescape(string[matchstart:textend], 1)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3548418&group_id=38414 |