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

Fix issue with Google Translate #2266

Merged
merged 2 commits into from
Feb 10, 2020
Merged

Fix issue with Google Translate #2266

merged 2 commits into from
Feb 10, 2020

Conversation

johnpryan
Copy link
Contributor

@johnpryan johnpryan commented Feb 7, 2020

Google translate will process any <pre> tags unless they include a <code> tag too. This fixes any snippets generated by create_code_with_tooltips.dart and all code snippets using the prettify Liquid plugin.

fixes #2260

@johnpryan johnpryan requested a review from kwalrath February 7, 2020 21:26
@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Feb 7, 2020
@johnpryan
Copy link
Contributor Author

This doesn't fully fix #2260 yet... investigating.

@johnpryan johnpryan changed the title Fix issue where Google Translate processed code with tooltips Fix issue with Google Translate Feb 7, 2020
@johnpryan
Copy link
Contributor Author

This is a big change, so I've deployed them here: https://jr-dartlang-1.firebaseapp.com - we should probably kick the tires a bit. I've been using the Google Translate chrome extension to test

Copy link
Contributor

@kwalrath kwalrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I've staged it here: https://kw-www-dartlang-1.firebaseapp.com/tutorials/server/cmdline

How do we confirm that Google Translate is treating it correctly?

@kwalrath
Copy link
Contributor

kwalrath commented Feb 7, 2020

Didn't see your comment, @johnpryan :).

@MitaiGit can you confirm that this fixes #2260?

@@ -4,6 +4,7 @@
from sources in the example folder.
{% endcomment -%}
<pre class="prettyprint lang-dart">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from <code> to tag=pre+code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I don't think that's required here. (This file is generated by the script.)

@kwalrath
Copy link
Contributor

kwalrath commented Feb 7, 2020

When I compare the original (https://dart.dev/tutorials/server/cmdline#overview-of-the-dcat-app-code) to my staged version (https://kw-www-dartlang-1.firebaseapp.com/tutorials/server/cmdline#overview-of-the-dcat-app-code), I see extra space above the first line (import 'dart:convert';) in the staged version.

I don't see this anywhere else, so I think it's just a buglet in the included file (src/_tutorials/server/_dcat-example.html).

I'll continue looking...

@kwalrath
Copy link
Contributor

kwalrath commented Feb 7, 2020

The samples page is much better with these changes, hooray! (I compared https://jr-dartlang-1.firebaseapp.com/samples#control-flow-statements to https://dart.dev/samples#control-flow-statements, using the Google Translate extension to translate both pages to Spanish.)

@kwalrath
Copy link
Contributor

kwalrath commented Feb 8, 2020

Everything I've spot-checked LGTM with the exception of that one bit of extra space in the command-line tutorial (not a big deal).

I say we ship it.

@ghost
Copy link

ghost commented Feb 8, 2020

Снимок экрана от 2020-02-08 22-50-05

@johnpryan
Copy link
Contributor Author

@MitaiGit this hasn't been released yet, hang tight.

@kwalrath kwalrath merged commit a720ac4 into dart-lang:master Feb 10, 2020
@kwalrath
Copy link
Contributor

We can fix the extra space in the command-line tutorial later.

@kwalrath
Copy link
Contributor

Confirmed that the website has been updated. @MitaiGit please let us know if you find any other issues.

@ghost
Copy link

ghost commented Feb 10, 2020

Подтвердили, что сайт обновлен. @ MitaiGit, пожалуйста, дайте нам знать, если вы обнаружите какие-либо другие проблемы.

https://dart.dev/tutorials/language/streams
Снимок экрана от 2020-02-10 22-55-45

@kwalrath
Copy link
Contributor

Could you try in an incognito window (or empty the cache another way)? The code in that page is working for me (although it looks like we should code font await for in the text):

image

@ghost
Copy link

ghost commented Feb 10, 2020

there is a more interesting fragment, it is partially translated
Снимок экрана от 2020-02-10 23-05-23

@kwalrath
Copy link
Contributor

I wonder why non-code-font words are sometimes translated and sometimes not. Also, I wonder if there's a way to mark a word as untranslated without making it code font (which is ugly and takes a lot of space, so we try to avoid it when it's clear that we're talking about API/keywords).

/cc @jcollins-g @kevmoo @jakemac53

@johnpryan johnpryan deleted the translation-tooltips branch April 21, 2020 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Contributor has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When auto-translating docs, code is also translated
3 participants