File tree Expand file tree Collapse file tree 6 files changed +37
-59
lines changed
docs/documentation/ko/tutorials Expand file tree Collapse file tree 6 files changed +37
-59
lines changed Original file line number Diff line number Diff line change 11
11
- uses : actions/setup-node@v1
12
12
- run : yarn install
13
13
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
40
14
- run : yarn danger ci
41
15
env :
42
16
DEBUG : " *"
43
17
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 }}
Original file line number Diff line number Diff line change 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' )
12
2
import { danger , message } from "danger"
13
3
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
+ }
19
20
20
- message ( `PR: ${ JSON . stringify ( danger . github . pr , null , " " ) } ` )
21
+ go ( )
Original file line number Diff line number Diff line change @@ -24,3 +24,5 @@ TypeScript는 [JSX](/docs/handbook/jsx.html)를 지원하며 `useState`와 같
24
24
25
25
- [ React TypeScript Cheatsheets] ( https://react-typescript-cheatsheet.netlify.app )
26
26
- [ React & Redux in TypeScript] ( https://github.com/piotrwitek/react-redux-typescript-guide#react--redux-in-typescript---complete-guide )
27
+
28
+
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ TypeScript의 클래스는 JavaScript에서 자주 사용되는 동일한 프로
172
172
</html >
173
173
```
174
174
175
+
175
176
브라우저에서 ` greeter.html ` 을 열어 첫 번째 간단한 TypeScript 웹 애플리케이션을 실행하세요!
176
177
177
178
추가로: Visual Studio에서 ` greeter.ts ` 를 열거나, TypeScript playground에 코드를 복사해보세요.
Original file line number Diff line number Diff line change 11
11
"test" : " yarn validate-paths"
12
12
},
13
13
"dependencies" : {
14
+ "@orta/markdown-translator" : " ^0.4.2" ,
14
15
"@oss-docs/sync" : " *" ,
15
- "danger" : " ^10.6.0" ,
16
- "markdown-translator" : " ^0.4.2"
16
+ "danger" : " ^10.6.0"
17
17
}
18
18
}
Original file line number Diff line number Diff line change 120
120
" @octokit/openapi-types" " ^3.2.0"
121
121
" @types/node" " >= 8"
122
122
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
+
123
136
" @oss-docs/sync@* " :
124
137
version "1.0.0"
125
138
resolved "https://registry.yarnpkg.com/@oss-docs/sync/-/sync-1.0.0.tgz#72bf1a7bd7bee3dd543558d658e32f4928d45601"
@@ -1477,19 +1490,6 @@ markdown-table@^2.0.0:
1477
1490
dependencies :
1478
1491
repeat-string "^1.0.0"
1479
1492
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
-
1493
1493
mdast-util-compact@^2.0.0 :
1494
1494
version "2.0.1"
1495
1495
resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz#cabc69a2f43103628326f35b1acf735d55c99490"
You can’t perform that action at this time.
0 commit comments