Skip to content

Commit bf0354b

Browse files
committed
fix: type issues
1 parent 0a7fcc8 commit bf0354b

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

src/components/Search/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { useRef } from "react"
22
import dynamic from "next/dynamic"
33
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"
65
import * as Portal from "@radix-ui/react-portal"
76

87
import { trackCustomEvent } from "@/lib/utils/matomo"

src/lib/constants.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { ReportsModel } from "@crowdin/crowdin-api-client"
2-
31
import { NavSectionKey } from "@/components/Nav/types"
42

53
import i18nConfig from "../../i18n.config.json"
@@ -62,16 +60,6 @@ export const CROWDIN_PROJECT_URL = "https://crowdin.com/project/ethereum-org"
6260
export const CROWDIN_PROJECT_ID = 363359
6361
export const CROWDIN_API_MAX_LIMIT = 500
6462
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-
]
7563

7664
export const languagePathRootRegExp = /^.+\/content\/translations\/[a-z-]*\//
7765

src/scripts/crowdin/reports/reportsHelpers.ts

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { ReportsModel } from "@crowdin/crowdin-api-client"
33
import {
44
CROWDIN_PROJECT_ID,
55
FIRST_CROWDIN_CONTRIBUTION_DATE,
6-
REGULAR_RATES,
76
} from "../../../lib/constants"
87
import crowdinClient from "../api-client/crowdinClient"
98

@@ -25,22 +24,45 @@ export async function fetchTranslationCostsReport(
2524

2625
// Todo: Remove ts-ignore when this PR gets merged
2726
// 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 = {
2929
unit: "words",
3030
currency: "USD",
31-
mode: "simple",
3231
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+
},
3357
groupBy: "user",
34-
regularRates: REGULAR_RATES,
3558
dateFrom: FIRST_CROWDIN_CONTRIBUTION_DATE,
3659
dateTo,
3760
languageId: crowdinLangCode,
38-
// @ts-expect-error Not part of the Crowdin schema type, which is deprecated anyway
3961
fileIds: [fileId],
4062
}
4163

4264
const reportRequest: ReportsModel.GenerateReportRequest = {
43-
name: "translation-costs",
65+
name: "translation-costs-pe",
4466
schema: schema,
4567
}
4668

0 commit comments

Comments
 (0)