<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 23, 2013 at 11:47 AM, isis agora lovecruft <span dir="ltr"><<a href="mailto:isis@torproject.org" target="_blank">isis@torproject.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Aaron transcribed 5.1K bytes:<br>
<div class="im">> On Sun, Jun 23, 2013 at 12:15 AM, isis agora lovecruft<br>
> <<a href="mailto:isis@torproject.org">isis@torproject.org</a>>wrote:<br>
><br>
> > Our code, from what I understand, though I have never worked with<br>
> > Transifex or<br>
> > any of these other translation services, is not particularly well-suited to<br>
> > translation.<br>
> ><br>
><br>
> Could you clarify or provide an example of a project that is well-suited to<br>
> translation?<br>
><br>
<br>
</div>Most projects store message strings as variables somewhere, and then whatever<br>
the thing is that is giving displaying the message always asks for FOO_STRING,<br>
where FOO_STRING might be in Arabic or Cantonese, etc.<br></blockquote><div><br></div><div>Does this really work that well? BridgeDB used to keep strings in a file called I18n.py, and I recall it being pretty painful to work with. <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
><br>
> > First question, at what point/release is OONI going to aim for for having<br>
> > translations available?<br>
> ><br>
><br>
> We have not set a target for translations of OONI.<br>
><br>
><br>
> > Going with the "usual" route of having a strings.py seems like it wouldn't<br>
> > work for OONI, do to the number of merge conflicts it would create (i.e.<br>
> > if I<br>
> > work on a nettest, and Aaron does some work on the director, and we both<br>
> > change strings.py, then the merge might not work cleanly). Are there any<br>
> > other<br>
> > opinions or ideas on the cleanest way to get ready for translations?<br>
> ><br>
><br>
> Do you mean, translations of user-facing interfaces? Or all code<br>
> documentation? Or OONI specification? Or OONI debug log messages?<br>
><br>
> We have a lot of translation tasks. Which should take priority?<br>
><br>
<br>
</div>IMO, priority levels:<br>
<br>
  1) translations of user-facing interfaces<br>
<br>
  2) (maybe) debug log messages, but not really. I would assume the usual<br>
  software engineering anglocentrism is permissible, and it would be way too<br>
  many hours to do all of that. (and probably a bit unmaintainable)<br>
<br>
So really just #1.<br></blockquote><div>Well, I'd start with #1 and see what the community feedback is. The user-interface stuff includes command-line and http. The http ui is probably going to be fairly easy to translate because we can probably extract coherent paragraphs of text whereas the sort of snippets you get from extracting strings from the source code or strings files tends to be more fragmented and harder to translate. <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
><br>
> > We could have an ooni.strings submodule, and stick per file things in<br>
> > there,<br>
> > like director_str.py, etc. Thoughts?<br>
> ><br>
><br>
> I don't think I understand. What about using gettext and babel? You can<br>
> extract strings from python source and templates directly, and these tools<br>
> integrate with transifex.<br>
><br>
<br>
</div>Hmm. As I said, I have never done translation work. You use gettext in<br>
BridgeDB, right? Do you have any suggestions for things that need to be done<br>
to make translations (whenever we get to that point) less painful?<br></blockquote><div><br></div><div>Well, it's pretty straightforward, actually. Just take a look at BridgeDB's templates and gettext usage. The setup.py, setup.cfg and accompanying README show how to set up pybabel for your project, and then you just need to wrap the strings you want to extract or return translated versions of by wrapping with the gettext function _(). At run-time you need a bit of code to set the corresponding language, and voila!<br>
 <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
--<br>
 ♥Ⓐ isis agora lovecruft<br>
_________________________________________________________<br>
GPG: 4096R/A3ADB67A2CDB8B35<br>
Current Keys: <a href="https://blog.patternsinthevoid.net/isis.txt" target="_blank">https://blog.patternsinthevoid.net/isis.txt</a><br>
_______________________________________________<br>
ooni-dev mailing list<br>
<a href="mailto:ooni-dev@lists.torproject.org">ooni-dev@lists.torproject.org</a><br>
<a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/ooni-dev" target="_blank">https://lists.torproject.org/cgi-bin/mailman/listinfo/ooni-dev</a><br>
</div></div></blockquote></div><br></div></div>