-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Investigate implementing an l20n-based localization library #822
Comments
rust-lang/rust#14495 (comment) is especially releavnt, as some work was being done on this already. |
"l20n" is a bizarre term. The usual terms are l10n, short for localization, which has 10 letters between the l and the n, i18n for internationalization, and g11n for globalization. |
@jibal http://l20n.org/ It's a play of words. Citating https://wiki.mozilla.org/L20n |
@White-Oak It's an ill-considered one. l10n, i18n, and g11n make sense and fit an established pattern ... l20n is just dumb marketing junk ... and I've actually seen Rustaceans misuse l20n as if it was the shorthand for "localization". And the l20n details seem to be quite an overengineered mess and a poor fit to Rust. Rust should go with gettext and other established approaches to i18n ... if l20n ever shows any success, Rust can consider adopting it. Unfortunately, Rust is way behind on the important issue of i18n and contains many roadblocks like format strings being statically parsed by the compiler. The chauvinistic inertia against i18n has been overcome by others; hopefully Rust will somehow do the same. |
It seems weird to say Rust is "way behind" on this issue, when you can perfectly well use I think the premise of this issue is no longer true: we have many new language features since this issue was created, like procedural macros, which mean that l10n can be implemented as a crate without sacrificing syntax or usability. There's no need for it to be a language level feature. If you think it should be done a particular way, implement it, publish it to crates.io, and maybe if it becomes popular it could join rust-lang-nursery, or be otherwise "blessed" in some way as the recommended way to do l10n. Starting with "we need to make language changes" seems entirely the wrong way to approach this issue. |
I didn't even remotely say anything about making language changes. I did mention the problem with format! being implemented in the compiler and only taking static strings. And there's no support in the library for locales. And the compiler's messages cannot be localized. Rust is an ecosystem, and as an ecosystem it's clearly way behind. Saying "you can implement it and maybe if it becomes popular" doesn't change that, it just confirms it. |
@Diggsey are there some notable crates you are aware of that you could post for everyone's benefit? If so, I think we can close out this issue as completed (closing issues on this repo makes me happy...). |
@jibal this repo is specifically for changes to the Rust language, so this issue should be closed then, or at least re-purposed. The A quick search of crates.io shows crates like A lack of localisation for the compiler's own error messages is definitely a problem Rust should try to solve, but is quite separate from localisation libraries existing in the ecosystem, and is a problem that few other compilers have yet solved. |
This comment has been minimized.
This comment has been minimized.
Given the list given by @Diggsey, I think we can close this as being completed. |
I would like to note that the name of this RFC is "Investigate implementing an l20n-based localization library", which is not about changes to the language. From https://github.com/rust-lang/rfcs, this repo is not just for changes to the language ... language changes, library changes, and compiler changes are all listed as subjects for RFCs. Also, the relationship of format! to i18n and l10n is clear and well understood and the consequences of the limitation have been remarked on for years, with hopes that the restriction could be removed. Note that i18n is a property of the whole system -- the ability to adapt it to various cultures -- and l10n is the crafting of a culturally specific dataset for an i18n framework. Other language ecosystems allow for l10n of the primary mechanism for generating text messages, and a comment by Graydon Hoare said that it was intended for format! but people ran out of time. |
Hi @jibal
No it's not. It's a play on words. Whether it is a good play on words or not, is up to you. But as one of the authors of the project, I promise you it was not meant as a marketing term :) We changed the name of the project several years ago to Fluent - https://projectfluent.org/
I'm not sure how much experience you have with l10n, but here's our teams take on shortcomings of gettext - https://github.com/projectfluent/fluent/wiki/Fluent-vs-gettext I'd recommend Rust to either go with a bit dated, but high quality system Unicode MessageFormat, or Fluent ( https://github.com/projectfluent/fluent-rs ) Here's on differences between them: https://github.com/projectfluent/fluent/wiki/Fluent-and-ICU-MessageFormat |
I already stated my opinion that it was ill-considered, and why. I think you're taking "marketing" too literally ... taking a widely used term like l10n that follows a specific pattern and morphing it into l20n because that particular implementation is supposedly twice as good or advanced or whatever is "marketing" in a broad sense of the term, and just doesn't look good from the outside. I have no problem with "fluent". Thanks for the links. |
Moderator note: Everyone, please keep the focus on technical discussion of current or future options for Rust code. As this is a fairly outdated issue, it would probably be best to stop discussion here and instead draft an RFC for any specific proposed changes, or to ask questions in new or existing threads in internals.rust-lang.org (for things implemented in the language and standard libraries) or users.rust-lang.org (for thing related to external crates and tools). |
Check. Thanks. Over and out. |
Issue by alexcrichton
Wednesday May 28, 2014 at 18:15 GMT
For earlier discussion, see rust-lang/rust#14495
This issue was labelled with: A-libs, P-high in the Rust repository
Part of this issue is only actionable depending on the outcome of #93.
Localization is a very important feature for a language and is often a very difficult system to get right. Previous attempts with
format!
do not look like they're going to pan out, and it looks like it's possible to implement a high quality localization system purely in a library implementation.The most likely candidate for being implemented is the l20n spec. This is a new standard coming out of Mozilla for the web which is still in some development, but it has seen deployment on Firefox OS and is planned to be deployed in Firefox. Other projects such as django are also looking into implementing this spec, so there's certainly precedent.
A rust implementation of the l20n spec would be a good solution for our localization efforts, but some finesse would be required to ensure that the library is as easily usable as the JS api itself.
Nominating, but I believe that this is not necessary for 1.0
cc @zbraniecki
The text was updated successfully, but these errors were encountered: