Skip to content

Commit b15a560

Browse files
committed
Merge
2 parents 95be6f1 + 3f93044 commit b15a560

File tree

6 files changed

+37
-59
lines changed

6 files changed

+37
-59
lines changed

.github/workflows/post-localizations.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,8 @@ jobs:
1111
- uses: actions/setup-node@v1
1212
- run: yarn install
1313

14-
- name: Dump GitHub context
15-
env:
16-
GITHUB_CONTEXT: ${{ toJSON(github) }}
17-
run: echo "$GITHUB_CONTEXT"
18-
- name: Dump job context
19-
env:
20-
JOB_CONTEXT: ${{ toJSON(job) }}
21-
run: echo "$JOB_CONTEXT"
22-
- name: Dump steps context
23-
env:
24-
STEPS_CONTEXT: ${{ toJSON(steps) }}
25-
run: echo "$STEPS_CONTEXT"
26-
- name: Dump runner context
27-
env:
28-
RUNNER_CONTEXT: ${{ toJSON(runner) }}
29-
run: echo "$RUNNER_CONTEXT"
30-
- name: Dump strategy context
31-
env:
32-
STRATEGY_CONTEXT: ${{ toJSON(strategy) }}
33-
run: echo "$STRATEGY_CONTEXT"
34-
- name: Dump matrix context
35-
env:
36-
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
37-
run: echo "$MATRIX_CONTEXT"
38-
39-
# Update all the translation issues on a nightly basis
4014
- run: yarn danger ci
4115
env:
4216
DEBUG: "*"
4317
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
AZURE_TRANSLATION_SUB_KEY: ${{ secrets.AZURE_TRANSLATION_SUB_KEY }}
18+
AZURE_TRANSLATE_KEY: ${{ secrets.AZURE_TRANSLATE_KEY }}

dangerfile.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
// const markdownTranslate = require('markdown-translator')
2-
// markdownTranslate({
3-
// src: pathToSrcFile,
4-
// from: languageToTranslateFrom,
5-
// to: languageToTranslateTo,
6-
// subscriptionKey: yourSubscriptionKey,
7-
// region: theRegionOfYourAzureInstance
8-
// }).then(res => {
9-
10-
// })
11-
1+
const markdownTranslate = require('@orta/markdown-translator')
122
import {danger, message} from "danger"
133

14-
const allFiles = [...danger.git.created_files, ...danger.git.created_files]
15-
console.log(allFiles.join(", "))
16-
message("Hello")
17-
18-
message(`Files: ${allFiles.join("")}`)
4+
const go = async () => {
5+
const allMDFiles = [...danger.git.modified_files, ...danger.git.created_files].filter(f => f.endsWith(".md")).filter(f => f.split("/").length > 2)
6+
console.log(allMDFiles)
7+
for (const file of allMDFiles) {
8+
const fileContents = await danger.github.utils.fileContents(file)
9+
const translation = await markdownTranslate({
10+
text: fileContents,
11+
from: file.split("/")[2],
12+
to: "en",
13+
subscriptionKey: process.env.AZURE_TRANSLATE_KEY,
14+
region: "eastus"
15+
})
16+
17+
message(`Translation of ${danger.github.utils.fileLinks([file])}\n\n${translation}`)
18+
};
19+
}
1920

20-
message(`PR: ${JSON.stringify(danger.github.pr, null, " ")}`)
21+
go()

docs/documentation/ko/tutorials/React.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ TypeScript는 [JSX](/docs/handbook/jsx.html)를 지원하며 `useState`와 같
2424

2525
- [React TypeScript Cheatsheets](https://react-typescript-cheatsheet.netlify.app)
2626
- [React & Redux in TypeScript](https://github.com/piotrwitek/react-redux-typescript-guide#react--redux-in-typescript---complete-guide)
27+
28+

docs/documentation/ko/tutorials/TypeScript Tooling in 5 minutes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ TypeScript의 클래스는 JavaScript에서 자주 사용되는 동일한 프로
172172
</html>
173173
```
174174

175+
175176
브라우저에서 `greeter.html`을 열어 첫 번째 간단한 TypeScript 웹 애플리케이션을 실행하세요!
176177

177178
추가로: Visual Studio에서 `greeter.ts`를 열거나, TypeScript playground에 코드를 복사해보세요.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"test": "yarn validate-paths"
1212
},
1313
"dependencies": {
14+
"@orta/markdown-translator": "^0.4.2",
1415
"@oss-docs/sync": "*",
15-
"danger": "^10.6.0",
16-
"markdown-translator": "^0.4.2"
16+
"danger": "^10.6.0"
1717
}
1818
}

yarn.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@
120120
"@octokit/openapi-types" "^3.2.0"
121121
"@types/node" ">= 8"
122122

123+
"@orta/markdown-translator@^0.4.2":
124+
version "0.4.3"
125+
resolved "https://registry.yarnpkg.com/@orta/markdown-translator/-/markdown-translator-0.4.3.tgz#3e8e453ce3a0fa6cd77c33333578b4a7877ac1cd"
126+
integrity sha512-RM0hjJ9YvtpVKPFi8iWbATofuSlrD4R/7zpbh4Qpb/Jo0s9GY+vR9GiprvLLyxMX86CzfirEJIWaXVjv3ZTypA==
127+
dependencies:
128+
commander "^5.0.0"
129+
lodash.chunk "^4.2.0"
130+
lodash.flatten "^4.4.0"
131+
lodash.merge "^4.6.1"
132+
remark "^12.0.0"
133+
request "^2.88.0"
134+
unified-stream "^1.0.4"
135+
123136
"@oss-docs/sync@*":
124137
version "1.0.0"
125138
resolved "https://registry.yarnpkg.com/@oss-docs/sync/-/sync-1.0.0.tgz#72bf1a7bd7bee3dd543558d658e32f4928d45601"
@@ -1477,19 +1490,6 @@ markdown-table@^2.0.0:
14771490
dependencies:
14781491
repeat-string "^1.0.0"
14791492

1480-
markdown-translator@^0.4.2:
1481-
version "0.4.2"
1482-
resolved "https://registry.yarnpkg.com/markdown-translator/-/markdown-translator-0.4.2.tgz#82480ebc6b46be3031bed4fd5f27d489230beb8f"
1483-
integrity sha512-EVC/eqG32BDnu9onmmaCeOKJoRvvdgdGMezCsbzEBoMwq8WuQ7gotdvjeljdnOeI2/gZwZ4o8MpE2Qo8KTQJ4A==
1484-
dependencies:
1485-
commander "^5.0.0"
1486-
lodash.chunk "^4.2.0"
1487-
lodash.flatten "^4.4.0"
1488-
lodash.merge "^4.6.1"
1489-
remark "^12.0.0"
1490-
request "^2.88.0"
1491-
unified-stream "^1.0.4"
1492-
14931493
mdast-util-compact@^2.0.0:
14941494
version "2.0.1"
14951495
resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz#cabc69a2f43103628326f35b1acf735d55c99490"

0 commit comments

Comments
 (0)