Skip to content

Localization of Rust error messages #1843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3442853561 opened this issue Jan 3, 2017 · 18 comments
Open

Localization of Rust error messages #1843

3442853561 opened this issue Jan 3, 2017 · 18 comments
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.

Comments

@3442853561
Copy link

It is necessary to make a localized compiler now. There has been increasing numbers of users in the Non-english Rust community.
rust-lang/rust#38316

@ranma42
Copy link
Contributor

ranma42 commented Jan 3, 2017

#822 might be related

@KalitaAlexey
Copy link

@3442853561,
Who should do that?

@3442853561
Copy link
Author

@KalitaAlexey If this is useful, I will in.

@nrc nrc added the T-compiler Relevant to the compiler team, which will review and decide on the RFC. label Jan 4, 2017
@KalitaAlexey
Copy link

@3442853561,
How will rustc determine which language it should use?
Where will rustc get translations? Should they be inlined into rustc or should they be downloaded separately?

@golddranks
Copy link

golddranks commented Jan 5, 2017

@KalitaAlexey The OS usually sets the environment variables like LANG that tell the default language. (Or some other mechanism like some API calls on Windows and macOS) There could be downloadable packages, and rustup could by default download and install the one that's default in the environment. Additionally, English should be also downloaded by default so that there's a fallback for missing translations and for changing the language temporarily to aid with googling things.

@xen0n
Copy link
Contributor

xen0n commented Jan 8, 2017

I started my experiment but was blocked by proper i18n support in rustc's machine-readable output. I started an irlo thread regarding this, but I have no time for actually implementing that unfortunately.

Edit: If you'd like to do some coding for that then feel free to join! However as pointed out in the pre-RFC thread, a massive number of diagnostic messages and some portion of the diagnostic infrastructure needs refactoring, so some input from the maintainers is almost certainly needed to avoid stepping over anyone's work. After that it should be a simple thing as assembling l20n templates for the individual error codes.

@joshtriplett
Copy link
Member

I'd love to see this, to make Rust development more accessible to more users.

In order to ensure that those users can also receive more effective support, we should ensure that rustc and other tools provide some convenient way to get the original error messages rather than localized messages, for copy/pasting to one of the various Rust support forums/channels (as opposed to localized support forums/channels). On POSIX systems, a user can just run (for instance) LC_ALL=C cargo build. Any localization mechanism on other platforms, such as Windows or OSX, should use the native localization conventions of those platforms, but must provide some easy way to get unlocalized messages without changing the system-wide language setting.

@montao
Copy link

montao commented Jan 15, 2017

I'm a Rust newbie interested in this issue. I have a project that uses Rust and can try to localize it to 2 languages and see what works. I previously used gettext with .po files or i18n properties files. It could be good to stay with the .po file formats so that we can reuse .po files.

@est31
Copy link
Member

est31 commented Jan 17, 2017

Related: #822

@KiChjang
Copy link
Member

#822 talks about implementing a l20n-based library, which actually already exists in our cargo crates ecosystem - https://crates.io/crates/l20n.

@mgattozzi
Copy link
Contributor

It hasn't been updated in a year but @seanmonstar is an active Rust developer. I bet with a little community love it could be brought to a robust state for the compiler.

@binarycrusader
Copy link

While I commend looking forward to the l20n standard and relevant file formats, I'd just like to mention that for many existing vendors, the .po format is standard and expected. Translation processes, personnel, etc. have all been trained and educated for dealing with gettext-style translation processes. That doesn't mean there isn't room for other formats, but it is something that I think many would appreciate being considered in the future.

@jaroslaw-weber
Copy link

im against. too much work not really much gain, only increased confusion cause same error different languages. who is going to decide on terminology?

@golddranks
Copy link

golddranks commented Jul 11, 2017

Translating the tooling has an enormous gain for communities where English proficiency isn't generally high. Also, the "too much work" argument doesn't weigh much if the majority of the work is done by people that are currently not participating in the community because of the language barrier. All the "regular" contributors have to do is to enable the change and make it translations easy enough to do – they don't need to do the work themselves. What's more, allowing more people to participate in the community, we might be unlocking a future generation of other patches too.

Error messages are a solvable problem – we already have the error codes which are and should be shared across the languages.

Who is going to decide on terminology is a non-problem, but mind you, the language communities are already building their documentation etc. and the terminology is going to grow – and already is growing – organically. I believe, here, in do-ocracy where the individuals who have the energy and motivation to do so, contribute for the community.

@jaroslaw-weber
Copy link

u have a point. although i think starting with documentation would be nice.

@jibal
Copy link

jibal commented Oct 24, 2018

a l20n-based library

l20n is a misnomer. The correct term is l10n, which is short for localization, which has 10 letters between the l and the n. (Likewise i18n for internationalization, and g11n for globalization.)

@Nemo157
Copy link
Member

Nemo157 commented Oct 24, 2018

@jibal l20n is a specific implementation of a l10n library: http://l20n.org/

@jibal
Copy link

jibal commented Oct 24, 2018

@Nemo157 I'm now aware of that, thanks. l20n was a very poor choice of a "clever" name -- what 20 letters are supposed to go between the l and the n? Fortunately, l20n has been supplanted by Fluent and l20n is now deprecated (l20n/spec#17) and Rust's plans for i18n of the compiler, I am told, are to use Fluent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests