Rust has been growing and growing over the past few years. As we continue to welcome new Rustaceans into
the community, we want to continue to extend a friendly welcome. Part of that friendliness is not expecting
that everyone speaks English. We've been hesitant to move forward with internationalization/localization
efforts for a variety of reasons, but we shouldn't be putting them off much longer.
This is going to be a huge effort, and we want to do it right. I wanted to work up a proposal for how we can
get there, but it's really important that we get input from those of you who are interested in working on
translations. Ultimately, I'm only an expert in English; it wouldn't be fair for me to declare how you all
do your work.
As such, I'd like to propose that we do this in phases:
- The Book
- API Docs
- The compiler
These are roughly listed in order of difficulty and size. Nice when things line up like that. Let's go with each
This should be the easiest, so I'd like to tackle it first. It should also be the easiest, with only a little bit of
work being neccesary. What I'd like to propose is that we take the same approach that Ruby does for www.ruby-lang.org.
It is also hosted on GitHub Pages, and seems to work pretty well. Here's the basics:
The homepage detects your language and redirects you to an appropriate sub-URL: https://github.com/ruby/www.ruby-lang.org/blob/master/index.html
sent to the English version, so this should be the same as today for that crowd.
Next, for various layouts, all of the information is represented through keys. For example, the Ruby logo says
"A programmer's best friend" underneath it. But in the source, it looks like this: https://github.com/ruby/www.ruby-lang.org/blob/master/_layouts/default.html#L39-L42
These keys are then configured in a YAML flie: https://github.com/ruby/www.ruby-lang.org/blob/master/_config.yml#L397
So, step one would be to re-do the English stuff to work with this. From there, we can open up PRs to add more languages.
My work on the second edition of the book is still ongoing, and so it's not really ready to be translated yet. However,
that's good, because I'm using mdBook for it, and there's still ongoing discussion about how to properly do this:
We also had another thread about it:
I think that these threads are probably the most productive way to discuss how things should move forward there.
This is difficult, first because I haven't even finished working on a rough draft of all of these yet, and second because
we currently have no way to switch these out based on language. Lots of thought, discussion, and tooling work needs to happen
before we can even consider this.
Finally, the compiler is even more complex. There's no real infrastructure here, and we're even farther away from being
good enough at English errors yet to consider porting them. We had an RFC for this https://github.com/rust-lang/rfcs/pull/1292