<html><body bgcolor="#FFFFFF"><div>Hi Erik,<br><br>On 10 Sep 2010, at 16:36, Erik Blankinship <<a href="mailto:erikb@mediamods.com">erikb@mediamods.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><div>(maybe there is genpot list where this message is more apropos? Sorry, genpot is opaque to me.)</div><div><br></div>My activity has two identical-in-english strings (homonyms) which need translating, but have two different meanings depending on context in an activity.<div>
How should I flag genpot that these are two different strings which might require different translations?<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#TRANS: bow and arrow</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>activeDisplay = _("Bow")</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#TRANS: the front of a ship</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>istrDisplay = _("Bow")</div></div></div></div></blockquote><div><br></div><div>Ooh interesting, not bumped into this need myself yet, but (as a cheat) it strikes me that gettext is using the given strings as IDs for its string lookups so you could replace your strings with _("Arrow|Bow") and<span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.289062); -webkit-composition-fill-color: rgba(175, 192, 227, 0.222656); -webkit-composition-frame-color: rgba(77, 128, 180, 0.222656); "> _("Ship|Bow"), then make sure the pot file actually has the correct Bow msgstr set. I think though what your really looking for is context support but have not tinkered other than a few min googling:</span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.285156); -webkit-composition-fill-color: rgba(175, 192, 227, 0.21875); -webkit-composition-frame-color: rgba(77, 128, 180, 0.21875);"><br></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.289062); -webkit-composition-fill-color: rgba(175, 192, 227, 0.222656); -webkit-composition-frame-color: rgba(77, 128, 180, 0.222656); "> <span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "> <a href="http://bugs.python.org/issue2504"><a href="http://bugs.python.org/issue2504">http://bugs.python.org/issue2504</a></a></span></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.226562); -webkit-composition-frame-color: rgba(77, 128, 180, 0.226562);"><br></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.285156); -webkit-composition-fill-color: rgba(175, 192, 227, 0.21875); -webkit-composition-frame-color: rgba(77, 128, 180, 0.21875);">If the Python workflow is working/there, and I haven't tested... you'd get extra <span class="Apple-style-span" style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.289062); -webkit-composition-fill-color: rgba(175, 192, 227, 0.222656); -webkit-composition-frame-color: rgba(77, 128, 180, 0.222656); color: rgb(37, 34, 29); font-family: 'Courier New', 'Andale Mono', monospace; white-space: pre; ">msgctxt<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 17px; white-space: normal; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.277344); -webkit-composition-fill-color: rgba(175, 192, 227, 0.210938); -webkit-composition-frame-color: rgba(77, 128, 180, 0.210938); "> entry in the pot file containing your extra context argument supplied with the string allowing for disambiguation.</span></span></span></div><div><font class="Apple-style-span" face="Helvetica, 'Andale Mono', monospace"><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.273438); -webkit-composition-fill-color: rgba(175, 192, 227, 0.207031); -webkit-composition-frame-color: rgba(77, 128, 180, 0.207031);"><br></span></font></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.285156); -webkit-composition-fill-color: rgba(175, 192, 227, 0.21875); -webkit-composition-frame-color: rgba(77, 128, 180, 0.21875);"><span class="Apple-style-span" style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.289062); -webkit-composition-fill-color: rgba(175, 192, 227, 0.222656); -webkit-composition-frame-color: rgba(77, 128, 180, 0.222656); color: rgb(37, 34, 29); font-family: 'Courier New', 'Andale Mono', monospace; white-space: pre; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 17px; white-space: normal; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.277344); -webkit-composition-fill-color: rgba(175, 192, 227, 0.210938); -webkit-composition-frame-color: rgba(77, 128, 180, 0.210938); ">Interesting questing, hope that helped :) </span></span></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.28125); -webkit-composition-fill-color: rgba(175, 192, 227, 0.214844); -webkit-composition-frame-color: rgba(77, 128, 180, 0.214844);"><br></span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.289062); -webkit-composition-fill-color: rgba(175, 192, 227, 0.222656); -webkit-composition-frame-color: rgba(77, 128, 180, 0.222656);">Regards,</span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.285156); -webkit-composition-fill-color: rgba(175, 192, 227, 0.21875); -webkit-composition-frame-color: rgba(77, 128, 180, 0.21875);">--Gary</span></div><br><blockquote type="cite"><div><div><div>
<div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">Currently <span class="Apple-style-span" style="background-color: rgb(0, 0, 0);"><font class="Apple-style-span" color="#33FF33"><font class="Apple-style-span" face="'courier new', monospace">python setup.py genpot</font></font></span><font class="Apple-style-span" face="'courier new', monospace"> </font>produces this output, making it impossible for the translator to handle both meanings differently:</span><br></div>
<div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><div><font class="Apple-style-span" face="'courier new', monospace">#. TRANS: bow and arrow</font></div>
</div></div><div><div><div><font class="Apple-style-span" face="'courier new', monospace">#. TRANS: the front of a ship</font></div></div></div><div><div><div><font class="Apple-style-span" face="'courier new', monospace">#: constants.py:35</font></div>
</div></div><div><div><div><font class="Apple-style-span" face="'courier new', monospace">#: constants.py:38</font></div></div></div><div><div><div><font class="Apple-style-span" face="'courier new', monospace">msgid "Bow"</font></div>
</div></div><div><div><div><font class="Apple-style-span" face="'courier new', monospace">msgstr ""</font></div></div></div></blockquote><div><div><br></div><div><br></div><div><br></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Sugar-devel mailing list</span><br><span><a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a></span><br><span><a href="http://lists.sugarlabs.org/listinfo/sugar-devel">http://lists.sugarlabs.org/listinfo/sugar-devel</a></span><br></div></blockquote></body></html>