Skip to content

Commit

Permalink
Merge pull request #180 from microsoft/i8n
Browse files Browse the repository at this point in the history
Support internationalization of text inside the website
  • Loading branch information
Orta authored Jan 15, 2020
2 parents 9dfd3ad + 95d74e7 commit 1b7a7eb
Show file tree
Hide file tree
Showing 42 changed files with 1,564 additions and 400 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
# Check out, and set up the node/ruby infra
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '13.x'

# Get local dependencies
- run: yarn install
Expand Down Expand Up @@ -51,6 +53,10 @@ jobs:
path: './results'

# For danger stuff
- uses: actions/setup-node@v1
with:
node-version: '13.x'

- run: yarn install

# danger for PR builds
Expand Down
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
},
"workbench.colorCustomizations": {
"activityBar.background": "#c4d3e4",
"activityBar.activeBorder": "#f2ccde",
"activityBar.activeBorder": "#c37c9d",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#f2ccde",
"activityBarBadge.background": "#c37c9d",
"activityBarBadge.foreground": "#15202b"
},
"typescript.tsdk": "node_modules/typescript/lib",
"debug.node.autoAttach": "on",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"peacock.color": "#a1b9d4"
}
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"workspaces": [
"packages/*"
],
"engines": {
"node": "^13"
},
"devDependencies": {
"concurrently": "^5.0.2",
"danger": "^9.2.9",
Expand All @@ -15,6 +18,11 @@
"resolutions": {
"@types/react": "16.9.17"
},
"jest": {
"transformIgnorePatterns": [
"/node_modules/(?!intl-messageformat|intl-messageformat-parser).+\\.js$"
]
},
"scripts": {
"bootstrap": "yarn workspaces run bootstrap; yarn workspaces run build",
"start": "concurrently -p \"[{name}]\" -n \"BUILD,SITE\" -c \"bgBlue.bold,bgMagenta.bold\" \"node watcher.js\" \"yarn workspace typescriptlang-org start\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-twoslasher/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export function twoslasher(
length = 0
if (quickInfo && token && quickInfo.displayParts) {
text = quickInfo.displayParts.map(dp => dp.text).join('')
docs = quickInfo.documentation ? quickInfo.documentation.map(d => d.text).join('\n') : undefined
docs = quickInfo.documentation ? quickInfo.documentation.map(d => d.text).join('<br/>') : undefined
length = token[0].textSpan.start
start = token[0].textSpan.length
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
display: "Pr0ject Opt1ons"
---

These settings ar3 used to define the runtime expectations of ur project, how and where u want the J\$ to be emittd and the lvl of integrat0n you want with existing JS code.
These settings ar3 used to define the runtime expectations of ur project, how and where u want the J\$ to be emittd and the lvl of integ8ion you want with existing JS code.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
display: "Fil3s"
---

B1ts and d1gits for setting up the filez
21 changes: 11 additions & 10 deletions packages/typescriptlang-org/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
require("ts-node").register({ files: true })
const { join } = require("path")

const shiki = join(
require.resolve(`gatsby-remark-shiki`),
"..",
"..",
"package.json"
)
console.log(shiki)
// prettier-ignore
const shiki = join(require.resolve(`gatsby-remark-shiki`), "..", "..", "package.json")

module.exports = {
// This should only be used in a CI deploy while we're working in a v2 sub-folder
Expand Down Expand Up @@ -69,6 +64,13 @@ module.exports = {
name: `playground-examples`,
},
},
{
resolve: "gatsby-plugin-i18n",
options: {
langKeyDefault: "en",
useLangKeyLayout: true,
},
},
// Markdown support
{
resolve: `gatsby-transformer-remark`,
Expand All @@ -89,11 +91,10 @@ module.exports = {
},
"gatsby-remark-autolink-headers",
{
// resolve: require.resolve(`${__dirname}/../gatsby-remark-shiki`),
// resolve: require.resolve(`gatsby-remark-shiki`),
resolve: shiki,
options: {
theme: "nord",
// theme: "nord",
theme: require.resolve("./lib/themes/typescript-beta-light.json"),
},
},
"gatsby-remark-copy-linked-files",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const createTSConfigReference = async (
path: element.name + "/tsconfig",
component: tsConfigRefPage,
context: {
locale: element.name,
tsconfigMDPath: element.absolutePath,
categoriesPath: categoriesForLang,
},
Expand Down
Loading

0 comments on commit 1b7a7eb

Please sign in to comment.