rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
94.69k stars 12.2k forks source link

Words in `<code></code>` in docs make machine translation even weirder than usual #126532

Open shorii opened 2 weeks ago

shorii commented 2 weeks ago

Location

This happens all over the page.

https://doc.rust-lang.org/core/mem/union.MaybeUninit.html

Summary

Some backquoated string move to the end of the sentence.

docoutput doccode

shorii commented 2 weeks ago

I'm so sorry. This is my fault. I translated this page with translation functionality of browser. After that, I returned it back to its original state, then this happened.

workingjubilee commented 2 weeks ago

@shorii

Hello, can you report what language you translated it to, and which browser, with which version? We want to make Rust accessible in other human languages, and if people are using auto-translation via their browser's features, but the results are even more garbled than usual, it would be good to know. We may be able to alter the HTML output to reduce this effect without reducing the readability... or not! It's hard to tell if we don't know specifics. We may still close this issue, but it would be good to have more information, if you are willing to give it to us.

Using Google's website translations, translating it to Spanish does cause this occur, but only in one place that I can see:

spanish translation saying Si Tes seguro para FFI, entonces también lo es MaybeUninit<T>. Si bien MaybeUninites #[repr(transparent)](lo que indica que garantiza el mismo tamaño, alineación y ABI que T), esto no cambia ninguna de las advertencias anteriores. Option<T>y Option<MaybeUninit<T>>aún pueden tener diferentes tamaños, y los tipos que contienen un campo de tipo Tpueden tener un diseño (y un tamaño) diferente que si ese campo fuera MaybeUninit<T>. MaybeUninites un tipo de unión y #[repr(transparent)]en las uniones es inestable consulte el problema de seguimiento. Con el tiempo, las garantías exactas de #[repr(transparent)]los sindicatos pueden evolucionar y MaybeUninitpueden permanecer o no #[repr(transparent)]. Dicho esto, siempreMaybeUninit<T> garantizará que tenga el mismo tamaño, alineación y ABI que ; es sólo que la forma en que se implementa esa garantía puede evolucionar.TMaybeUninit

ですけど、日本語で:

Japanese translating saying これは、実行時チェックの省略やレイアウトの最適化など、さまざまな最適化のためにコンパイラによって活用されますenum。同様に、完全に初期化されていないメモリには任意のコンテンツを含めることができますが、 は常にまたはboolである必要があります。したがって、初期化されていない を作成することは未定義の動作です。truefalsebool

Auf Deutsch:

Deutsch translation saying Erstellt ein neues Objekt in einem nicht initialisierten Zustand, wobei der Speicher mit Bytes MaybeUninit<T>gefüllt wird . Es hängt davon ab , ob dies bereits für eine ordnungsgemäße Initialisierung sorgt. Beispielsweise ist initialisiert, ist aber nicht, da Referenzen nicht null sein dürfen.0TMaybeUninit<usize>::zeroed()MaybeUninit<&'static i32>::zeroed()

So it seems language dependent. It may be based on the language's natural word ordering? English and Spanish are generally SVO, Japanese and German are usually considered SOV.

shorii commented 2 weeks ago

@workingjubilee

Thank you for your reply. I translated it to japanese via Microsoft Edge.

スクリーンショット 2024-06-16 142503