Skip to content
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

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

Open
shorii opened this issue Jun 16, 2024 · 3 comments
Open
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-rustdoc-ui Area: rustdoc UI (generated HTML) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@shorii
Copy link

shorii commented Jun 16, 2024

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 shorii added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Jun 16, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 16, 2024
@shorii
Copy link
Author

shorii commented Jun 16, 2024

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
Copy link
Contributor

@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.

@workingjubilee workingjubilee changed the title backquoted string is not displaying properly Words in <code></code> in docs make machine translation even weirder than usual Jun 16, 2024
@workingjubilee workingjubilee added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: rustdoc UI (generated HTML) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Jun 16, 2024
@shorii
Copy link
Author

shorii commented Jun 16, 2024

@workingjubilee

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

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

@jieyouxu jieyouxu added C-bug Category: This is a bug. C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. C-bug Category: This is a bug. labels Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-rustdoc-ui Area: rustdoc UI (generated HTML) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants