Site-www: When auto-translating docs, code is also translated

Created on 6 Feb 2020  ·  11Comments  ·  Source: dart-lang/site-www

Page URL: https://dart.dev/tutorials/server/cmdline
Page source: https://github.com/dart-lang/site-www/tree/master/src/_tutorials/server/cmdline.md

Found a typo? You can fix it yourself by going to the page source and clicking the pencil icon. Or finish creating this issue.

Description of issue: при нажатии перевести на русский так же переводится и код языка, и что это за учебник который говорит скопируйте вот эту простыню кода, теперь у вас все работает, круто да? вам его писал тот же чувак что писал Тур Героев? полный атстой

help wanted infrastructure needs-info

All 11 comments

Снимок экрана от 2020-02-07 00-31-00

From Google Translate:

when you click translate into Russian, the language code is also translated, and what kind of textbook that says copy this sheet of code, now everything works for you, is it cool? did the same dude write to you that wrote the Tour of Heroes? full atstoy

I'm surprised that the code is also translated. Is there a way we can prevent that from happening?

Из Google Translate:

когда вы нажимаете «перевести на русский», код языка также переводится, и что за учебник, в котором написано «скопируйте этот лист кода», теперь у вас все работает, это круто? тебе написал тот же самый чувак, который написал «Тур героев»? полный ацтой

Я удивлен, что код также переведен. Есть ли способ, которым мы можем предотвратить это?

you can see how this is implemented in angulardart in their tutorial, code snippets are not translated

want a joke? angulardart tutorial on creating modern sites, does not have any mention of image output, they teach people to create book sites?))

your textbooks are just a quiet horror

Let's keep this conversation on topic and constructive: https://dart.dev/code-of-conduct

Looking at https://angulardart.dev/tutorial/toh-pt0, I suspect that the code snippets aren't translated because the code is in an Angular component (<ng-transclude>).

I don't think we want to introduce an Angular dependency into dart.dev, but I wonder whether there's another way we could make Google Translate avoid translating our code.

/cc @johnpryan

I think the issue here is that not all samples on https://dart.dev/tutorials/server/cmdline are wrapped in a <code> tag.

Is it the code snippets with highlights that are the problem? (In the source code, the snippets with highlights use {% prettify dart %} instead of ```dart.)

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesderlin picture jamesderlin  ·  3Comments

kwalrath picture kwalrath  ·  3Comments

dev-aentgs picture dev-aentgs  ·  3Comments

kwalrath picture kwalrath  ·  5Comments

tehsphinx picture tehsphinx  ·  3Comments