Skip to content

Commit

Permalink
feat: integrate Azure Translator API and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed Nov 1, 2024
1 parent f096d49 commit e40398e
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 224 deletions.
6 changes: 4 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
"dependencies": {
"@vercel/analytics": "^1.3.1",
"ace-builds": "^1.34.2",
"axios": "^1.7.7",
"azure-translator-code": "^1.1.17",
"next": "14.2.3",
"next-international": "^1.2.4",
"react": "^18",
"react-ace": "^11.0.1",
"react-dom": "^18",
"react-icons": "^5.2.1",
"react-icons": "^5.3.0",
"react-syntax-highlighter": "^15.5.0",
"sharp": "^0.33.4",
"sharp": "^0.33.5",
"uuid": "^11.0.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use server";

import { translate, translateText } from "azure-translator-code";

import localesCodes from "@/lib/localesCode";
import translate from "@/lib/translate";
import { translateText } from "@/lib/translateText";
import { getScopedI18n } from "@/locales/server";

const key = process.env.AZURE_API_KEY ?? "";
Expand Down
162 changes: 0 additions & 162 deletions docs/src/lib/translate.ts

This file was deleted.

33 changes: 0 additions & 33 deletions docs/src/lib/translateText.ts

This file was deleted.

21 changes: 0 additions & 21 deletions docs/src/types/translations/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
/**
* Represents the type of a translation object.
*/
export interface TranslationType {
[key: string]: JSONValue;
}

export type JSONValue =
| string
| number
| boolean
| null
| JSONArray
| TranslationType
| object;
export interface JSONArray extends Array<JSONValue> {}

export type TranslationTextFetch = {
translations: { text: string; to: string }[];
}[];

export type LanguagesCode =
| "en"
| "pt"
Expand Down
Loading

0 comments on commit e40398e

Please sign in to comment.