File tree Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Original file line number Diff line number Diff line change 1
1
import { useRef } from "react"
2
2
import dynamic from "next/dynamic"
3
3
import { useLocale } from "next-intl"
4
- import { useDocSearchKeyboardEvents } from "@docsearch/react"
5
- import { DocSearchHit } from "@docsearch/react/dist/esm/types"
4
+ import { type DocSearchHit , useDocSearchKeyboardEvents } from "@docsearch/react"
6
5
import * as Portal from "@radix-ui/react-portal"
7
6
8
7
import { trackCustomEvent } from "@/lib/utils/matomo"
Original file line number Diff line number Diff line change 1
- import { ReportsModel } from "@crowdin/crowdin-api-client"
2
-
3
1
import { NavSectionKey } from "@/components/Nav/types"
4
2
5
3
import i18nConfig from "../../i18n.config.json"
@@ -62,16 +60,6 @@ export const CROWDIN_PROJECT_URL = "https://crowdin.com/project/ethereum-org"
62
60
export const CROWDIN_PROJECT_ID = 363359
63
61
export const CROWDIN_API_MAX_LIMIT = 500
64
62
export const FIRST_CROWDIN_CONTRIBUTION_DATE = "2019-07-01T00:00:00+00:00"
65
- export const REGULAR_RATES : ReportsModel . RegularRate [ ] = [
66
- {
67
- mode : "tm_match" ,
68
- value : 1.01 ,
69
- } ,
70
- {
71
- mode : "no_match" ,
72
- value : 1.01 ,
73
- } ,
74
- ]
75
63
76
64
export const languagePathRootRegExp = / ^ .+ \/ c o n t e n t \/ t r a n s l a t i o n s \/ [ a - z - ] * \/ /
77
65
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { ReportsModel } from "@crowdin/crowdin-api-client"
3
3
import {
4
4
CROWDIN_PROJECT_ID ,
5
5
FIRST_CROWDIN_CONTRIBUTION_DATE ,
6
- REGULAR_RATES ,
7
6
} from "../../../lib/constants"
8
7
import crowdinClient from "../api-client/crowdinClient"
9
8
@@ -25,22 +24,45 @@ export async function fetchTranslationCostsReport(
25
24
26
25
// Todo: Remove ts-ignore when this PR gets merged
27
26
// https://github.com/crowdin/crowdin-api-client-js/pull/282
28
- const schema : ReportsModel . TranslationCostSchema = {
27
+ // const schema: ReportsModel.TranslationCostSchema = {
28
+ const schema : ReportsModel . TranslationCostsPostEndingSchema = {
29
29
unit : "words" ,
30
30
currency : "USD" ,
31
- mode : "simple" ,
32
31
format : "json" ,
32
+ baseRates : {
33
+ fullTranslation : 0.1 ,
34
+ proofread : 0.12 ,
35
+ } ,
36
+ individualRates : [ ] ,
37
+ netRateSchemes : {
38
+ tmMatch : [
39
+ {
40
+ matchType : "perfect" ,
41
+ price : 0.1 ,
42
+ } ,
43
+ ] ,
44
+ mtMatch : [
45
+ {
46
+ matchType : "perfect" ,
47
+ price : 0.05 ,
48
+ } ,
49
+ ] ,
50
+ suggestionMatch : [
51
+ {
52
+ matchType : "perfect" ,
53
+ price : 0.08 ,
54
+ } ,
55
+ ] ,
56
+ } ,
33
57
groupBy : "user" ,
34
- regularRates : REGULAR_RATES ,
35
58
dateFrom : FIRST_CROWDIN_CONTRIBUTION_DATE ,
36
59
dateTo,
37
60
languageId : crowdinLangCode ,
38
- // @ts -expect-error Not part of the Crowdin schema type, which is deprecated anyway
39
61
fileIds : [ fileId ] ,
40
62
}
41
63
42
64
const reportRequest : ReportsModel . GenerateReportRequest = {
43
- name : "translation-costs" ,
65
+ name : "translation-costs-pe " ,
44
66
schema : schema ,
45
67
}
46
68
You can’t perform that action at this time.
0 commit comments