Skip to content

Add "Languages" page - #1691

Merged
gaearon merged 9 commits into
reactjs:masterfrom
bvaughn:languages-selector
Feb 23, 2019
Merged

Add "Languages" page#1691
gaearon merged 9 commits into
reactjs:masterfrom
bvaughn:languages-selector

Conversation

@bvaughn

@bvaughnbvaughn commented Feb 15, 2019

Copy link
Copy Markdown
Contributor

Add "Languages" header link and landing page.

You can see it here.

Generating language data

To generate the YAML data, I ran the following script on isreacttranslatedyet.com:

letjson='';Array.from(document.querySelectorAll("a")).forEach(link=>{constheader=link.querySelector("header");if(header){constname=header.children[0].textContent;consttranslatedName=header.children[1].textContent;constcode=header.children[2].textContent.match(/\(([^\.]+)/)[1];json+=`\n- name: ${name}`;json+=`\n translated_name: ${translatedName}`;json+=`\n code: ${code}`;json+=`\n status: 0`;}});console.log(json);

Netlify and Cloudflare setup

LanguageCodeNetlifyCloudflareDomainGitHub
Englishenreactjs.org, en.reactjs.orgrepo
Arabicarar.reactjs.orgrepo
Azerbaijaniazaz.reactjs.orgrepo
Bulgarianbgbg.reactjs.orgrepo
Bengalibnbn.reactjs.orgrepo
Germandede.reactjs.orgrepo
Spanisheses.reactjs.orgrepo
Persianfafa.reactjs.orgrepo
Frenchfrfr.reactjs.orgrepo
Hebrewhehe.reactjs.orgrepo
Hindihihi.reactjs.orgrepo
Armenianhyhy.reactjs.orgrepo
Indonesianidid.reactjs.orgrepo
Italianitit.reactjs.orgrepo
Japanesejaja.reactjs.orgrepo
Koreankoko.reactjs.orgrepo
Malayalammlml.reactjs.orgrepo
Nepalinene.reactjs.orgrepo
Dutchnlnl.reactjs.orgrepo
Polishplpl.reactjs.orgrepo
Portuguese (Brazil)pt-brpt-br.reactjs.orgrepo
Portuguese (Portugal)pt-ptpt-pt.reactjs.orgrepo
Romanianroro.reactjs.orgrepo
Russianruru.reactjs.orgrepo
Sinhalasisi.reactjs.orgrepo
Tamiltata.reactjs.orgrepo
Turkishtrtr.reactjs.orgrepo
Ukrainianukuk.reactjs.orgrepo
Uzbekuzuz.reactjs.orgrepo
Vietnamesevivi.reactjs.orgrepo
Simplified Chinesezh-hanszh-hans.reactjs.orgrepo
Traditional Chinesezh-hantzh-hant.reactjs.orgrepo

@reactjs-bot

reactjs-bot commented Feb 15, 2019

Copy link
Copy Markdown

Deploy preview for reactjs ready!

Built with commit 7c80589

https://deploy-preview-1691--reactjs.netlify.com

@saranshkataria

Copy link
Copy Markdown
Contributor

Wouldn't it be better to redirect to the language based on the browser one? Just a thought

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

Even if we added some sort of language detection/redirect, we'd still want to offer some mechanism for manually selecting a language (not to mention the contribution links) 😄

Comment threadsrc/components/LayoutHeader/Header.js Outdated
Comment threadcontent/languages.yml Outdated
Comment threadsrc/pages/languages.js
</ul>

<p>
Don't see your language above?{' '}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd point the link to here since that's where the actual instructions are.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Cool. Thanks.

Comment threadsrc/pages/languages.js

@ivandevpivandevp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey @bvaughn, there's a typo in variable naming 😃

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

Thanks. Fixed the typo~

@tesseralistesseralis mentioned this pull request Feb 16, 2019
8 tasks
Comment threadsrc/pages/languages.js Outdated
<div css={{marginTop: 10}}>
<a
css={{
fontSize: 12,

@tesseralistesseralisFeb 17, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd make this bigger, maybe 14/16px?

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

Added a translation icon beside the english text "Languages" and made sure that it's still visible, even on mobile layout.

screen shot 2019-02-17 at 10 32 56 pm

@tesseralis

Copy link
Copy Markdown
Contributor

Oh! Should probably include english in the list :)

@bvaughn

bvaughn commented Feb 19, 2019

Copy link
Copy Markdown
ContributorAuthor

Psst ~ https://es.reactjs.org/

Comment threadcontent/languages.yml
code: de
is_completed: false
- name: Spanish
translated_name: Español

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

English goes here!

@tesseralistesseralisFeb 19, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could ask the translations to do it (add english and remove their language from the list) but that’s a lot of redundant effort

Comment threadcontent/languages.yml
is_completed: false
- name: Japanese
translated_name: 日本語
code: ja

@tesseralistesseralisFeb 19, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Technically Japanese and Brazillian Portuguese aren’t completely ready yet so I’d change these to false for now.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

What's the threshold? I don't think they need to be "completely ready".

I guess we can bucket things into three groups:

  • Completed (95%+): Show language subdomain and "contribute" links
  • Partly translated (25%-95%): Show language subdomain and "contribute" links
  • In-progress (< 25%): Show "contribute" links

The question is what should those thresholds be?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The “100%” is for a “core” subset of pages defined by Dan (home page, tutorial, basics, apis). For example, some of the Spanish hooks docs aren’t done yet but it”s still 100% since it finished the core. Japanese and Portuguese are at around 70% on those (Jp doesn’t have the tutorial yet). Plus, there are final tasks like checking for consistency of terminology that need to be done before marking as complete (which I’m going through with Spanish right now)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

That's a little more information than I had before, but I think it's still a bit vague to me. Is this written down somewhere in a more objective format, that we can refer to if we need to know which bucket a given subdomain falls into?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I picked some somewhat arbitrary % thresholds for now (specified via inline comments).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gaearon what do you think?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

At first look, I think the proposed categories are maybe too fine grained.

I don't think it's necessary (or all that helpful) to distinguish between released, complete, and complete+. I also don't really want to have to move sites around between those categories each time we make significant changes to core pages.

Similarly, I'm not sure there's much value in distinguishing between "in-progress" and lesser translated states. I think it's worth showing all translations so that we direct potential contributors to them. I think it is important to indicate "this is not done yet" so we don't get people's hopes up for nothing– but I think the current 3 enums already do this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bvaughn It wouldn't be different sections for "complete"/"complete+" stuff and we don't have to add it in now. It's morel like... giving maintainers a gold star to encourage them to go beyond the core pages of translations.

In that case I'd rather have just "released" and "in progress", without an arbitrary cut-off point. That might be the best option.

But I also want @gaearon to weigh in.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like you two agree on the number of sections on the page but @tesseralis wants to add extra “distinguishing” marks to some translations? I’d say it’s fine to leave it out of the MVP and add a bit later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fine by me. I added the extra steps to isreactreadyyet.com since it's easier to verify those :)

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

I'm going to go through and setup all of the Netlify pages and subdomains now. We don't have to link to them on reactjs.org yet, but I think it's good to have them accessible for people working on the translations, and I'd like to get them out of the way in a big batch.

Brian Vaughn added 2 commits February 19, 2019 14:03
@tesseralis

Copy link
Copy Markdown
Contributor

@bvaughn while the pace of new languages has decressed a lot, what’s the plan for setting up subdomains for any new translations? Is there going to be s plan other than ‘ping Bryan at some point’?

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

Okay. I've setup the Netlify integrations and and DNS records for the 3 new active subdomains (es, ja, and pt-br). When we should we merge this?

@bvaughn

bvaughn commented Feb 19, 2019

Copy link
Copy Markdown
ContributorAuthor

while the pace of new languages has decressed a lot, what’s the plan for setting up subdomains for any new translations? Is there going to be s plan other than ‘ping Bryan at some point’?

I've documented this process internally so hopefully other React core members can help do at least the Netlify portion of the setup. Working to expand the list of people who can also do the DNS bit.

For now though, I'll have to be involved.

I've added a table (to the description of this PR) that tracks that domain status for each of the languages. I'll be gradually adding them all over the next few days.

@bvaughnbvaughn changed the title Added language selector pageAdd "Languages" pageFeb 19, 2019
Comment threadcontent/languages.yml
# Status enums indicate what percentage of "core" content has been translated:
# 0: Incomplete (0–49%)
# 1: Partially complete (50–94%)
# 2: Complete (95–100%)

@tesseralistesseralisFeb 20, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any reason we're using enums instead of strings (incompletepartialcomplete, etc.)?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Because I think the meaning of string labels is ambiguous ("incomplete" and "partial" are synonymous). So I choose a numeric value that at least indicates progression (1 is more complete than 0, 2 is more complete than 1).

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

My gut tells me that what we have in this PR is good enough for MVP, and I have a lot of other things to work on– so unless something small and important needs tweaking, I think I'm going to let this sit until we're ready to merge it and move on to other tasks~ 😄

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

I'm turning off Cloudflare SSL protection for now in favor of using Netlify and Let's Encrypt, because Netlify will handle the auto redirect from HTTP to HTTPS that way. There may be some short disruption where HTTPS doesn't work.

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

Ok. All domains should be good to go with HTTPS redirects now

css={{
fontSize: 12,
}}
href={`https://github.com/reactjs/${prefix}reactjs.org/`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to link to the progress issue for each language since it has the actual instructions for contributing.

It's going to be issue #1 for all languages (since it's auto-generated) except for Spanish, Japanese, and Simplified Chinese, for which it's #4 by a lucky coincidence.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I think linking to the main repo makes more sense. The progress issue seems more transient. I think the repos should rely on something more standard (like the readme or CONTRIBUTING.md) for guidelines rather than a specific issue.

I think i'm going to leave this as-is.

@tesseralis

Copy link
Copy Markdown
Contributor

@bvaughn I think we're ready to merge this. Only outstanding tasks are:

  • switch back to two sections
  • (optionally) link to the progress issue in the "Contribute" link

@bvaughn

Copy link
Copy Markdown
ContributorAuthor

Yeah, I think we're ready too– but I've been holding off on the blog post PR /pull/1721

@gaearon
gaearon merged commit 07253c8 into reactjs:masterFeb 23, 2019
@bvaughn
bvaughn deleted the languages-selector branch February 23, 2019 20:17
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@bvaughn@reactjs-bot@saranshkataria@tesseralis@gaearon@ivandevp@facebook-github-bot