Skip to content

Commit

Permalink
chore: update azure-translator-code to version 1.1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed Oct 25, 2024
1 parent 1bd358d commit 7b892a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@vercel/analytics": "^1.3.1",
"ace-builds": "^1.34.2",
"azure-translator-code": "^1.1.6",
"azure-translator-code": "^1.1.16",
"next": "14.2.3",
"next-international": "^1.2.4",
"react": "^18",
Expand Down
15 changes: 8 additions & 7 deletions docs/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use server";

import { translate } from "azure-translator-code";
import { TranslationType } from "azure-translator-code/types/types";
import { translate, TranslationType } from "azure-translator-code";
import { v4 as uuidv4 } from "uuid";

import { getScopedI18n } from "@/locales/server";
Expand Down Expand Up @@ -58,21 +57,23 @@ export async function makeTranslation(prevState: any, formData: FormData) {
const key = process.env.AZURE_API_KEY ?? ""; // REPLACE WITH YOUR OWN KEY HERE
const endpoint = process.env.AZURE_ENDPOINT ?? "";
const location = process.env.AZURE_LOCATION ?? "";
const fromLang = data.fromLang;
const toLang = data.toLang;
const fromLang = data.fromLang as string;
const toLang = data.toLang as string;

let translatedValues: TranslationType;

const valuesToTranslate = data.jsonFileText;

const toLangs = [toLang];

try {
translatedValues = await translate(
key,
endpoint,
location,
fromLang as string,
toLang as string,
JSON.parse(valuesToTranslate as string) as TranslationType,
fromLang,
toLangs,
JSON.parse(valuesToTranslate as string),
);
} catch {
return {
Expand Down
31 changes: 11 additions & 20 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^1.5.0":
"axios@npm:^1.7.7":
version: 1.7.7
resolution: "axios@npm:1.7.7"
dependencies:
Expand All @@ -1109,13 +1109,13 @@ __metadata:
languageName: node
linkType: hard

"azure-translator-code@npm:^1.1.6":
version: 1.1.6
resolution: "azure-translator-code@npm:1.1.6"
"azure-translator-code@npm:^1.1.16":
version: 1.1.16
resolution: "azure-translator-code@npm:1.1.16"
dependencies:
axios: "npm:^1.5.0"
uuid: "npm:^9.0.1"
checksum: 10c0/7bfa0f700706576b36cbb999274c3edd588f5a908af986a32650020a45eee004b9e265a5014d65a6cb21f2c609f498fa3b711f16d43c67bf4e153bf3980e86f8
axios: "npm:^1.7.7"
uuid: "npm:^10.0.0"
checksum: 10c0/3abb3f4aba4ca8a5299267a0d02162228c2a1342f5bd1542a40e9182eadebcf05f8bf5aed198c80ac067af4b0d96dbb7e80888bb7c4a7b79007fab202f19be3c
languageName: node
linkType: hard

Expand All @@ -1130,7 +1130,7 @@ __metadata:
"@types/uuid": "npm:^9.0.8"
"@vercel/analytics": "npm:^1.3.1"
ace-builds: "npm:^1.34.2"
azure-translator-code: "npm:^1.1.6"
azure-translator-code: "npm:^1.1.16"
eslint: "npm:^8.57.0"
eslint-config-next: "npm:14.2.3"
eslint-config-universe: "npm:^12.1.0"
Expand Down Expand Up @@ -2354,13 +2354,13 @@ __metadata:
linkType: hard

"form-data@npm:^4.0.0":
version: 4.0.0
resolution: "form-data@npm:4.0.0"
version: 4.0.1
resolution: "form-data@npm:4.0.1"
dependencies:
asynckit: "npm:^0.4.0"
combined-stream: "npm:^1.0.8"
mime-types: "npm:^2.1.12"
checksum: 10c0/cb6f3ac49180be03ff07ba3ff125f9eba2ff0b277fb33c7fc47569fc5e616882c5b1c69b9904c4c4187e97dd0419dd03b134174756f296dec62041e6527e2c6e
checksum: 10c0/bb102d570be8592c23f4ea72d7df9daa50c7792eb0cf1c5d7e506c1706e7426a4e4ae48a35b109e91c85f1c0ec63774a21ae252b66f4eb981cb8efef7d0463c8
languageName: node
linkType: hard

Expand Down Expand Up @@ -5182,15 +5182,6 @@ __metadata:
languageName: node
linkType: hard

"uuid@npm:^9.0.1":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
bin:
uuid: dist/bin/uuid
checksum: 10c0/1607dd32ac7fc22f2d8f77051e6a64845c9bce5cd3dd8aa0070c074ec73e666a1f63c7b4e0f4bf2bc8b9d59dc85a15e17807446d9d2b17c8485fbc2147b27f9b
languageName: node
linkType: hard

"which-boxed-primitive@npm:^1.0.2":
version: 1.0.2
resolution: "which-boxed-primitive@npm:1.0.2"
Expand Down

0 comments on commit 7b892a5

Please sign in to comment.