File tree Expand file tree Collapse file tree 9 files changed +23
-11
lines changed
Expand file tree Collapse file tree 9 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 1212 "@vercel/analytics" : " ^1.3.1" ,
1313 "ace-builds" : " ^1.34.2" ,
1414 "axios" : " ^1.7.7" ,
15- "azure-translator-code" : " ^1.1.17 " ,
15+ "azure-translator-code" : " ^1.1.18 " ,
1616 "next" : " 14.2.3" ,
1717 "next-international" : " ^1.2.4" ,
1818 "react" : " ^18" ,
Original file line number Diff line number Diff line change 22
33import { translate , translateText } from "azure-translator-code" ;
44
5- import localesCodes from "@/lib/localesCode" ;
65import { getScopedI18n } from "@/locales/server" ;
76
87const key = process . env . AZURE_API_KEY ?? "" ;
@@ -92,7 +91,13 @@ export async function makeTranslationMultilang(
9291 }
9392
9493 const fromLang = formData . get ( "fromLang" ) as string ;
95- const toLangs = localesCodes . filter ( ( code ) => formData . get ( code ) === "on" ) ;
94+ const toLangs : string [ ] = [ ] ;
95+
96+ formData . forEach ( ( value , key ) => {
97+ if ( value === "on" && key !== "fromLang" && key !== "toTranslate" ) {
98+ toLangs . push ( key ) ;
99+ }
100+ } ) ;
96101
97102 if ( ! toLangs . length ) {
98103 return {
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export default function FormTransLiveText({ locale }: Readonly<Locale>) {
5656 { id : "el" , name : scopedT ( "Langs.Greek" ) } ,
5757 { id : "id" , name : scopedT ( "Langs.Indonesian" ) } ,
5858 { id : "ms" , name : scopedT ( "Langs.Malay" ) } ,
59+ { id : "tlh-Latn" , name : scopedT ( "Langs.Klingon" ) } ,
5960 ] ;
6061 return (
6162 < form
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export default function FormTransMultiText({ locale }: Readonly<Locale>) {
5656 { id : "el" , name : scopedT ( "Langs.Greek" ) } ,
5757 { id : "id" , name : scopedT ( "Langs.Indonesian" ) } ,
5858 { id : "ms" , name : scopedT ( "Langs.Malay" ) } ,
59+ { id : "tlh-Latn" , name : scopedT ( "Langs.Klingon" ) } ,
5960 ] ;
6061
6162 return (
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export default function FormTransUnicJson() {
6868 < option value = "el" > { scopedT ( "Langs.Greek" ) } </ option >
6969 < option value = "id" > { scopedT ( "Langs.Indonesian" ) } </ option >
7070 < option value = "ms" > { scopedT ( "Langs.Malay" ) } </ option >
71+ < option value = "tlh-Latn" > { scopedT ( "Langs.Klingon" ) } </ option >
7172 </ select >
7273 </ div >
7374 </ div >
@@ -114,6 +115,7 @@ export default function FormTransUnicJson() {
114115 < option value = "el" > { scopedT ( "Langs.Greek" ) } </ option >
115116 < option value = "id" > { scopedT ( "Langs.Indonesian" ) } </ option >
116117 < option value = "ms" > { scopedT ( "Langs.Malay" ) } </ option >
118+ < option value = "tlh-Latn" > { scopedT ( "Langs.Klingon" ) } </ option >
117119 </ select >
118120 </ div >
119121 </ div >
Original file line number Diff line number Diff line change 8585 "Thai" : " Thai" ,
8686 "Turkish" : " Turkish" ,
8787 "Vietnamese" : " Vietnamese" ,
88- "Malay" : " Malay"
88+ "Malay" : " Malay" ,
89+ "Klingon" : " Klingon"
8990 },
9091 "Paste the json code here" : " Paste the json code here" ,
9192 "Len" : " Len" ,
Original file line number Diff line number Diff line change 9696 "Thai" : " Tailandês" ,
9797 "Turkish" : " Turco" ,
9898 "Vietnamese" : " Vietnamita" ,
99- "Malay" : " Malaio"
99+ "Malay" : " Malaio" ,
100+ "Klingon" : " Klingon"
100101 },
101102 "Paste the json code here" : " Cole o código json aqui" ,
102103 "Len" : " Caract" ,
Original file line number Diff line number Diff line change @@ -24,4 +24,5 @@ export type LanguagesCode =
2424 | "hu"
2525 | "el"
2626 | "id"
27- | "ms" ;
27+ | "ms"
28+ | "tlh-Latn" ;
Original file line number Diff line number Diff line change @@ -1109,13 +1109,13 @@ __metadata:
11091109 languageName : node
11101110 linkType : hard
11111111
1112- " azure-translator-code@npm:^1.1.17 " :
1113- version : 1.1.17
1114- resolution : " azure-translator-code@npm:1.1.17 "
1112+ " azure-translator-code@npm:^1.1.18 " :
1113+ version : 1.1.18
1114+ resolution : " azure-translator-code@npm:1.1.18 "
11151115 dependencies :
11161116 axios : " npm:^1.7.7"
11171117 uuid : " npm:^10.0.0"
1118- checksum : 10c0/231036038b9109f506f2ef45ae937965cc71992a27c483373e8801522de082ba2e526fdc821792f09868cd92e79dfd52de1d9f24b89d5d022ba0f27dbd15b372
1118+ checksum : 10c0/f12a1b9b84ef9c1cc5648266a2c218d572a3b058552713c04f3b1e2a632e6f33c86f4108a98ddc73f37d64ec8c91f937ce22d5c5484e760a3c3feafa6a498cd3
11191119 languageName : node
11201120 linkType : hard
11211121
@@ -1131,7 +1131,7 @@ __metadata:
11311131 " @vercel/analytics " : " npm:^1.3.1"
11321132 ace-builds : " npm:^1.34.2"
11331133 axios : " npm:^1.7.7"
1134- azure-translator-code : " npm:^1.1.17 "
1134+ azure-translator-code : " npm:^1.1.18 "
11351135 eslint : " npm:^8.57.0"
11361136 eslint-config-next : " npm:14.2.3"
11371137 eslint-config-universe : " npm:^12.1.0"
You can’t perform that action at this time.
0 commit comments