{"id":32582,"date":"2026-11-17T11:22:47","date_gmt":"2026-11-17T11:22:47","guid":{"rendered":"https:\/\/umang.pk\/2026\/11\/17\/%da%a9%d8%b1%d9%88%d9%85-%d9%85%db%8c%da%ba-%d8%a8%d9%86%d8%a7%d8%a6%db%92-%da%af%d8%a6%db%92-ai-%da%a9%db%92-%d8%b3%d8%a7%d8%aa%da%be-%d9%85%d8%aa%d8%b1%d8%ac%d9%85-%da%a9%db%8c%d8%b3%db%92-%d8%a8\/"},"modified":"2026-11-17T11:22:47","modified_gmt":"2026-11-17T11:22:47","slug":"%da%a9%d8%b1%d9%88%d9%85-%d9%85%db%8c%da%ba-%d8%a8%d9%86%d8%a7%d8%a6%db%92-%da%af%d8%a6%db%92-ai-%da%a9%db%92-%d8%b3%d8%a7%d8%aa%da%be-%d9%85%d8%aa%d8%b1%d8%ac%d9%85-%da%a9%db%8c%d8%b3%db%92-%d8%a8","status":"publish","type":"post","link":"https:\/\/umang.pk\/en_us\/2026\/11\/17\/%da%a9%d8%b1%d9%88%d9%85-%d9%85%db%8c%da%ba-%d8%a8%d9%86%d8%a7%d8%a6%db%92-%da%af%d8%a6%db%92-ai-%da%a9%db%92-%d8%b3%d8%a7%d8%aa%da%be-%d9%85%d8%aa%d8%b1%d8%ac%d9%85-%da%a9%db%8c%d8%b3%db%92-%d8%a8\/","title":{"rendered":"\u06a9\u0631\u0648\u0645 \u0645\u06cc\u06ba \u0628\u0646\u0627\u0626\u06d2 \u06af\u0626\u06d2 AI \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0645\u062a\u0631\u062c\u0645 \u06a9\u06cc\u0633\u06d2 \u0628\u0646\u0627\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4"},"content":{"rendered":"\n<div id=\"\">\n<p>\u062a\u0631\u062c\u0645\u06c1 \u06a9\u06cc \u0632\u06cc\u0627\u062f\u06c1 \u062a\u0631 \u062e\u0635\u0648\u0635\u06cc\u0627\u062a \u0627\u0633\u06cc \u0637\u0631\u062d \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u062c\u0628 \u0635\u0627\u0631\u0641 \u0645\u062a\u0646 \u062f\u0627\u062e\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u0622\u067e \u06a9\u06cc \u0627\u06cc\u067e \u0627\u0633\u06d2 \u062a\u0631\u062c\u0645\u06c1 API \u06a9\u0648 \u0628\u06be\u06cc\u062c\u062a\u06cc \u06c1\u06d2\u060c \u0627\u0648\u0631 API \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0648 \u0648\u0627\u067e\u0633 \u0628\u06be\u06cc\u062c\u062a\u0627 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06cc\u06a9\u0646 \u06cc\u06c1 \u06c1\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0645\u06cc\u06ba \u0644\u0627\u06af\u062a \u0627\u0648\u0631 \u062a\u0627\u062e\u06cc\u0631 \u06a9\u0627 \u0627\u0636\u0627\u0641\u06c1 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0635\u0627\u0631\u0641 \u06a9\u06d2 \u0645\u062a\u0646 \u06a9\u0648 \u0622\u0644\u06c1 \u0686\u06be\u0648\u0691\u0646\u06d2 \u06a9\u0627 \u0633\u0628\u0628 \u0628\u0646\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u06a9\u0631\u0648\u0645 \u0627\u0628 \u062f\u0648 \u0628\u0644\u0679 \u0627\u0646 AI APIs \u067e\u06cc\u0634 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0648 \u0627\u0633\u06d2 \u062a\u0628\u062f\u06cc\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 <strong>\u0645\u062a\u0631\u062c\u0645 API<\/strong> \u0627\u0648\u0631 <strong>\u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u0648\u0627\u0644\u0627 API<\/strong>. Chrome \u0636\u0631\u0648\u0631\u062a \u06a9\u06d2 \u0645\u0637\u0627\u0628\u0642 \u0686\u06be\u0648\u0679\u06d2\u060c \u062e\u0635\u0648\u0635\u06cc \u0645\u0627\u0688\u0644\u0632 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0627\u0646\u06c1\u06cc\u06ba \u0635\u0627\u0631\u0641 \u06a9\u06d2 \u0622\u0644\u06d2 \u067e\u0631 \u0686\u0644\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u0622\u067e \u0645\u0627\u0688\u0644\u0632 \u06a9\u06cc \u0645\u06cc\u0632\u0628\u0627\u0646\u06cc \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u06d2\u060c \u0627\u0646\u0641\u0631\u0646\u0633 \u0633\u0631\u0648\u0631 \u0646\u06c1\u06cc\u06ba \u0686\u0644\u0627\u062a\u06d2\u060c \u06cc\u0627 \u0641\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0627\u062f\u0627\u0626\u06cc\u06af\u06cc \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u06d2\u06d4 JavaScript API \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<p>\u0627\u0633 \u0679\u06cc\u0648\u0679\u0648\u0631\u06cc\u0644 \u0645\u06cc\u06ba\u060c \u06c1\u0645 Next.js \u0645\u06cc\u06ba \u062f\u0631\u062c \u0630\u06cc\u0644 \u0645\u062a\u0631\u062c\u0645 \u0628\u0646\u0627\u062a\u06d2 \u06c1\u06cc\u06ba:<\/p>\n<ul>\n<li>\u0635\u0627\u0631\u0641 \u06a9\u06cc \u0642\u0633\u0645 \u06a9\u06d2 \u0645\u062a\u0646 \u06a9\u06cc \u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u0627\u067e\u0646\u06cc \u067e\u0633\u0646\u062f \u06a9\u06cc \u0632\u0628\u0627\u0646 \u0645\u06cc\u06ba \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li>\u0622\u067e \u06a9\u06d2 \u0635\u0641\u062d\u06c1 \u067e\u0631 Chrome \u06a9\u06d2 \u0630\u0631\u06cc\u0639\u06d2 \u062a\u062e\u0644\u06cc\u0642 \u06a9\u0631\u062f\u06c1 \u062a\u0631\u0627\u062c\u0645 \u06a9\u0648 \u0633\u0679\u0631\u06cc\u0645 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li>\u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a \u062f\u06a9\u06be\u0627\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u0645\u0646\u0633\u0648\u062e \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0627\u062c\u0627\u0632\u062a \u062f\u06cc\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u062a\u0631\u062c\u0645\u06c1 \u06a9\u0627\u067e\u06cc \u06a9\u0631\u06cc\u06ba\u060c \u0627\u0633\u06d2 \u0628\u0644\u0646\u062f \u0622\u0648\u0627\u0632 \u0633\u06d2 \u067e\u0691\u06be\u06cc\u06ba\u060c \u0627\u0648\u0631 \u067e\u06be\u0631 \u062f\u0648 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u062f\u0631\u0645\u06cc\u0627\u0646 \u062a\u0628\u0627\u062f\u0644\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li>\u0627\u06cc\u0633\u06d2 \u0628\u0631\u0627\u0624\u0632\u0631\u0632 \u06a9\u0648 \u06c1\u06cc\u0646\u0688\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0648 API \u06a9\u0648 \u0633\u067e\u0648\u0631\u0679 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<h2 id=\"heading-table-of-contents\">\u0627\u0646\u0688\u06cc\u06a9\u0633<\/h2>\n<ol>\n<li>\u0634\u0631\u0637\u06cc\u06ba<\/li>\n<li>\u0627\u0646\u0679\u0631\u0646\u06cc\u0634\u0646\u0644\u0627\u0626\u0632\u06cc\u0634\u0646 \u0628\u0645\u0642\u0627\u0628\u0644\u06c1 AI \u062a\u0631\u062c\u0645\u06c1<\/li>\n<li>\u06a9\u0631\u0648\u0645 \u06a9\u0627 \u0628\u0644\u0679 \u0627\u0646 AI API \u06a9\u06cc\u0633\u06d2 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u067e\u06c1\u0644\u06d2\u060c \u06a9\u06be\u06cc\u0644 \u06a9\u06d2 \u0645\u06cc\u062f\u0627\u0646 \u0645\u06cc\u06ba API \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li>Next.js \u067e\u0631\u0648\u062c\u06cc\u06a9\u0679 \u06a9\u0648 \u06a9\u06cc\u0633\u06d2 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4<\/li>\n<li>\u0632\u0628\u0627\u0646 \u06a9\u06cc \u062a\u0639\u0631\u06cc\u0641 \u06a9\u06cc\u0633\u06d2 \u06a9\u06cc \u062c\u0627\u0626\u06d2\u06d4<\/li>\n<li>\u06a9\u0631\u0648\u0645 API \u06a9\u0648 \u06a9\u06cc\u0633\u06d2 \u0644\u067e\u06cc\u0679\u06cc\u06ba\u06d4<\/li>\n<li>\u062a\u0631\u062c\u0645\u06c1 \u06c1\u06a9 \u0628\u0646\u0627\u0646\u06d2 \u06a9\u0627 \u0637\u0631\u06cc\u0642\u06c1<\/li>\n<li>\u0627\u0646\u0679\u0631\u0641\u06cc\u0633 \u0628\u0646\u0627\u0646\u06d2 \u06a9\u0627 \u0637\u0631\u06cc\u0642\u06c1<\/li>\n<li>\u0627\u067e\u0646\u06cc \u0627\u06cc\u067e \u06a9\u0648 \u0686\u0644\u0627\u0646\u06d2 \u0627\u0648\u0631 \u062c\u0627\u0646\u0686\u0646\u06d2 \u06a9\u0627 \u0637\u0631\u06cc\u0642\u06c1<\/li>\n<li>\u062d\u062f\u0648\u062f \u0627\u0648\u0631 \u067e\u06cc\u062f\u0627\u0648\u0627\u0631 \u06a9\u06d2 \u062a\u062d\u0641\u0638\u0627\u062a<\/li>\n<li>\u0646\u062a\u06cc\u062c\u06c1<\/li>\n<\/ol>\n<h2 id=\"heading-prerequisites\">\u0634\u0631\u0637\u06cc\u06ba<\/h2>\n<p>\u0622\u067e \u06a9\u0648 \u0627\u0633 \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0622\u0631\u0627\u0645 \u062f\u06c1 \u06c1\u0648\u0646\u0627 \u0686\u0627\u06c1\u0626\u06d2:<\/p>\n<ul>\n<li>\u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u067e\u0679 \u06cc\u0627 \u0679\u0627\u0626\u067e \u0627\u0633\u06a9\u0631\u067e\u0679<\/li>\n<li>\u0631\u062f \u0639\u0645\u0644 \u06a9\u06cc \u0628\u0646\u06cc\u0627\u062f\u06cc \u0628\u0627\u062a\u06cc\u06ba (\u0627\u062c\u0632\u0627\u0621\u060c \u0633\u06c1\u0627\u0631\u06d2\u060c <code>useState<\/code>\u060c <code>useEffect<\/code>)<\/li>\n<li>\u0679\u0631\u0645\u06cc\u0646\u0644 \u0645\u06cc\u06ba \u06a9\u0645\u0627\u0646\u0688 \u0686\u0644\u0627\u0626\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<p>\u0622\u067e \u06a9\u0648 \u0636\u0631\u0648\u0631\u062a \u06c1\u0648 \u06af\u06cc:<\/p>\n<ul>\n<li>Node.js 20.9 \u06cc\u0627 \u0627\u0633 \u0633\u06d2 \u0632\u06cc\u0627\u062f\u06c1\u06d4<\/li>\n<li><strong>\u0688\u06cc\u0633\u06a9 \u0679\u0627\u067e \u06a9\u0631\u0648\u0645 138 \u06cc\u0627 \u0627\u0633 \u0633\u06d2 \u0627\u0648\u067e\u0631\u06d4<\/strong> \u0645\u062a\u0631\u062c\u0645 \u0627\u0648\u0631 \u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u0648\u0627\u0644\u06d2 APIs \u0688\u06cc\u0633\u06a9 \u0679\u0627\u067e \u067e\u0631 Chrome \u0645\u06cc\u06ba \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u06cc\u06c1 \u0645\u0648\u0628\u0627\u0626\u0644 \u0622\u0644\u0627\u062a \u067e\u0631 \u06a9\u0627\u0645 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0648\u0631 Firefox \u0627\u0648\u0631 Safari \u0627\u0633 \u06a9\u06cc \u062d\u0645\u0627\u06cc\u062a \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0628\u0631\u0627\u0624\u0632\u0631 \u0633\u067e\u0648\u0631\u0679 \u0679\u06cc\u0628\u0644 \u0645\u06cc\u06ba \u0627\u06cc\u062c (148) \u06a9\u06cc \u0641\u06c1\u0631\u0633\u062a \u0628\u06be\u06cc \u06c1\u06d2\u06d4 \u0645\u06cc\u06ba \u0646\u06d2 \u0645\u06cc\u06a9 \u0627\u0648 \u0627\u06cc\u0633 \u067e\u0631 \u06a9\u0631\u0648\u0645 156 \u0645\u06cc\u06ba \u0627\u0633 \u0679\u06cc\u0648\u0679\u0648\u0631\u06cc\u0644 \u06a9\u0627 \u062a\u062c\u0631\u0628\u06c1 \u06a9\u06cc\u0627\u06d4<\/li>\n<\/ul>\n<p>\u0622\u067e \u06a9\u0648 \u0645\u0634\u06cc\u0646 \u0644\u0631\u0646\u0646\u06af \u06a9\u06d2 \u0628\u0627\u0631\u06d2 \u0645\u06cc\u06ba \u06a9\u0686\u06be \u062c\u0627\u0646\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-internationalization-vs-ai-translation\">\u0627\u0646\u0679\u0631\u0646\u06cc\u0634\u0646\u0644\u0627\u0626\u0632\u06cc\u0634\u0646 \u0628\u0645\u0642\u0627\u0628\u0644\u06c1 AI \u062a\u0631\u062c\u0645\u06c1<\/h2>\n<p>\u06a9\u0648\u0626\u06cc \u0628\u06be\u06cc \u06a9\u0648\u0688 \u0644\u06a9\u06be\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u0627\u0646 \u062f\u0648 \u0622\u0633\u0627\u0646\u06cc \u0633\u06d2 \u0627\u0644\u062c\u06be\u06d2 \u06c1\u0648\u0626\u06d2 \u062e\u06cc\u0627\u0644\u0627\u062a \u06a9\u0648 \u0627\u0644\u06af \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<p><strong>\u0628\u06cc\u0646 \u0627\u0644\u0627\u0642\u0648\u0627\u0645\u06cc \u06a9\u0627\u0631\u06cc (i18n)<\/strong> \u0645\u062a\u0639\u062f\u062f \u0632\u0628\u0627\u0646\u0648\u06ba \u0627\u0648\u0631 \u062e\u0637\u0648\u06ba \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u0646\u0679\u0631\u0641\u06cc\u0633 \u062a\u06cc\u0627\u0631 \u06a9\u0631\u06cc\u06ba\u060c \u0628\u0634\u0645\u0648\u0644 \u0632\u0628\u0627\u0646 \u06a9\u0627 \u0627\u0646\u062a\u062e\u0627\u0628\u060c \u0645\u0642\u0627\u0645 \u0633\u06d2 \u0622\u06af\u0627\u06c1\u06cc \u06a9\u06cc \u062a\u0627\u0631\u06cc\u062e\u06cc\u06ba\u060c \u0646\u0645\u0628\u0631\u0632\u060c \u0627\u0648\u0631 \u06a9\u0631\u0646\u0633\u06cc\u060c \u062f\u0627\u0626\u06cc\u06ba \u0633\u06d2 \u0628\u0627\u0626\u06cc\u06ba (RTL) \u0644\u06d2 \u0622\u0624\u0679\u060c \u0627\u0648\u0631 \u0627\u0646\u0633\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u0630\u0631\u06cc\u0639\u06c1 \u062a\u062d\u0631\u06cc\u0631\u06cc \u0627\u0648\u0631 \u062c\u0627\u0626\u0632\u06c1 \u0644\u06cc\u0646\u06d2 \u0648\u0627\u0644\u06d2 \u062c\u0627\u0645\u062f \u0627\u0646\u0679\u0631\u0641\u06cc\u0633 \u06a9\u06d2 \u062a\u0627\u0631\u06d4<\/p>\n<pre><code class=\"language-ts\">const messages = {\n  en: { welcome: \"Welcome\", description: \"Explore our platform\" },\n  fr: { welcome: \"Bienvenue\", description: \"Explorez notre plateforme\" },\n  es: { welcome: \"Bienvenido\", description: \"Explora nuestra plataforma\" },\n};\n<\/code><\/pre>\n<p><strong>AI \u067e\u0631 \u0645\u0628\u0646\u06cc \u062a\u0631\u062c\u0645\u06c1<\/strong> \u062a\u0628\u0635\u0631\u06d2\u060c \u062c\u0627\u0626\u0632\u06d2\u060c \u0627\u0645\u062f\u0627\u062f\u06cc \u067e\u06cc\u063a\u0627\u0645\u0627\u062a \u0627\u0648\u0631 \u067e\u0648\u0633\u0679\u0633 \u0633\u0645\u06cc\u062a \u06a9\u0633\u06cc \u0646\u06d2 \u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u0646\u06c1 \u0644\u06a9\u06be\u06d2 \u06c1\u0648\u0626\u06d2 \u0645\u0648\u0627\u062f \u06a9\u06d2 \u0644\u06cc\u06d2 \u0641\u0644\u0627\u0626\u06cc \u062a\u0631\u062c\u0645\u06c1 \u0628\u0646\u0627\u0626\u06cc\u06ba\u06d4<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0627\u0635\u0644 i18n<\/th>\n<th>AI \u067e\u0631 \u0645\u0628\u0646\u06cc \u062a\u0631\u062c\u0645\u06c1<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u0637\u06d2 \u0634\u062f\u06c1 \u062a\u0631\u062c\u0645\u06c1 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/td>\n<td>\u0645\u062a\u062d\u0631\u06a9 \u0637\u0648\u0631 \u067e\u0631 \u062a\u0631\u062c\u0645\u06d2 \u0628\u0646\u0627\u0626\u06cc\u06ba\u06d4<\/td>\n<\/tr>\n<tr>\n<td>\u0627\u0646\u0679\u0631\u0641\u06cc\u0633 \u0679\u06cc\u06a9\u0633\u0679 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u062b\u0627\u0644\u06cc\u06d4<\/td>\n<td>\u0635\u0627\u0631\u0641 \u06a9\u06d2 \u062a\u06cc\u0627\u0631 \u06a9\u0631\u062f\u06c1 \u0645\u0648\u0627\u062f \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u062b\u0627\u0644\u06cc\u06d4<\/td>\n<\/tr>\n<tr>\n<td>\u0639\u0627\u0645 \u0637\u0648\u0631 \u067e\u0631 \u0688\u0648\u06cc\u0644\u067e\u0631 \u06a9\u06d2 \u0632\u06cc\u0631 \u0627\u0646\u062a\u0638\u0627\u0645<\/td>\n<td>\u06cc\u06c1 \u0635\u0648\u0627\u0628\u062f\u06cc\u062f\u06cc \u0645\u062a\u0646 \u06a9\u0648 \u0633\u0646\u0628\u06be\u0627\u0644 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4<\/td>\n<\/tr>\n<tr>\n<td>\u0645\u062a\u0648\u0642\u0639 \u0622\u0624\u0679 \u067e\u0679<\/td>\n<td>\u0622\u0624\u0679 \u067e\u0679 \u0645\u062e\u062a\u0644\u0641 \u06c1\u0648 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>AI \u062a\u0631\u062c\u0645\u06c1 i18n \u06a9\u06cc \u062a\u06a9\u0645\u06cc\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u0627\u0633 \u06a9\u06cc \u062c\u06af\u06c1 \u0646\u06c1\u06cc\u06ba \u0644\u06cc\u062a\u0627\u06d4 \u0628\u0679\u0646\u0648\u06ba \u0627\u0648\u0631 \u0645\u06cc\u0646\u0648\u0632 \u06a9\u0648 \u0627\u0628 \u0628\u06be\u06cc \u06a9\u06cc\u0648\u0631\u06cc\u0679\u0688 \u062a\u0627\u0631 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4 Translator API \u06c1\u0631 \u0686\u06cc\u0632 \u0645\u06cc\u06ba \u062e\u0644\u0627 \u06a9\u0648 \u067e\u064f\u0631 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0627\u0686\u06be\u06cc \u0645\u062b\u0627\u0644\u06cc\u06ba \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u0633\u067e\u0648\u0631\u0679 \u0686\u06cc\u0679 \u0645\u06cc\u06ba\u060c \u0635\u0627\u0631\u0641 \u0627\u067e\u0646\u06cc \u0645\u0627\u062f\u0631\u06cc \u0632\u0628\u0627\u0646 \u0645\u06cc\u06ba \u0644\u06a9\u06be\u062a\u06d2 \u06c1\u06cc\u06ba \u0627\u0648\u0631 \u0633\u0627\u0626\u0679 \u067e\u06cc\u063a\u0627\u0645\u0627\u062a \u06a9\u0648 \u0627\u06cc\u062c\u0646\u0679 \u06a9\u06cc \u0632\u0628\u0627\u0646 \u0645\u06cc\u06ba \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u062a\u06cc \u06c1\u06d2\u06d4 <em>\u0627\u0633 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u06a9\u06c1 \u067e\u06cc\u063a\u0627\u0645 \u0622\u067e \u06a9\u06d2 \u0622\u0644\u06d2 \u0633\u06d2 \u0646\u06a9\u0644 \u062c\u0627\u0626\u06d2\u06d4<\/em>.<\/p>\n<h2 id=\"heading-how-chromes-built-in-ai-apis-work\">\u06a9\u0631\u0648\u0645 \u06a9\u0627 \u0628\u0644\u0679 \u0627\u0646 AI API \u06a9\u06cc\u0633\u06d2 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/h2>\n<p>\u062f\u0648 APIs \u06c1\u06cc\u06ba \u0627\u0648\u0631 \u0648\u06c1 \u0645\u0644 \u06a9\u0631 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li><code>LanguageDetector<\/code>    \u0645\u062a\u0646 \u0644\u06cc\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 0 \u0627\u0648\u0631 1 \u06a9\u06d2 \u062f\u0631\u0645\u06cc\u0627\u0646 \u06c1\u0631 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u0627\u0639\u062a\u0645\u0627\u062f \u06a9\u06d2 \u0627\u0633\u06a9\u0648\u0631 \u06a9\u06cc \u062f\u0631\u062c\u06c1 \u0628\u0646\u062f\u06cc \u06a9\u06cc \u0641\u06c1\u0631\u0633\u062a \u0644\u0648\u0679\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>Translator<\/code>    \u0627\u06cc\u06a9 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u062c\u0648\u0691\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0628\u0646\u0627\u06cc\u0627 \u06af\u06cc\u0627\u060c \u062c\u06cc\u0633\u06d2 \u0627\u0646\u06af\u0631\u06cc\u0632\u06cc \u0633\u06d2 \u06c1\u0633\u067e\u0627\u0646\u0648\u06cc\u060c \u0627\u0648\u0631 \u0627\u0646 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u062f\u0631\u0645\u06cc\u0627\u0646 \u0645\u062a\u0646 \u06a9\u0627 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<p>\u06cc\u06c1 \u06a9\u0644\u0627\u0624\u0688 API \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06cc\u0627 Transformers.js \u062c\u06cc\u0633\u06cc \u0644\u0627\u0626\u0628\u0631\u06cc\u0631\u06cc \u06a9\u0627 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u0648\u0626\u06d2 \u0628\u0631\u0627\u06c1 \u0631\u0627\u0633\u062a \u0645\u0627\u0688\u0644 \u0686\u0644\u0627\u0646\u06d2 \u0633\u06d2 \u0645\u062e\u062a\u0644\u0641 \u06c1\u06d2\u06d4<\/p>\n<ol>\n<li><strong>\u0628\u0631\u0627\u0624\u0632\u0631 \u0645\u0627\u0688\u0644 \u06a9\u0627 \u0645\u0627\u0644\u06a9 \u06c1\u06d2\u06d4<\/strong> \u06c1\u0645 \u0645\u0627\u0688\u0644 \u0641\u0627\u0626\u0644\u0648\u06ba \u06a9\u0648 \u0628\u0646\u0688\u0644 \u06cc\u0627 \u0645\u06cc\u0632\u0628\u0627\u0646\u06cc \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 Chrome \u0627\u0646\u06c1\u06cc\u06ba \u067e\u06c1\u0644\u06cc \u0628\u0627\u0631 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0628 \u06a9\u0633\u06cc \u0633\u0627\u0626\u0679 \u06a9\u0648 \u0627\u0646 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0632\u0628\u0627\u0646 \u06a9\u06d2 \u067e\u06cc\u06a9 \u062a\u0631\u062c\u0645\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u06cc\u06d2 \u062c\u0627\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/strong> \u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u06a9\u0648 &quot;\u062f\u06cc \u06af\u0626\u06cc \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0688\u06a9\u0634\u0646\u0631\u06cc\u0648\u06ba \u06a9\u06cc \u0637\u0631\u062d&#8221; \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u0628\u06cc\u0627\u0646 \u06a9\u0631\u062a\u06cc \u06c1\u06cc\u06ba \u062c\u0648 \u0688\u06cc\u0645\u0627\u0646\u0688 \u067e\u0631 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u062c\u0627\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u0627\u06cc\u06a9 \u062c\u0648\u0691\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u067e\u06c1\u0644\u0627 \u062a\u0631\u062c\u0645\u06c1 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u0627\u0648\u0631 \u0628\u0639\u062f \u0645\u06cc\u06ba \u0627\u0633 \u06a9\u0627 \u062f\u0648\u0628\u0627\u0631\u06c1 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u0634\u0631\u0648\u0639 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u06c1\u0631 \u0686\u06cc\u0632 \u0645\u062a\u0636\u0627\u062f \u0627\u0648\u0631 \u0627\u062c\u0627\u0632\u062a \u0633\u06d2 \u0622\u06af\u0627\u06c1 \u06c1\u06d2\u06d4<\/strong> \u062a\u0645 \u0686\u06cc\u06a9 \u06a9\u0631\u0648 <code>availability()<\/code> \u067e\u06c1\u0644\u06d2 \u0645\u062c\u06be\u06d2 \u0628\u0644\u0627\u0624 <code>create()<\/code>\u0622\u067e \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a \u062f\u06cc\u06a9\u06be \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<\/ol>\n<p>\u06a9\u06d2 \u0644\u06cc\u06d2 \u0688\u06cc\u0632\u0627\u0626\u0646 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0686\u0627\u0631\u0648\u06ba \u0631\u06a9\u0627\u0648\u0679\u06cc\u06ba \u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0645\u06cc\u06ba \u062f\u0631\u062c \u06c1\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li><strong>\u0635\u0627\u0631\u0641 \u06a9\u06cc \u0627\u06cc\u06a9\u0679\u06cc\u0648\u06cc\u0634\u0646\u06d4<\/strong> \u0679\u0631\u0627\u0646\u0633\u0688\u06cc\u0648\u0633\u0631 \u06cc\u0627 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u0628\u0646\u0627\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0635\u0627\u0631\u0641 \u06a9\u06cc \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u060c \u062c\u06cc\u0633\u06d2 \u06a9\u06c1 \u06a9\u0644\u06a9\u060c \u062c\u0628 \u0645\u0627\u0688\u0644 \u06a9\u0648 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0648\u06cc\u0628 \u06a9\u0627\u0631\u06a9\u0646\u0648\u06ba \u06a9\u06d2 \u067e\u0627\u0633 \u06cc\u06c1 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/strong> \u062f\u0648\u0646\u0648\u06ba APIs \u06a9\u0627\u0631\u06a9\u0646\u0648\u06ba \u067e\u0631 \u062f\u0633\u062a\u06cc\u0627\u0628 \u0646\u06c1\u06cc\u06ba \u06c1\u06cc\u06ba\u060c \u0644\u06c1\u0630\u0627 \u06c1\u0645 \u0627\u0646\u06c1\u06cc\u06ba \u0645\u0631\u06a9\u0632\u06cc \u062f\u06be\u0627\u06af\u06d2 \u0633\u06d2 \u06a9\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 (\u06a9\u0627\u0644 \u063a\u06cc\u0631 \u0645\u0637\u0627\u0628\u0642\u062a \u067e\u0630\u06cc\u0631 \u06c1\u06d2 \u0627\u0648\u0631 \u0645\u0627\u0688\u0644 JavaScript \u062a\u06be\u0631\u06cc\u0688 \u0633\u06d2 \u0628\u0627\u06c1\u0631 \u0686\u0644\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 UI \u0628\u0644\u0627\u06a9 \u0646\u06c1\u06cc\u06ba \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4)<\/li>\n<li><strong>\u062a\u0631\u062a\u06cc\u0628 \u0648\u0627\u0631 \u067e\u0631\u0648\u0633\u06cc\u0633\u0646\u06af\u06d4<\/strong> \u062a\u0631\u062c\u0645\u06d2 \u067e\u0631 \u0628\u0627\u0631\u06cc \u0628\u0627\u0631\u06cc \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u06a9\u06cc \u062c\u0627\u062a\u06cc \u06c1\u06d2\u06d4 \u0628\u0691\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc\u06ba \u0628\u0639\u062f \u0645\u06cc\u06ba \u0622\u0646\u06d2 \u0648\u0627\u0644\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u0648\u06ba \u06a9\u0648 \u0631\u0648\u06a9\u062a\u06cc \u06c1\u06cc\u06ba\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u0686\u0646\u06a9\u0646\u06af \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06cc \u06c1\u06d2 \u0627\u0648\u0631 \u0644\u0648\u0688\u0646\u06af \u0627\u0646\u0688\u06cc\u06a9\u06cc\u0679\u0631 \u062f\u06a9\u06be\u0627\u062a\u06cc \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0635\u0631\u0641 \u0679\u0627\u067e \u0644\u06cc\u0648\u0644 \u0648\u0646\u0688\u0648\u0632\u06d4<\/strong> \u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u0637\u06d2 \u0634\u062f\u06c1 \u0637\u0648\u0631 \u067e\u0631\u060c API \u0679\u0627\u067e \u0644\u06cc\u0648\u0644 \u0648\u0646\u0688\u0648\u0632 \u0627\u0648\u0631 \u0627\u06cc\u06a9 \u06c1\u06cc \u0627\u0648\u0631\u06cc\u062c\u06cc\u0646 iframes \u067e\u0631 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u06a9\u0631\u0627\u0633 \u0627\u0648\u0631\u06cc\u062c\u0646 iframes \u06a9\u0648 \u0627\u062c\u0627\u0632\u062a \u06a9\u06cc \u067e\u0627\u0644\u06cc\u0633\u06cc\u0648\u06ba \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4 <code>allow<\/code> \u06a9\u06cc \u0648\u062c\u06c1 \u0633\u06d2 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<\/ul>\n<p>\u06a9\u06c1 <code>availability()<\/code> \u062f\u0648\u0646\u0648\u06ba APIs \u0645\u06cc\u06ba \u0637\u0631\u06cc\u0642\u06d2 \u0686\u0627\u0631 \u0645\u06cc\u06ba \u0633\u06d2 \u0627\u06cc\u06a9 \u0642\u062f\u0631 \u0648\u0627\u067e\u0633 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u0627\u0648\u0631 UI \u06a9\u0648 \u06c1\u0631 \u0627\u06cc\u06a9 \u0642\u062f\u0631 \u067e\u0631 \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u06a9\u0631\u0646\u06cc \u0686\u0627\u06c1\u06cc\u06d2\u06d4<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0642\u062f\u0631<\/th>\n<th>\u0645\u0639\u0646\u06cc<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>unavailable<\/code><\/td>\n<td>\u0622\u067e \u06a9\u0627 \u0628\u0631\u0627\u0624\u0632\u0631 \u0627\u0646 \u0627\u062e\u062a\u06cc\u0627\u0631\u0627\u062a \u06a9\u0648 \u0633\u067e\u0648\u0631\u0679 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/td>\n<\/tr>\n<tr>\n<td><code>downloadable<\/code><\/td>\n<td>\u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1\u060c \u0644\u06cc\u06a9\u0646 \u067e\u06c1\u0644\u06d2 \u0645\u0627\u0688\u0644 \u06a9\u0648 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u06d4<\/td>\n<\/tr>\n<tr>\n<td><code>downloading<\/code><\/td>\n<td>\u06cc\u06c1 \u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1 \u06c1\u06d2 \u0627\u0648\u0631 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u067e\u06c1\u0644\u06d2 \u06c1\u06cc \u062c\u0627\u0631\u06cc \u06c1\u06d2\u06d4<\/td>\n<\/tr>\n<tr>\n<td><code>available<\/code><\/td>\n<td>\u06cc\u06c1 \u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1 \u06c1\u06d2 \u0627\u0648\u0631 \u0622\u067e \u0627\u0633\u06d2 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc\u06d2 \u0628\u063a\u06cc\u0631 \u0641\u0648\u0631\u0627\u064b \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0631\u0627\u0632\u062f\u0627\u0631\u06cc \u06a9\u06cc \u0627\u06cc\u06a9 \u062a\u0641\u0635\u06cc\u0644: \u06a9\u0631\u0648\u0645 \u0635\u0627\u0631\u0641 \u06a9\u06cc \u0631\u0627\u0632\u062f\u0627\u0631\u06cc \u06a9\u06d2 \u062a\u062d\u0641\u0638 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u062e\u0635\u0648\u0635 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u062c\u0648\u0691\u0648\u06ba \u06a9\u06d2 \u0644\u06cc\u06d2 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u062d\u06cc\u062b\u06cc\u062a \u06a9\u0648 \u0686\u06be\u067e\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u062c\u0628 \u062a\u06a9 \u0622\u067e \u06a9\u06cc \u0633\u0627\u0626\u0679 \u0645\u062a\u0631\u062c\u0645\u06cc\u0646 \u06a9\u0627 \u0627\u06cc\u06a9 \u062c\u0648\u0691\u0627 \u062a\u06cc\u0627\u0631 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u06cc\u060c \u062a\u0645\u0627\u0645 \u062c\u0648\u0691\u0648\u06ba \u06a9\u0648 \u062f\u0631\u062c \u0630\u06cc\u0644 \u0631\u067e\u0648\u0631\u0679 \u06a9\u06cc\u0627 \u062c\u0627\u0626\u06d2 \u06af\u0627: <code>downloadable<\/code>.<\/p>\n<h2 id=\"heading-try-the-apis-in-the-playground-first\">\u067e\u06c1\u0644\u06d2\u060c \u06a9\u06be\u06cc\u0644 \u06a9\u06d2 \u0645\u06cc\u062f\u0627\u0646 \u0645\u06cc\u06ba API \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4<\/h2>\n<p>\u06a9\u0648\u0688 \u0644\u06a9\u06be\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u062a\u062c\u0631\u0628\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4 \u0628\u0644\u0679 \u0627\u0646 AI \u067e\u0644\u06d2 \u06af\u0631\u0627\u0624\u0646\u0688\u0632 \u0645\u06cc\u06ba \u06cc\u06c1 \u062f\u0648\u0646\u0648\u06ba \u0634\u0627\u0645\u0644 \u06c1\u06cc\u06ba\u060c AI \u0635\u0644\u0627\u062d\u06cc\u062a\u06cc\u06ba \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba \u062c\u0646\u06c1\u06cc\u06ba Chrome JavaScript APIs \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u0638\u0627\u06c1\u0631 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u0633\u06d2 \u0688\u06cc\u0633\u06a9 \u0679\u0627\u067e \u06a9\u0631\u0648\u0645 \u0645\u06cc\u06ba \u06a9\u06be\u0648\u0644\u06cc\u06ba \u0627\u0648\u0631 \u062f\u0631\u062c \u0630\u06cc\u0644 \u06a9\u0648 \u0622\u0632\u0645\u0627\u0626\u06cc\u06ba:<\/p>\n<ol>\n<li>\u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u0645\u06cc\u06ba \u0645\u062e\u062a\u0644\u0641 \u0632\u0628\u0627\u0646\u0648\u06ba \u0645\u06cc\u06ba \u0686\u0646\u062f \u062c\u0645\u0644\u06d2 \u0686\u0633\u067e\u0627\u06ba \u06a9\u0631\u06cc\u06ba \u0627\u0648\u0631 \u0627\u0646 \u06a9\u06d2 \u0627\u0639\u062a\u0645\u0627\u062f \u06a9\u06d2 \u0627\u0633\u06a9\u0648\u0631 \u067e\u0691\u06be\u06cc\u06ba\u06d4<\/li>\n<li>\u0627\u06cc\u06a9 \u0644\u0641\u0638 \u0627\u0648\u0631 \u067e\u06be\u0631 \u067e\u0648\u0631\u0627 \u062c\u0645\u0644\u06c1 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4 \u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u06cc \u0645\u062a\u0646\u0628\u06c1 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0645\u062e\u062a\u0635\u0631 \u0627\u0646 \u067e\u0679 \u06a9\u06d2 \u0646\u062a\u06cc\u062c\u06d2 \u0645\u06cc\u06ba \u06a9\u0645 \u062f\u0631\u0633\u062a \u0646\u062a\u0627\u0626\u062c \u0628\u0631\u0622\u0645\u062f \u06c1\u0648\u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u0627\u0639\u062a\u0645\u0627\u062f \u06a9\u06cc \u0642\u062f\u0631\u0648\u06ba \u06a9\u0627 \u0645\u0648\u0627\u0632\u0646\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li>\u062f\u0648 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u062c\u0648\u0691\u0648\u06ba \u06a9\u06d2 \u062f\u0631\u0645\u06cc\u0627\u0646 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4 \u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646 \u062c\u0648\u0691\u06d2 \u06a9\u0627 \u067e\u06c1\u0644\u0627 \u062a\u0631\u062c\u0645\u06c1 \u0631\u06a9 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<\/ol>\n<p>\u0622\u067e \u0628\u0627\u0644\u06a9\u0644 \u0627\u0633\u06cc \u0637\u0631\u0632 \u0639\u0645\u0644 \u06a9\u0648 \u0627\u067e\u0646\u06cc \u0627\u06cc\u067e \u0645\u06cc\u06ba \u0628\u0646\u0627 \u0631\u06c1\u06d2 \u06c1\u0648\u06ba \u06af\u06d2\u06d4<\/p>\n<h2 id=\"heading-how-to-set-up-the-nextjs-project\">Next.js \u067e\u0631\u0648\u062c\u06cc\u06a9\u0679 \u06a9\u0648 \u06a9\u06cc\u0633\u06d2 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4<\/h2>\n<p>TypeScript \u0627\u0648\u0631 App Router \u06a9\u0627 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u0648\u0626\u06d2 \u0627\u06cc\u06a9 Next.js \u0627\u06cc\u067e \u0628\u0646\u0627\u0626\u06cc\u06ba\u06d4 \u0622\u067e \u06a9\u06cc \u0645\u0631\u0636\u06cc \u06a9\u06d2 \u0645\u0637\u0627\u0628\u0642 \u0628\u0627\u0642\u06cc \u0627\u0634\u0627\u0631\u06d2 \u06a9\u0627 \u062c\u0648\u0627\u0628 \u062f\u06cc\u06ba\u06d4<\/p>\n<pre><code class=\"language-bash\">npx create-next-app@latest chrome-ai-translator --ts --app --no-tailwind --no-src-dir --import-alias \"@\/*\"\ncd chrome-ai-translator\n<\/code><\/pre>\n<p>\u067e\u06be\u0631 \u06a9\u0631\u0648\u0645 \u0645\u06cc\u06ba \u0628\u0646\u0627\u0626\u06d2 \u06af\u0626\u06d2 AI API \u06a9\u06d2 \u0644\u06cc\u06d2 TypeScript \u06a9\u06cc \u062a\u0639\u0631\u06cc\u0641\u06cc\u06ba \u0627\u0646\u0633\u0679\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4 TypeScript \u0646\u06c1\u06cc\u06ba \u062c\u0627\u0646\u062a\u0627: <code>Translator<\/code> \u06cc\u0627 <code>LanguageDetector<\/code> \u0627\u0633 \u06a9\u06cc \u0648\u062c\u06c1 \u06cc\u06c1 \u06c1\u06d2 \u06a9\u06c1 \u06cc\u06c1 \u0627\u0628\u06be\u06cc \u062a\u06a9 \u0645\u0639\u06cc\u0627\u0631\u06cc DOM \u0642\u0633\u0645 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-bash\">npm install -D @types\/dom-chromium-ai\n<\/code><\/pre>\n<p>\u067e\u06cc\u06a9\u06cc\u062c \u06a9\u0627 \u0627\u0639\u0644\u0627\u0646 \u062f\u0631\u062c \u0630\u06cc\u0644 \u06c1\u06d2: <code>Translator<\/code>\u060c <code>LanguageDetector<\/code> \u0686\u0648\u0646\u06a9\u06c1 \u06c1\u0645 \u0645\u062a\u0639\u0644\u0642\u06c1 \u0642\u0633\u0645 \u06a9\u0648 \u0639\u0627\u0644\u0645\u06cc \u0633\u0637\u062d \u067e\u0631 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u06a9\u0686\u06be \u0628\u06be\u06cc \u062f\u0631\u0622\u0645\u062f \u0646\u06c1\u06cc\u06ba \u06a9\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u06cc\u0688\u06cc\u0679\u0631 \u0627\u0628 \u062e\u0648\u062f\u06a9\u0627\u0631 \u062a\u06a9\u0645\u06cc\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 <code>Translator.create()<\/code> \u0627\u0648\u0631 \u063a\u0644\u0637\u06cc\u0648\u06ba \u06a9\u06cc \u0627\u0637\u0644\u0627\u0639 \u062f\u06cc\u06ba\u06d4<\/p>\n<p>\u062d\u0630\u0641 \u06a9\u0631\u06cc\u06ba <code>app\/page.module.css<\/code> \u0627\u0648\u0631 \u063a\u06cc\u0631 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u0634\u062f\u06c1 \u062a\u0635\u0627\u0648\u06cc\u0631 \u06c1\u06cc\u06ba\u06d4 <code>public\/<\/code>. \u0622\u067e \u0628\u062f\u0644 \u062f\u06cc\u06ba <code>app\/page.tsx<\/code>\u060c <code>app\/layout.tsx<\/code> \u0627\u0648\u0631 <code>app\/globals.css<\/code>. \u0627\u0646 \u0641\u0648\u0644\u0688\u0631\u0632 \u06a9\u0648 \u0622\u06af\u06d2 \u0628\u0646\u0627\u0626\u06cc\u06ba: <code>app\/<\/code>:<\/p>\n<pre><code class=\"language-plaintext\">chrome-ai-translator\/\n\u251c\u2500\u2500 app\/\n\u2502   \u251c\u2500\u2500 globals.css\n\u2502   \u251c\u2500\u2500 layout.tsx\n\u2502   \u2514\u2500\u2500 page.tsx\n\u251c\u2500\u2500 components\/\n\u2502   \u251c\u2500\u2500 language-select.tsx\n\u2502   \u251c\u2500\u2500 text-panel.tsx\n\u2502   \u251c\u2500\u2500 translator-app.tsx\n\u2502   \u2514\u2500\u2500 unsupported-notice.tsx\n\u251c\u2500\u2500 hooks\/\n\u2502   \u2514\u2500\u2500 use-translation.ts\n\u2514\u2500\u2500 lib\/\n    \u251c\u2500\u2500 chrome-ai.ts\n    \u2514\u2500\u2500 languages.ts\n<\/code><\/pre>\n<p>\u06c1\u0631 \u0641\u0648\u0644\u0688\u0631 \u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u06a9\u0627\u0645 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<ul>\n<li><code>lib\/<\/code>    \u0627\u0633 \u0645\u06cc\u06ba \u0633\u0627\u062f\u06c1 \u0679\u0627\u0626\u067e \u0627\u0633\u06a9\u0631\u067e\u0679 \u06c1\u06d2 \u062c\u0648 \u06a9\u0631\u0648\u0645 \u06a9\u06d2 API \u0633\u06d2 \u0628\u0627\u062a \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>hooks\/<\/code>    \u0627\u0633\u06d2 \u0631\u062f \u0639\u0645\u0644 \u06a9\u06cc \u062d\u0627\u0644\u062a \u0645\u06cc\u06ba \u062a\u0628\u062f\u06cc\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li><code>components\/<\/code>    UI \u0634\u0627\u0645\u0644 \u06c1\u06d2\u06d4<\/li>\n<li><code>app\/<\/code>    Next.js \u0635\u0641\u062d\u0627\u062a \u0627\u0648\u0631 \u0644\u06d2 \u0622\u0624\u0679 \u067e\u0631 \u0645\u0634\u062a\u0645\u0644 \u06c1\u06d2\u06d4<\/li>\n<\/ul>\n<h2 id=\"heading-how-to-define-the-languages\">\u0632\u0628\u0627\u0646 \u06a9\u06cc \u062a\u0639\u0631\u06cc\u0641 \u06a9\u06cc\u0633\u06d2 \u06a9\u06cc \u062c\u0627\u0626\u06d2\u06d4<\/h2>\n<p>\u0628\u0646\u0627\u0646\u0627 <code>lib\/languages.ts<\/code>. \u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0645\u062a\u0631\u062c\u0645 API \u06a9\u06d2 \u0630\u0631\u06cc\u0639\u06c1 \u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1 \u0632\u0628\u0627\u0646\u06cc\u06ba \u062f\u0631\u062c \u06c1\u06cc\u06ba (\u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u062f\u06cc\u06a9\u06be\u06cc\u06ba)\u06d4 Translator API \u062f\u0631\u062c \u0630\u06cc\u0644 BCP 47 \u06a9\u0648\u0688\u0632 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2: <code>es<\/code> \u06cc\u0627 <code>zh-Hant<\/code>:<\/p>\n<pre><code class=\"language-ts\">\/** Sentinel value for \"detect the source language for me\". *\/\nexport const AUTO = \"auto\";\n\nexport interface Language {\n  \/** BCP 47 code, as expected by the Translator API. *\/\n  code: string;\n  name: string;\n  rtl?: boolean;\n}\n\nexport const LANGUAGES: Language[] = [\n  { code: \"ar\", name: \"Arabic\", rtl: true },\n  { code: \"de\", name: \"German\" },\n  { code: \"en\", name: \"English\" },\n  { code: \"es\", name: \"Spanish\" },\n  { code: \"fr\", name: \"French\" },\n  { code: \"he\", name: \"Hebrew\", rtl: true },\n  \/\/ ...the full list of 39 languages is in the repository\n  { code: \"zh\", name: \"Chinese (Simplified)\" },\n  { code: \"zh-Hant\", name: \"Chinese (Traditional)\" },\n];\n\nexport function languageName(code: string): string {\n  return LANGUAGES.find((language) => language.code === code)?.name ?? code;\n}\n\nexport function isRtl(code: string): boolean {\n  return LANGUAGES.find((language) => language.code === code)?.rtl ?? false;\n}\n<\/code><\/pre>\n<p>\u0679\u06cc\u0648\u0679\u0648\u0631\u06cc\u0644 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0633\u062e\u062a \u06a9\u0648\u0688 \u0648\u0627\u0644\u06cc \u0641\u06c1\u0631\u0633\u062a \u0679\u06be\u06cc\u06a9 \u06c1\u0648\u06af\u06cc\u060c \u0644\u06cc\u06a9\u0646 \u06a9\u0631\u0648\u0645 \u06a9\u0627 \u06a9\u06c1\u0646\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0641\u06c1\u0631\u0633\u062a \u0639\u0645\u0644 \u062f\u0631\u0622\u0645\u062f \u067e\u0631 \u0645\u0646\u062d\u0635\u0631 \u06c1\u06d2\u060c \u062a\u0628\u062f\u06cc\u0644\u06cc \u06a9\u06d2 \u062a\u0627\u0628\u0639 \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0627\u0633 \u0645\u06cc\u06ba \u0627\u0628\u06be\u06cc \u062a\u06a9 \u0645\u062a\u062d\u0631\u06a9 \u0637\u0648\u0631 \u067e\u0631 \u062a\u0644\u0627\u0634 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0635\u0644\u0627\u062d\u06cc\u062a \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 \u0627\u0633\u06cc \u0644\u06cc\u06d2 \u0627\u06cc\u067e \u0627\u0628 \u0628\u06be\u06cc \u06a9\u0627\u0644 \u06a9\u0631\u062a\u06cc \u06c1\u06d2\u06d4 <code>Translator.availability()<\/code> \u06a9\u0633\u06cc \u0628\u06be\u06cc \u062a\u0631\u062c\u0645\u06c1 \u0633\u06d2 \u067e\u06c1\u0644\u06d2\u06d4 \u0641\u06c1\u0631\u0633\u062a \u0635\u0631\u0641 \u0627\u0633 \u0628\u0627\u062a \u06a9\u0627 \u062a\u0639\u06cc\u0646 \u06a9\u0631\u062a\u06cc \u06c1\u06d2 \u06a9\u06c1 \u0688\u0631\u0627\u067e \u0688\u0627\u0624\u0646 \u0645\u06cc\u06ba \u06a9\u06cc\u0627 \u0638\u0627\u06c1\u0631 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u06a9\u06c1 <code>rtl<\/code> \u062c\u06be\u0646\u0688\u0627 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u0622\u0624\u0679 \u067e\u0679 \u06a9\u0648 \u0639\u0631\u0628\u06cc \u0627\u0648\u0631 \u0639\u0628\u0631\u0627\u0646\u06cc \u06a9\u06d2 \u0644\u06cc\u06d2 \u062f\u0627\u0626\u06cc\u06ba \u0633\u06d2 \u0628\u0627\u0626\u06cc\u06ba \u067e\u06cc\u0634 \u06a9\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-how-to-wrap-the-chrome-apis\">\u06a9\u0631\u0648\u0645 API \u06a9\u0648 \u06a9\u06cc\u0633\u06d2 \u0644\u067e\u06cc\u0679\u06cc\u06ba\u06d4<\/h2>\n<p>\u0627\u0628 \u0622\u067e \u0628\u0646\u0627\u0626\u06cc\u06ba \u06af\u06d2 <code>lib\/chrome-ai.ts<\/code>. \u06cc\u06c1 \u0641\u0627\u0626\u0644 \u067e\u0631\u0648\u062c\u06cc\u06a9\u0679 \u06a9\u0627 \u0628\u0646\u06cc\u0627\u062f\u06cc \u062d\u0635\u06c1 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0645\u062a\u0631\u062c\u0645 \u0627\u0648\u0631 \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 APIs \u06a9\u0648 \u062a\u0645\u0627\u0645 \u06a9\u0627\u0644\u0632 \u0631\u06a9\u06be\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 \u0628\u0627\u0642\u06cc \u0627\u06cc\u067e \u0627\u0646\u06c1\u06cc\u06ba \u0628\u0631\u0627\u06c1 \u0631\u0627\u0633\u062a \u0646\u06c1\u06cc\u06ba \u0686\u06be\u0648\u062a\u06cc \u06c1\u06d2\u06d4<\/p>\n<p>\u0627\u06cc\u06a9 \u0648\u0642\u062a \u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u0679\u06a9\u0691\u0627 \u0628\u0646\u0627\u0626\u06cc\u06ba\u060c \u06c1\u0631 \u0679\u06a9\u0691\u06d2 \u06a9\u0648 \u067e\u0686\u06be\u0644\u06d2 \u0679\u06a9\u0691\u06d2 \u06a9\u06d2 \u0646\u06cc\u0686\u06d2 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4 \u0627\u0633 \u0641\u0627\u0626\u0644 \u0645\u06cc\u06ba \u062a\u0645\u0627\u0645 \u0645\u0648\u0627\u062f \u06a9\u0644\u0627\u0626\u0646\u0679 \u06a9\u06d2 \u062c\u0632\u0648 \u0633\u06d2 \u0622\u062a\u0627 \u06c1\u06d2\u060c \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u06cc\u06c1 \u0635\u0631\u0641 \u0628\u0631\u0627\u0624\u0632\u0631 \u0645\u06cc\u06ba \u0686\u0644\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-step-1-add-the-shared-constants-types-and-errors\">\u0645\u0631\u062d\u0644\u06c1 1: \u0645\u0634\u062a\u0631\u06a9\u06c1 \u0645\u0633\u062a\u0642\u0644\u060c \u0627\u0642\u0633\u0627\u0645 \u0627\u0648\u0631 \u063a\u0644\u0637\u06cc\u0627\u06ba \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<p>\u06c1\u0645 \u0641\u0627\u0626\u0644 \u06a9\u0648 \u0686\u0646\u062f \u0686\u06be\u0648\u0679\u06cc \u062a\u0639\u0631\u06cc\u0641\u0648\u06ba \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0634\u0631\u0648\u0639 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba \u062c\u0646 \u067e\u0631 \u0628\u0639\u062f \u06a9\u06d2 \u0641\u0646\u06a9\u0634\u0646\u0632 \u0627\u0646\u062d\u0635\u0627\u0631 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<pre><code class=\"language-ts\">\/**\n * Thin helpers around Chrome's built-in Translator and Language Detector APIs.\n * Everything here runs in the browser only. Import it from Client Components.\n *\/\n\n\/** Below this confidence we ask the user to pick the language instead of guessing. *\/\nexport const CONFIDENCE_THRESHOLD = 0.6;\n\nexport type DownloadProgress = (fraction: number) => void;\n\nexport class LowConfidenceError extends Error {\n  constructor() {\n    super(\"We couldn't tell which language this is. Choose the source language manually.\");\n  }\n}\n\nexport class UnsupportedPairError extends Error {\n  constructor(source: string, target: string) {\n    super(`Chrome can't translate from \"${source}\" to \"${target}\" on this device.`);\n  }\n}\n<\/code><\/pre>\n<p>\u06c1\u0631 \u062d\u0635\u06d2 \u06a9\u0627 \u06a9\u0631\u062f\u0627\u0631 \u062f\u0631\u062c \u0630\u06cc\u0644 \u06c1\u06d2:<\/p>\n<ul>\n<li><code>CONFIDENCE_THRESHOLD<\/code>    \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u06a9\u06d2 \u0630\u0631\u06cc\u0639\u06c1 \u06a9\u0645 \u0633\u06d2 \u06a9\u0645 \u0627\u0639\u062a\u0645\u0627\u062f \u06a9\u0627 \u0627\u0633\u06a9\u0648\u0631 \u0642\u0628\u0648\u0644 \u06a9\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u06a9\u06be\u0648\u062c \u0627\u06cc\u06a9 \u0627\u0645\u06a9\u0627\u0646 \u06c1\u06d2\u060c \u062d\u0642\u06cc\u0642\u062a \u0646\u06c1\u06cc\u06ba\u06d4 \u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u06cc \u0645\u062a\u0646\u0628\u06c1 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0628\u06c1\u062a \u0645\u062e\u062a\u0635\u0631 \u062c\u0645\u0644\u06d2 \u0627\u0648\u0631 \u0648\u0627\u062d\u062f \u0627\u0644\u0641\u0627\u0638 \u06a9\u0645 \u062f\u0631\u0633\u062a\u06af\u06cc \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0646\u062a\u0627\u0626\u062c \u062f\u06cc\u06ba \u06af\u06d2\u060c \u0627\u0648\u0631 \u0627\u06af\u0631 \u0627\u0639\u062a\u0645\u0627\u062f \u0628\u06c1\u062a \u06a9\u0645 \u06c1\u06d2 \u062a\u0648 \u0646\u062a\u0627\u0626\u062c \u06a9\u0648 \u0646\u0627\u0645\u0639\u0644\u0648\u0645 \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0633\u0641\u0627\u0631\u0634 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u062c\u0648 \u06c1\u06a9 \u06c1\u0645 \u0628\u0639\u062f \u0645\u06cc\u06ba \u0644\u06a9\u06be\u06cc\u06ba \u06af\u06d2 \u0648\u06c1 \u06c1\u0631 \u0646\u062a\u06cc\u062c\u06c1 \u06a9\u0627 \u0627\u0633 \u0646\u0645\u0628\u0631 \u0633\u06d2 \u0645\u0648\u0627\u0632\u0646\u06c1 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 <code>0.6<\/code> \u06cc\u06c1 \u0627\u06cc\u06a9 \u0646\u0642\u0637\u06c1 \u0622\u063a\u0627\u0632 \u06c1\u06d2 \u062c\u0633\u06d2 \u0622\u067e \u0627\u067e\u0646\u06d2 \u0644\u06cc\u06d2 \u0645\u0648\u0627\u0641\u0642\u062a \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li><code>DownloadProgress<\/code>    \u06a9\u0627\u0644 \u0628\u06cc\u06a9 \u06a9\u06cc \u0642\u0633\u0645 \u062c\u0648 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a \u062d\u0627\u0635\u0644 \u06a9\u0631\u062a\u06cc \u06c1\u06d2\u06d4 \u06a9\u0631\u0648\u0645 \u0627\u0633 \u06a9\u06d2 \u062d\u0635\u06d2 \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u067e\u06cc\u0634\u0631\u0641\u062a \u06a9\u06cc \u0627\u0637\u0644\u0627\u0639 \u062f\u06cc\u062a\u0627 \u06c1\u06d2: <code>0<\/code> \u06a9\u0648 <code>1<\/code>\u062a\u0648 <code>0.5<\/code> \u0627\u0633 \u06a9\u0627 \u0645\u0637\u0644\u0628 \u06c1\u06d2 \u06a9\u06c1 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u0622\u062f\u06be\u06d2 \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06c1\u0648 \u0686\u06a9\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li><code>LowConfidenceError<\/code>    \u0627\u0633 \u0648\u0642\u062a \u06c1\u0648\u062a\u0627 \u06c1\u06d2 \u062c\u0628 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u06cc\u06c1 \u0646\u06c1\u06cc\u06ba \u0628\u062a\u0627 \u0633\u06a9\u062a\u0627 \u06a9\u06c1 \u0645\u062a\u0646 \u06a9\u0633 \u0632\u0628\u0627\u0646 \u0645\u06cc\u06ba \u06c1\u06d2\u06d4 \u0627\u0633 \u06a9\u06cc \u0627\u067e\u0646\u06cc \u06a9\u0644\u0627\u0633 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u06c1\u06a9 \u0627\u0633\u06d2 \u062f\u0648\u0633\u0631\u06cc \u063a\u0644\u0637\u06cc\u0648\u06ba \u0633\u06d2 \u0645\u0645\u062a\u0627\u0632 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0627\u062c\u0627\u0632\u062a \u062f\u06cc\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0627\u0633 \u06a9\u0627 \u067e\u06cc\u063a\u0627\u0645 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u0628\u062a\u0627\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0622\u06af\u06d2 \u06a9\u06cc\u0627 \u06a9\u0631\u0646\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>UnsupportedPairError<\/code>    \u0627\u06cc\u06a9 \u062e\u0631\u0627\u0628\u06cc \u0627\u0633 \u0648\u0642\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2 \u062c\u0628 \u06a9\u0631\u0648\u0645 \u06a9\u06c1\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0648\u06c1 \u062f\u0648 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u062f\u0631\u0645\u06cc\u0627\u0646 \u062a\u0631\u062c\u0645\u06c1 \u0646\u06c1\u06cc\u06ba \u06a9\u0631 \u0633\u06a9\u062a\u0627\u06d4 \u0627\u0633 \u0645\u06cc\u06ba \u062f\u0648\u0646\u0648\u06ba \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u06a9\u0648\u0688 \u0634\u0627\u0645\u0644 \u06c1\u06cc\u06ba \u062a\u0627\u06a9\u06c1 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u0645\u0639\u0644\u0648\u0645 \u06c1\u0648 \u06a9\u06c1 \u06a9\u0648\u0646 \u0633\u0627 \u062c\u0648\u0691\u0627 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648\u0627\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-step-2-check-whether-the-browser-supports-the-apis\">\u0645\u0631\u062d\u0644\u06c1 2: \u0686\u06cc\u06a9 \u06a9\u0631\u06cc\u06ba \u06a9\u06c1 \u0622\u06cc\u0627 \u0622\u067e \u06a9\u0627 \u0628\u0631\u0627\u0624\u0632\u0631 API \u06a9\u0648 \u0633\u067e\u0648\u0631\u0679 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/h3>\n<p>\u062e\u0635\u0648\u0635\u06cc\u062a \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u06a9\u0627 \u0641\u0646\u06a9\u0634\u0646 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<pre><code class=\"language-ts\">\/** Feature detection. Always false on the server, where `self.Translator` doesn't exist. *\/\nexport function isBuiltInAISupported(): boolean {\n  return typeof self !== \"undefined\" && \"Translator\" in self && \"LanguageDetector\" in self;\n}\n<\/code><\/pre>\n<p>Next.js \u067e\u06c1\u0644\u06d2 \u062c\u0632\u0648 \u06a9\u0648 \u0633\u0631\u0648\u0631 \u067e\u0631 \u067e\u06cc\u0634 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0646\u06c1 \u06a9\u06c1 \u0633\u0631\u0648\u0631 \u067e\u0631\u06d4 <code>self.Translator<\/code>. \u06cc\u06c1 \u0641\u0646\u06a9\u0634\u0646 \u062a\u06cc\u0646 \u0686\u06cc\u0632\u0648\u06ba \u06a9\u0648 \u0686\u06cc\u06a9 \u06a9\u0631\u062a\u0627 \u06c1\u06d2:<\/p>\n<ul>\n<li><code>typeof self !== \"undefined\"<\/code>    \u06cc\u0642\u06cc\u0646\u06cc \u0628\u0646\u0627\u0626\u06cc\u06ba \u06a9\u06c1 \u06c1\u0645 \u062d\u0627\u0644\u0627\u062a \u0645\u06cc\u06ba \u06c1\u06cc\u06ba\u06d4 <code>self<\/code> \u0686\u0648\u0646\u06a9\u06c1 \u06cc\u06c1 \u0645\u0648\u062c\u0648\u062f \u06c1\u06d2\u060c \u0641\u0646\u06a9\u0634\u0646 \u0633\u0631\u0648\u0631 \u067e\u0631 \u06a9\u0631\u06cc\u0634 \u0646\u06c1\u06cc\u06ba \u06c1\u0648 \u0633\u06a9\u062a\u0627\u06d4<\/li>\n<li><code>\"Translator\" in self<\/code>    Translator API \u06a9\u06d2 \u0644\u06cc\u06d2 Chrome \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0645\u06cc\u06ba \u06cc\u06c1 \u062a\u062c\u0648\u06cc\u0632 \u06a9\u0631\u062f\u06c1 \u0686\u06cc\u06a9 \u06c1\u06d2\u06d4<\/li>\n<li><code>\"LanguageDetector\" in self<\/code>    \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 API \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u06cc\u0686 \u0686\u06cc\u06a9\u0646\u06af\u06d4 \u0622\u067e \u06a9\u06cc \u0627\u06cc\u067e \u06a9\u0648 \u062f\u0648\u0646\u0648\u06ba \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u06cc\u06c1 \u0633\u067e\u0648\u0631\u0679 \u06a9\u06cc \u0627\u0637\u0644\u0627\u0639 \u0635\u0631\u0641 \u0627\u0633 \u0648\u0642\u062a \u062f\u06cc\u062a\u06cc \u06c1\u06d2 \u062c\u0628 \u062f\u0648\u0646\u0648\u06ba \u0645\u0648\u062c\u0648\u062f \u06c1\u0648\u06ba\u06d4<\/li>\n<\/ul>\n<p>\u0641\u0646\u06a9\u0634\u0646 \u0648\u0627\u067e\u0633 \u0622\u062a\u0627 \u06c1\u06d2\u06d4 <code>true<\/code> \u06cc\u0627 <code>false<\/code> \u0627\u0648\u0631 \u0645\u06cc\u06ba \u0627\u0633\u06d2 \u06a9\u0628\u06be\u06cc \u0646\u06c1\u06cc\u06ba \u067e\u06be\u06cc\u0646\u06a9\u062a\u0627\u06d4 \u0622\u067e \u0627\u0633\u06d2 \u0628\u0639\u062f \u0645\u06cc\u06ba \u06cc\u06c1 \u0641\u06cc\u0635\u0644\u06c1 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06cc\u06ba \u06af\u06d2 \u06a9\u06c1 \u0622\u06cc\u0627 \u0627\u0633\u06d2 \u0645\u062a\u0631\u062c\u0645 \u06a9\u06d2 \u0633\u0627\u0645\u0646\u06d2 \u0688\u0633\u067e\u0644\u06d2 \u06a9\u0631\u0646\u0627 \u06c1\u06d2 \u06cc\u0627 &quot;\u063a\u06cc\u0631 \u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1&#8221; \u0627\u0637\u0644\u0627\u0639 \u0688\u0633\u067e\u0644\u06d2 \u06a9\u0631\u0646\u0627 \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-step-3-create-the-language-detector\">\u0645\u0631\u062d\u0644\u06c1 3: \u0627\u06cc\u06a9 \u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u0648\u0627\u0644\u0627 \u0628\u0646\u0627\u0626\u06cc\u06ba<\/h3>\n<p>\u0627\u06af\u0644\u0627\u060c \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u0628\u0646\u0627\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u0648\u0688 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4 \u06cc\u06c1 \u067e\u06c1\u0644\u06cc \u062c\u06af\u06c1 \u06c1\u06d2 \u062c\u0633\u06d2 \u0622\u067e \u062f\u06cc\u06a9\u06be\u06cc\u06ba \u06af\u06d2\u06d4 <code>monitor<\/code> \u06a9\u0627\u0644 \u0628\u06cc\u06a9\u0633 \u0627\u0648\u0631 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a:<\/p>\n<pre><code class=\"language-ts\">let detectorPromise: Promise<languagedetector> | null = null;\n\nfunction getDetector(onProgress?: DownloadProgress) {\n  detectorPromise ??= LanguageDetector.create({\n    monitor(monitor) {\n      monitor.addEventListener(\"downloadprogress\", (event) => onProgress?.(event.loaded));\n    },\n  });\n  \/\/ If creation fails (e.g. no user activation), allow a retry on the next click.\n  detectorPromise.catch(() => {\n    detectorPromise = null;\n  });\n  return detectorPromise;\n}\n<\/languagedetector><\/code><\/pre>\n<p>\u06cc\u06c1 \u06c1\u06d2 \u0637\u0631\u06cc\u0642\u06c1: <code>getDetector()<\/code> \u0641\u06cc\u06a9\u0679\u0631\u06cc:<\/p>\n<ul>\n<li><code>detectorPromise<\/code>    \u0645\u0627\u0688\u06cc\u0648\u0644 \u0633\u0637\u062d \u06a9\u0627 \u0645\u062a\u063a\u06cc\u0631 \u062c\u0648 \u067e\u06a9\u0691\u0646\u06d2 \u0648\u0627\u0644\u0627 \u0631\u06a9\u06be\u062a\u0627 \u06c1\u06d2\u06d4 \u06c1\u0645 \u06c1\u06cc\u06ba <strong>\u0648\u0639\u062f\u06c1<\/strong>\u06cc\u06c1 \u0645\u06a9\u0645\u0644 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u0648\u0627\u0644\u0627 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 \u0627\u0633 \u0637\u0631\u062d\u060c \u0627\u06af\u0631 \u0627\u06cc\u067e \u06a9\u06d2 \u062f\u0648 \u062d\u0635\u06d2 \u0628\u06cc\u06a9 \u0648\u0642\u062a \u0627\u06cc\u06a9 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u06a9\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u062a\u0648 \u0648\u06c1 \u062f\u0648 \u0634\u0631\u0648\u0639 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0628\u062c\u0627\u0626\u06d2 \u0627\u06cc\u06a9 \u06a9\u06cc \u062a\u062e\u0644\u06cc\u0642 \u06a9\u0627 \u0627\u0634\u062a\u0631\u0627\u06a9 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li><code>??=<\/code>    &quot;\u0627\u0633 \u06a9\u0627 \u0645\u0637\u0644\u0628 \u06c1\u06d2 \u06a9\u06c1 \u0645\u062a\u063a\u06cc\u0631 \u0635\u0631\u0641 \u0627\u0633 \u0635\u0648\u0631\u062a \u0645\u06cc\u06ba \u062a\u0641\u0648\u06cc\u0636 \u06a9\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2 \u062c\u0628: <code>null<\/code> \u06cc\u0627 <code>undefined<\/code>&quot;\u067e\u06c1\u0644\u06cc \u06a9\u0627\u0644 \u06a9\u06cc \u06af\u0626\u06cc \u06c1\u06d2\u06d4 <code>LanguageDetector.create()<\/code>\u062a\u0645\u0627\u0645 \u0628\u0639\u062f \u06a9\u06cc \u06a9\u0627\u0644\u06cc\u06ba \u0645\u062d\u0641\u0648\u0638 \u06a9\u06cc\u06d2 \u06af\u0626\u06d2 \u0648\u0639\u062f\u06d2 \u06a9\u0648 \u062f\u0648\u0628\u0627\u0631\u06c1 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06cc\u06ba \u06af\u06cc\u06d4<\/li>\n<li>\u06a9\u06c1 <code>monitor<\/code> \u0627\u062e\u062a\u06cc\u0627\u0631\u0627\u062a \u06a9\u0627\u0644 \u0628\u06cc\u06a9\u0633 \u06c1\u06cc\u06ba \u062c\u0646\u06c1\u06cc\u06ba \u06a9\u0631\u0648\u0645 \u0627\u0633 \u0637\u0631\u062d \u06a9\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2: <code>CreateMonitor<\/code> \u0627\u0639\u062a\u0631\u0627\u0636 \u06c1\u0645 \u0627\u0633\u06d2 \u0633\u0646\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 <code>downloadprogress<\/code> \u0648\u0627\u0642\u0639\u0627\u062a \u0627\u0648\u0631 \u067e\u0627\u0633\u0632 <code>event.loaded<\/code>0 \u0633\u06d2 1 \u062d\u0635\u06c1\u060c <code>onProgress<\/code>. \u06a9\u0631\u0648\u0645 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u06a9\u0627 \u0645\u0627\u0688\u0644 \u0686\u06be\u0648\u0679\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u06c1\u0648 \u0633\u06a9\u062a\u0627 \u06c1\u06d2 \u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u06c1\u06cc \u0688\u06cc\u0648\u0627\u0626\u0633 \u067e\u0631 \u06c1\u0648\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u06c1\u0648 \u0633\u06a9\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u06cc\u06c1 \u0627\u06cc\u0648\u0646\u0679 \u0641\u0627\u0626\u0631 \u0646\u06c1 \u06c1\u0648\u06d4 \u06c1\u0645 \u0627\u0628 \u0628\u06be\u06cc \u0627\u0633 \u0633\u06d2 \u0646\u0645\u0679\u062a\u06d2 \u06c1\u06cc\u06ba \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u0627\u0633\u06d2 \u067e\u06c1\u0644\u06cc \u0628\u0627\u0631 \u0646\u06a9\u0627\u0644\u0627 \u062c\u0627 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u06a9\u06c1 <code>.catch()<\/code> \u062f\u0648\u0628\u0627\u0631\u06c1 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06cc\u06ba <code>detectorPromise<\/code> \u06a9\u0648 <code>null<\/code> \u0627\u06af\u0631 \u062a\u062e\u0644\u06cc\u0642 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u062c\u0627\u0626\u06d2\u06d4 \u0628\u0635\u0648\u0631\u062a \u062f\u06cc\u06af\u0631\u060c \u0646\u0627\u06a9\u0627\u0645 \u06a9\u0648\u0634\u0634\u06cc\u06ba (\u0645\u062b\u0644\u0627\u064b \u062c\u0628 \u06a9\u0631\u0648\u0645 \u06a9\u0648 \u06a9\u0633\u06cc \u0627\u06cc\u0633\u06d2 \u06a9\u0644\u06a9 \u06a9\u06cc \u062a\u0648\u0642\u0639 \u06c1\u0648\u062a\u06cc \u06c1\u06d2 \u062c\u0648 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u0646\u06c1\u06cc\u06ba \u0645\u0644\u06cc) \u06c1\u0645\u06cc\u0634\u06c1 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u06cc\u0634 \u06c1\u0648 \u062c\u0627\u0626\u06d2 \u06af\u06cc \u0627\u0648\u0631 \u0635\u0627\u0631\u0641 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u0646\u06c1\u06cc\u06ba \u06a9\u0631 \u0633\u06a9\u06d2 \u06af\u0627\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-step-4-detect-the-language-of-some-text\">\u0645\u0631\u062d\u0644\u06c1 4: \u06a9\u0686\u06be \u0645\u062a\u0646 \u06a9\u06cc \u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0626\u06cc\u06ba\u06d4<\/h3>\n<p>\u0627\u0628 \u0622\u0626\u06cc\u06d2 \u0627\u06cc\u06a9 \u0641\u0646\u06a9\u0634\u0646 \u0634\u0627\u0645\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba \u062c\u0648 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-ts\">export interface Detection {\n  language: string;\n  confidence: number;\n}\n\nexport async function detectLanguage(\n  text: string,\n  onProgress?: DownloadProgress,\n  signal?: AbortSignal,\n): Promise<detection null=\"\"> {\n  const detector = await getDetector(onProgress);\n  \/\/ Results are ranked from most to least likely. The last entry is always \"und\" (undetermined).\n  const [top] = await detector.detect(text, { signal });\n  if (!top?.detectedLanguage || top.detectedLanguage === \"und\") return null;\n  return { language: top.detectedLanguage, confidence: top.confidence ?? 0 };\n}\n<\/detection><\/code><\/pre>\n<p>\u06cc\u06c1\u0627\u06ba \u06cc\u06c1 \u06c1\u06d2 \u06a9\u06c1 \u06a9\u0648\u0688 \u06a9\u06cc\u0627 \u06a9\u0631\u062a\u0627 \u06c1\u06d2:<\/p>\n<ul>\n<li>\u06a9\u06c1 <code>Detection<\/code> \u0627\u0646\u0679\u0631\u0641\u06cc\u0633 \u0628\u06cc\u0627\u0646 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u06c1\u0645 \u06a9\u06cc\u0627 \u0644\u0648\u0679\u062a\u06d2 \u06c1\u06cc\u06ba: \u0627\u06cc\u06a9 BCP 47 \u0632\u0628\u0627\u0646 \u06a9\u0627 \u06a9\u0648\u0688\u060c \u062c\u06cc\u0633\u06d2 <code>\"es\"<\/code>\u0627\u0639\u062a\u0645\u0627\u062f \u0633\u06a9\u0648\u0631 \u06a9\u06d2 \u062f\u0631\u0645\u06cc\u0627\u0646 <code>0<\/code> \u0627\u0648\u0631 <code>1<\/code>.<\/li>\n<li><code>detectLanguage()<\/code>    \u0633\u0628 \u0633\u06d2 \u067e\u06c1\u0644\u06d2\u060c \u0688\u0679\u06cc\u06a9\u0679\u0631 \u06a9\u06d2 \u0622\u0646 \u06c1\u0648\u0646\u06d2 \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631\u06cc\u06ba\u06d4 <code>getDetector()<\/code>. \u067e\u0627\u0633 <code>onProgress<\/code> UI \u06a9\u0648 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u0628\u0627\u0631 \u0688\u0633\u067e\u0644\u06d2 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0642\u0627\u0628\u0644 \u0628\u0646\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>detector.detect(text, { signal })<\/code>    \u0633\u0628 \u0633\u06d2 \u0632\u06cc\u0627\u062f\u06c1 \u0627\u0645\u06a9\u0627\u0646 \u0633\u06d2 \u06a9\u0645 \u0633\u06d2 \u06a9\u0645 \u0627\u0645\u06a9\u0627\u0646 \u062a\u06a9 \u062f\u0631\u062c\u06c1 \u0628\u0646\u062f\u06cc \u06a9\u06d2 \u0627\u0646\u062f\u0627\u0632\u0648\u06ba \u06a9\u06cc \u0641\u06c1\u0631\u0633\u062a \u0644\u0648\u0679\u0627\u062a\u0627 \u06c1\u06d2\u06d4 <code>detectedLanguage<\/code> \u0627\u0648\u0631 <code>confidence<\/code>. \u06a9\u06c1 <code>signal<\/code> \u0686\u0627\u0646\u062f\u06cc <code>AbortSignal<\/code>\u0635\u0627\u0631\u0641 \u062c\u0627\u0631\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0648 \u0645\u0646\u0633\u0648\u062e \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li>\u0635\u0641 \u06a9\u0648 \u062a\u0628\u0627\u06c1 <code>[top]<\/code> \u06c1\u0645 \u0635\u0631\u0641 \u0627\u067e\u0646\u0627 \u0628\u06c1\u062a\u0631\u06cc\u0646 \u0627\u0646\u062f\u0627\u0632\u06c1 \u0644\u06af\u0627\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li>\u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0646\u062a\u0627\u0626\u062c \u0645\u06cc\u06ba \u0622\u062e\u0631\u06cc \u0622\u0626\u0679\u0645 \u06c1\u0645\u06cc\u0634\u06c1 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4 <code>und<\/code>\u0627\u0633 \u06a9\u0627 \u0645\u0637\u0644\u0628 \u06c1\u06d2 &quot;\u063a\u06cc\u0631 \u0645\u062a\u0639\u06cc\u0646&#8221;\u06d4 \u0627\u0633 \u0628\u0627\u062a \u06a9\u0627 \u0627\u0645\u06a9\u0627\u0646 \u06a9\u06c1 \u0645\u062a\u0646 \u0645\u0627\u0688\u0644 \u06a9\u0648 \u0645\u0639\u0644\u0648\u0645 \u0632\u0628\u0627\u0646 \u0645\u06cc\u06ba \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 \u0627\u06af\u0631 \u0622\u067e \u06a9\u0627 \u0628\u06c1\u062a\u0631\u06cc\u0646 \u0627\u0646\u062f\u0627\u0632\u06c1 \u063a\u0627\u0626\u0628 \u06c1\u06d2 \u06cc\u0627: <code>und<\/code>\u0641\u0646\u06a9\u0634\u0646 \u0648\u0627\u067e\u0633\u06cc <code>null<\/code>\u0627\u0633 \u06a9\u0627 \u0645\u0637\u0644\u0628 \u06c1\u06d2 &quot;\u06a9\u0648\u0626\u06cc \u062c\u0648\u0627\u0628 \u0646\u06c1\u06cc\u06ba&#8221;\u06d4<\/li>\n<li>\u0628\u0635\u0648\u0631\u062a \u062f\u06cc\u06af\u0631 \u06cc\u06c1 \u0632\u0628\u0627\u0646 \u0627\u0648\u0631 \u0627\u0639\u062a\u0645\u0627\u062f \u0644\u0648\u0679\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u06a9\u06c1 <code>?? 0<\/code> \u06cc\u06c1 \u0627\u06cc\u06a9 \u062d\u0641\u0627\u0638\u062a\u06cc \u062c\u0627\u0644 \u06c1\u06d2 \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u06c1\u0645\u0627\u0631\u06d2 \u067e\u0627\u0633 TypeScript \u06a9\u06cc \u0627\u0642\u0633\u0627\u0645 \u06c1\u06cc\u06ba\u06d4 <code>confidence<\/code> \u0627\u062e\u062a\u06cc\u0627\u0631\u06cc \u0637\u0648\u0631 \u067e\u0631\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-step-5-create-and-cache-translators\">\u0645\u0631\u062d\u0644\u06c1 5: \u0645\u062a\u0631\u062c\u0645 \u0628\u0646\u0627\u0626\u06cc\u06ba \u0627\u0648\u0631 \u06a9\u06cc\u0634 \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<p>\u062a\u0631\u062c\u0645\u06c1 \u0648\u06c1 \u062c\u06af\u06c1 \u06c1\u06d2 \u062c\u06c1\u0627\u06ba \u0632\u0628\u0627\u0646 \u06a9\u06cc \u062c\u0648\u0691\u06cc \u06a9\u06cc \u0645\u0646\u0637\u0642 \u0645\u0648\u062c\u0648\u062f \u06c1\u06d2\u06d4 \u0627\u0633 \u0645\u06cc\u06ba \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba:<\/p>\n<pre><code class=\"language-ts\">\/\/ A Translator is tied to one language pair. Creating one is expensive, so we keep them around.\nconst translators = new Map<string translator=\"\">();\n\nexport async function getTranslator(\n  sourceLanguage: string,\n  targetLanguage: string,\n  onProgress?: DownloadProgress,\n  signal?: AbortSignal,\n): Promise<translator> {\n  const key = `${sourceLanguage}>${targetLanguage}`;\n  const cached = translators.get(key);\n  if (cached) return cached;\n\n  const availability = await Translator.availability({ sourceLanguage, targetLanguage });\n  if (availability === \"unavailable\") {\n    throw new UnsupportedPairError(sourceLanguage, targetLanguage);\n  }\n\n  const translator = await Translator.create({\n    sourceLanguage,\n    targetLanguage,\n    signal,\n    monitor(monitor) {\n      monitor.addEventListener(\"downloadprogress\", (event) => onProgress?.(event.loaded));\n    },\n  });\n  translators.set(key, translator);\n  return translator;\n}\n<\/translator><\/string><\/code><\/pre>\n<p>\u06cc\u06c1 \u062e\u0635\u0648\u0635\u06cc\u062a \u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0645\u06cc\u06ba \u0628\u06cc\u0627\u0646 \u06a9\u0631\u062f\u06c1 \u0686\u0627\u0631 \u0645\u0631\u0627\u062d\u0644 \u06a9\u06d2 \u0644\u0627\u0626\u0641 \u0633\u0627\u0626\u06cc\u06a9\u0644 \u06a9\u06cc \u067e\u06cc\u0631\u0648\u06cc \u06a9\u0631\u062a\u06cc \u06c1\u06d2\u06d4<\/p>\n<ol>\n<li><strong>\u0627\u067e\u0646\u0627 \u06a9\u06cc\u0634 \u0686\u06cc\u06a9 \u06a9\u0631\u06cc\u06ba\u06d4<\/strong> \u06a9\u0648\u0626\u06cc \u0631\u0627\u0633\u062a\u06c1 \u0646\u06c1\u06cc\u06ba <code>Translator<\/code> \u06cc\u06c1 \u0628\u0627\u0644\u06a9\u0644 \u0627\u06cc\u06a9 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u062c\u0648\u0691\u06d2 \u0633\u06d2 \u0645\u0646\u0633\u0644\u06a9 \u06c1\u06d2\u06d4 \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u0627\u06cc\u06a9 \u0628\u0646\u0627\u0646\u0627 \u0645\u06c1\u0646\u06af\u0627 \u06c1\u06d2\u060c \u06c1\u0645 <code>Map<\/code> \u0627\u0646 \u0645\u06cc\u06ba \u062f\u0631\u062c \u0630\u06cc\u0644 \u0633\u0679\u0631\u0646\u06af \u0627\u0646 \u067e\u0679 \u06c1\u06d2\u06d4 <code>\"en>es\"<\/code>. \u0627\u06af\u0631 \u0627\u0633 \u062c\u0648\u0691\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u06a9\u0648\u0626\u06cc \u0645\u062a\u0631\u062c\u0645 \u0645\u0648\u062c\u0648\u062f \u06c1\u06d2\u060c \u062a\u0648 \u06cc\u06c1 \u0641\u0648\u0631\u0627\u064b \u0648\u0627\u067e\u0633 \u0622\u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u0633 \u0644\u06cc\u06d2 \u062f\u0648\u0633\u0631\u06d2 \u062c\u0645\u0644\u06d2 \u06a9\u0627 \u062a\u0631\u062c\u0645\u06c1 \u062a\u06cc\u0632 \u062a\u0631 \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u062f\u0633\u062a\u06cc\u0627\u0628\u06cc \u0686\u06cc\u06a9 \u06a9\u0631\u06cc\u06ba\u06d4<\/strong> <code>Translator.availability()<\/code>    \u06cc\u06c1 \u0622\u067e \u06a9\u0648 \u0628\u062a\u0627\u0626\u06d2 \u06af\u0627 \u06a9\u06c1 \u0622\u06cc\u0627 \u06a9\u0631\u0648\u0645 \u0627\u0633 \u062c\u0648\u0691\u06d2 \u06a9\u0648 \u0633\u0646\u0628\u06be\u0627\u0644 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u0648\u0627\u067e\u0633 \u0622\u062a\u0627 \u06c1\u06d2 <code>unavailable<\/code>\u060c <code>downloadable<\/code>\u060c <code>downloading<\/code> \u06cc\u0627 <code>available<\/code>. \u067e\u06be\u0631 <code>unavailable<\/code>\u06c1\u0645 \u067e\u06be\u06cc\u0646\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba <code>UnsupportedPairError<\/code> \u0627\u0633 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u06a9\u06c1 \u0622\u067e \u06a9\u0686\u06be \u0627\u0648\u0631 \u0622\u0632\u0645\u0627\u0626\u06cc\u06ba\u060c \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u0627\u0633 \u062c\u0648\u0691\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0634\u0631\u0648\u0639 \u0646\u06c1\u06cc\u06ba \u06c1\u0648\u06af\u0627 \u062c\u0648 \u06a9\u0627\u0645 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0627\u06cc\u06a9 \u0645\u062a\u0631\u062c\u0645 \u0628\u0646\u0627\u0626\u06cc\u06ba\u06d4<\/strong> <code>Translator.create()<\/code>    \u0632\u0628\u0627\u0646 \u06a9\u0627 \u062c\u0648\u0691\u0627 \u0648\u0635\u0648\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 <code>signal<\/code> \u0645\u0646\u0633\u0648\u062e \u06a9\u0631\u0646\u0627 <code>monitor<\/code> \u06cc\u06c1 \u0627\u06cc\u06a9 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u06a9\u06cc \u0637\u0631\u062d \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a \u06a9\u06cc \u0627\u0637\u0644\u0627\u0639 \u062f\u06cc\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u06af\u0631 \u0622\u067e \u06a9\u0648 \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u060c \u062a\u0648 Chrome \u0627\u0633\u06d2 \u062e\u0648\u062f \u0628\u062e\u0648\u062f \u06cc\u06c1\u0627\u06ba \u0633\u06d2 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u0627 \u0634\u0631\u0648\u0639 \u06a9\u0631 \u062f\u06d2 \u06af\u0627\u06d4 \u0627\u06af\u0631 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u060c \u062a\u0648 \u06cc\u06c1 \u0628\u06be\u06cc \u0627\u06cc\u06a9 \u0642\u062f\u0645 \u06c1\u06d2 \u062c\u0633 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0635\u0627\u0631\u0641 \u06a9\u06d2 \u0627\u0634\u0627\u0631\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2 \u062c\u06cc\u0633\u06d2 \u06a9\u06c1 \u06a9\u0644\u06a9\u06d4<\/li>\n<li><strong>\u0631\u06a9\u06be\u0648 \u0627\u0648\u0631 \u0648\u0627\u067e\u0633 \u06a9\u0631\u0648\u06d4<\/strong> \u0646\u0626\u06d2 \u0645\u062a\u0631\u062c\u0645 \u06a9\u0648 \u062f\u0631\u062c \u0630\u06cc\u0644 \u0645\u0642\u0627\u0645 \u067e\u0631 \u0645\u062d\u0641\u0648\u0638 \u06a9\u0631\u06cc\u06ba: <code>Map<\/code> \u0627\u06af\u0644\u06cc \u0628\u0627\u0631 \u0627\u0633\u06d2 \u0648\u0627\u067e\u0633 \u06a9\u0631\u0646\u0627 \u06cc\u0642\u06cc\u0646\u06cc \u0628\u0646\u0627\u0626\u06cc\u06ba\u06d4<\/li>\n<\/ol>\n<h3 id=\"heading-step-6-release-the-models-when-youre-done\">\u0645\u0631\u062d\u0644\u06c1 6: \u0645\u06a9\u0645\u0644 \u06c1\u0648\u0646\u06d2 \u06a9\u06d2 \u0628\u0639\u062f\u060c \u0645\u0627\u0688\u0644 \u062c\u0627\u0631\u06cc \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<p>\u0645\u0641\u062a \u0645\u06cc\u0645\u0648\u0631\u06cc \u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u0641\u0646\u06a9\u0634\u0646 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<pre><code class=\"language-ts\">\/** Releases the memory held by the models. Call it when the user leaves the feature. *\/\nexport async function destroyAll() {\n  for (const translator of translators.values()) translator.destroy();\n  translators.clear();\n  const pending = detectorPromise;\n  detectorPromise = null;\n  (await pending?.catch(() => null))?.destroy();\n}\n<\/code><\/pre>\n<p>MDN \u06a9\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u062a\u062c\u0648\u06cc\u0632 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 <code>destroy()<\/code> \u0627\u06cc\u06a9 \u0628\u0627\u0631 \u062c\u0628 \u0622\u067e \u062e\u062a\u0645 \u06a9\u0631\u06cc\u06ba\u06d4 <code>Translator<\/code> \u06cc\u0627 <code>LanguageDetector<\/code>\u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u0628\u06c1\u062a \u0633\u0627\u0631\u06d2 \u0648\u0633\u0627\u0626\u0644 \u062f\u0633\u062a\u06cc\u0627\u0628 \u06c1\u06cc\u06ba\u06d4 \u06cc\u06c1 \u0641\u0646\u06a9\u0634\u0646 \u06c1\u0631 \u0627\u0633 \u0686\u06cc\u0632 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0648 \u06c1\u0645 \u0628\u0646\u0627\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li>\u06a9\u06c1 <code>for<\/code> \u0644\u0648\u067e \u06a9\u0627\u0644 <code>destroy()<\/code> \u062a\u0645\u0627\u0645 \u06a9\u06cc\u0634 \u0634\u062f\u06c1 \u0645\u062a\u0631\u062c\u0645\u06cc\u0646 \u0645\u06cc\u06ba <code>translators.clear()<\/code> \u06a9\u06cc\u0634\u06d2 \u06a9\u0648 \u062e\u0627\u0644\u06cc \u06a9\u0631\u0646\u06d2 \u0633\u06d2\u060c \u0645\u0633\u062a\u0642\u0628\u0644 \u06a9\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc\u06ba \u0627\u06cc\u06a9 \u0646\u06cc\u0627 \u06a9\u06cc\u0634 \u0628\u0646\u0627\u0626\u06cc\u06ba \u06af\u06cc\u06d4<\/li>\n<li>\u0688\u0679\u06cc\u06a9\u0679\u0631 \u0632\u06cc\u0627\u062f\u06c1 \u0645\u0634\u06a9\u0644 \u06c1\u0648\u062a\u06d2 \u06c1\u06cc\u06ba \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u0648\u06c1 \u062e\u0648\u062f \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u06a9\u06d2 \u0628\u062c\u0627\u0626\u06d2 \u0645\u0644\u0627\u0642\u0627\u062a\u06cc\u06ba \u0645\u062d\u0641\u0648\u0638 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u06c1\u0645 \u0648\u0639\u062f\u06c1 \u0646\u0642\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 <code>pending<\/code>\u0645\u0634\u062a\u0631\u06a9\u06c1 \u0645\u062a\u063a\u06cc\u0631 \u06a9\u0648 \u0627\u0633 \u067e\u0631 \u0631\u06cc \u0633\u06cc\u0679 \u06a9\u0631\u06cc\u06ba: <code>null<\/code>\u0627\u0648\u0631 \u0627\u067e\u0646\u06cc \u0645\u0644\u0627\u0642\u0627\u062a \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li><code>pending?.catch(() => null)<\/code>    \u06c1\u0645 \u062f\u0648 \u0627\u0646\u062a\u06c1\u0627\u0626\u06cc \u0645\u0639\u0627\u0645\u0644\u0627\u062a \u06a9\u0648 \u0633\u0646\u0628\u06be\u0627\u0644\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u06c1\u0648 \u0633\u06a9\u062a\u0627 \u06c1\u06d2 \u06a9\u0648\u0626\u06cc \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u0648\u0627\u0644\u0627 \u0646\u06c1 \u06c1\u0648\u060c \u06cc\u0627 \u062a\u062e\u0644\u06cc\u0642 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u06af\u0626\u06cc \u06c1\u0648\u06d4 \u062f\u0648\u0646\u0648\u06ba \u0635\u0648\u0631\u062a\u0648\u06ba \u0645\u06cc\u06ba \u06c1\u0645\u06cc\u06ba \u0645\u0644\u062a\u0627 \u06c1\u06d2: <code>null<\/code> \u0648\u0627\u067e\u0633\u06cc \u0627\u0648\u0631 \u0622\u062e\u0631\u06cc <code>?.destroy()<\/code> \u06a9\u0686\u06be \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627\u06d4<\/li>\n<\/ul>\n<p>\u0627\u06af\u0644\u06cc \u06a9\u0627\u0644 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0644\u06a9\u06be\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06c1\u06a9 <code>destroyAll()<\/code> \u062c\u0628 \u06a9\u0648\u0626\u06cc \u062c\u0632\u0648 \u0627\u0646 \u0645\u0627\u0624\u0646\u0679 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-step-7-turn-api-errors-into-helpful-messages\">\u0645\u0631\u062d\u0644\u06c1 7: API \u06a9\u06cc \u063a\u0644\u0637\u06cc\u0648\u06ba \u06a9\u0648 \u0645\u0641\u06cc\u062f \u067e\u06cc\u063a\u0627\u0645\u0627\u062a \u0645\u06cc\u06ba \u062a\u0628\u062f\u06cc\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<p>\u0622\u062e\u0631 \u0645\u06cc\u06ba\u060c \u06c1\u0645 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u0646\u0627\u06a9\u0627\u0645\u06cc \u06a9\u06cc \u0648\u0636\u0627\u062d\u062a \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u06cc\u06a9 \u0641\u0646\u06a9\u0634\u0646 \u0634\u0627\u0645\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<pre><code class=\"language-ts\">\/** Turns the DOMExceptions these APIs throw into messages a user can act on. *\/\nexport function describeError(error: unknown): string {\n  if (error instanceof DOMException) {\n    switch (error.name) {\n      case \"NotAllowedError\":\n        return \"Chrome needs a fresh click to start the download. Press Translate again.\";\n      case \"NotSupportedError\":\n        \/\/ Also thrown on a brand-new Chrome profile while it is still fetching its components.\n        return \"Chrome couldn't prepare this translation. If this is your first use, wait a moment and try again. Otherwise, this language may not be supported on your device.\";\n      case \"QuotaExceededError\":\n        return \"That text is too long. Try translating a shorter passage.\";\n      case \"NetworkError\":\n        return \"The language pack couldn't be downloaded. Check your connection and try again.\";\n    }\n  }\n  return error instanceof Error ? error.message : \"Something went wrong.\";\n}\n<\/code><\/pre>\n<p>\u0628\u0644\u0679 \u0627\u0646 AI API \u0627\u0679\u06be\u0627 \u06a9\u0631 \u0645\u0633\u0627\u0626\u0644 \u06a9\u06cc \u0627\u0637\u0644\u0627\u0639 \u062f\u06cc\u062a\u0627 \u06c1\u06d2: <code>DOMException<\/code>\u0627\u0648\u0631 \u0627\u0633\u062a\u062b\u0646\u0627\u0621 \u06c1\u06d2\u06d4 <code>name<\/code> \u0628\u0648\u0644\u0648 \u06a9\u06cc\u0627 \u063a\u0644\u0637 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u0641\u06cc\u0686\u0631 \u06c1\u0631 \u0646\u0627\u0645 \u06a9\u0648 \u0627\u06cc\u06a9 \u067e\u06cc\u063a\u0627\u0645 \u0645\u06cc\u06ba \u0646\u0642\u0634 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0633 \u067e\u0631 \u0644\u0648\u06af \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li><code>NotAllowedError<\/code>: \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u0634\u0631\u0648\u0639 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u0631\u0648\u0645 \u06a9\u0648 \u0635\u0627\u0631\u0641 \u06a9\u06cc \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u062a\u06be\u06cc\u060c \u062c\u06cc\u0633\u0627 \u06a9\u06c1 \u06a9\u0644\u06a9\u060c \u0644\u06cc\u06a9\u0646 \u0627\u0633\u06d2 \u062d\u0627\u0635\u0644 \u0646\u06c1\u06cc\u06ba \u06c1\u0648\u0627\u06d4 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u062f\u0648\u0628\u0627\u0631\u06c1 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u0646\u06d2 \u06a9\u0648 \u06a9\u06c1\u0646\u06d2 \u0633\u06d2 \u0645\u0633\u0626\u0644\u06c1 \u062d\u0644 \u06c1\u0648 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>NotSupportedError<\/code>: MDN \u0627\u0633\u06d2 \u0627\u06cc\u06a9 \u063a\u0644\u0637\u06cc \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0648 \u0627\u0633 \u0648\u0642\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2 \u062c\u0628 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06cc \u06af\u0626\u06cc \u0632\u0628\u0627\u0646 \u06a9\u06cc \u062d\u0645\u0627\u06cc\u062a \u0646\u06c1\u06cc\u06ba \u06a9\u06cc \u062c\u0627\u062a\u06cc \u06c1\u06d2\u06d4 \u0679\u06cc\u0633\u0679\u0646\u06af \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646\u060c \u0645\u06cc\u06ba \u0646\u06d2 \u0627\u067e\u0646\u06cc \u067e\u06c1\u0644\u06cc \u06a9\u0648\u0634\u0634 \u0645\u06cc\u06ba \u0646\u0626\u06d2 \u06a9\u0631\u0648\u0645 \u067e\u0631\u0648\u0641\u0627\u0626\u0644 \u0645\u06cc\u06ba \u06cc\u06c1 \u0641\u06cc\u0686\u0631 \u0628\u06be\u06cc \u062f\u06cc\u06a9\u06be\u0627 \u062c\u0628 \u06a9\u0631\u0648\u0645 \u0627\u0628\u06be\u06cc \u062a\u06a9 \u062c\u0632\u0648 \u06a9\u06cc \u062a\u06cc\u0627\u0631\u06cc \u06a9\u0631 \u0631\u06c1\u0627 \u062a\u06be\u0627\u06d4 \u0627\u06af\u0644\u06cc \u06a9\u0648\u0634\u0634 \u06a9\u0627\u0645\u06cc\u0627\u0628 \u0631\u06c1\u06cc\u06d4 \u067e\u06cc\u063a\u0627\u0645 \u062f\u0648\u0646\u0648\u06ba \u0635\u0648\u0631\u062a\u0648\u06ba \u06a9\u0627 \u0627\u062d\u0627\u0637\u06c1 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>QuotaExceededError<\/code>: MDN \u0627\u0633\u06d2 \u0627\u06cc\u06a9 \u063a\u0644\u0637\u06cc \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062c\u0648 \u0627\u0633 \u0648\u0642\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2 \u062c\u0628 \u0627\u0646 \u067e\u0679 \u062f\u0633\u062a\u06cc\u0627\u0628 \u06a9\u0648\u0679\u06c1 \u0633\u06d2 \u0628\u0691\u0627 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u0633 \u06a9\u0627 \u0645\u0637\u0644\u0628 \u06c1\u06d2 \u06a9\u06c1 \u0645\u062a\u0646 \u0628\u06c1\u062a \u0644\u0645\u0628\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>NetworkError<\/code>: \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u06a9\u0648 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u0646\u06c1\u06cc\u06ba \u06a9\u06cc\u0627 \u062c\u0627 \u0633\u06a9\u062a\u0627\u06d4<\/li>\n<\/ul>\n<p>\u0628\u0635\u0648\u0631\u062a \u062f\u06cc\u06af\u0631\u060c \u0641\u0646\u06a9\u0634\u0646 \u0639\u0627\u0645 \u0635\u0648\u0631\u062a \u0645\u06cc\u06ba \u0627\u067e\u0646\u06d2 \u06c1\u06cc \u063a\u0644\u0637\u06cc \u06a9\u06d2 \u067e\u06cc\u063a\u0627\u0645 \u067e\u0631 \u0648\u0627\u067e\u0633 \u0622\u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4 <code>Error<\/code>\u06cc\u0627 \u0628\u0627\u0642\u0627\u0639\u062f\u06c1 \u067e\u06cc\u063a\u0627\u0645 \u06a9\u06d2 \u0630\u0631\u06cc\u0639\u06d2\u06d4<\/p>\n<p>\u0622\u067e \u06a9\u0627 <code>lib\/chrome-ai.ts<\/code> \u0641\u0627\u0626\u0644 \u0627\u0628 \u0645\u06a9\u0645\u0644 \u06c1\u0648 \u06af\u0626\u06cc \u06c1\u06d2\u06d4 \u06c1\u0645 \u0627\u0646 \u0641\u0646\u06a9\u0634\u0646\u0632 \u06a9\u0648 \u0631\u06cc \u0627\u06cc\u06a9\u0679 \u06c1\u06a9\u0633 \u0645\u06cc\u06ba \u062f\u0631\u062c \u0630\u06cc\u0644 \u0633\u06cc\u06a9\u0634\u0646\u0632 \u0645\u06cc\u06ba \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06cc\u06ba \u06af\u06d2\u06d4<\/p>\n<h2 id=\"heading-how-to-build-the-translation-hook\">\u062a\u0631\u062c\u0645\u06c1 \u06c1\u06a9 \u0628\u0646\u0627\u0646\u06d2 \u06a9\u0627 \u0637\u0631\u06cc\u0642\u06c1<\/h2>\n<p>\u0628\u0646\u0627\u0646\u0627 <code>hooks\/use-translation.ts<\/code>. \u06cc\u06c1 \u067e\u0648\u0631\u06d2 \u0628\u06c1\u0627\u0624 (\u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2\u060c \u062a\u0635\u062f\u06cc\u0642\u060c \u062a\u0631\u062c\u0645\u06c1) \u06a9\u0648 \u0686\u0644\u0627\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0631\u062f \u0639\u0645\u0644 \u06a9\u06cc \u062d\u0627\u0644\u062a \u06a9\u0648 \u0628\u06d2 \u0646\u0642\u0627\u0628 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-ts\">\"use client\";\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { AUTO } from \"@\/lib\/languages\";\nimport {\n  CONFIDENCE_THRESHOLD,\n  LowConfidenceError,\n  describeError,\n  destroyAll,\n  detectLanguage,\n  getTranslator,\n  type Detection,\n} from \"@\/lib\/chrome-ai\";\n\nexport type Phase = \"idle\" | \"detecting\" | \"preparing\" | \"translating\";\n\nexport function useTranslation() {\n  const [phase, setPhase] = useState<phase>(\"idle\");\n  const [downloadProgress, setDownloadProgress] = useState<number null=\"\">(null);\n  const [output, setOutput] = useState(\"\");\n  const [detected, setDetected] = useState<detection null=\"\">(null);\n  const [error, setError] = useState<string null=\"\">(null);\n  const controllerRef = useRef<abortcontroller null=\"\">(null);\n\n  \/\/ Free the models when the component unmounts.\n  useEffect(() => {\n    return () => {\n      controllerRef.current?.abort();\n      void destroyAll();\n    };\n  }, []);\n\n  const translate = useCallback(async (text: string, source: string, target: string) => {\n    controllerRef.current?.abort();\n    const controller = new AbortController();\n    controllerRef.current = controller;\n    const { signal } = controller;\n\n    setError(null);\n    setOutput(\"\");\n    setDetected(null);\n    setDownloadProgress(null);\n\n    try {\n      let from = source;\n\n      if (source === AUTO) {\n        setPhase(\"detecting\");\n        const result = await detectLanguage(text, setDownloadProgress, signal);\n        if (!result || result.confidence < CONFIDENCE_THRESHOLD) throw new LowConfidenceError();\n        setDetected(result);\n        from = result.language;\n      }\n\n      if (from === target) {\n        throw new Error(\"The source and target languages are the same.\");\n      }\n\n      setPhase(\"preparing\");\n      setDownloadProgress(null);\n      const translator = await getTranslator(from, target, setDownloadProgress, signal);\n\n      setPhase(\"translating\");\n      setDownloadProgress(null);\n      \/\/ Streaming shows text as soon as it's ready, which feels faster for longer input.\n      const reader = translator.translateStreaming(text, { signal }).getReader();\n      for (;;) {\n        const { done, value } = await reader.read();\n        if (done) break;\n        setOutput((current) => current + value);\n      }\n    } catch (caught) {\n      if (!signal.aborted) setError(describeError(caught));\n    } finally {\n      if (controllerRef.current === controller) {\n        controllerRef.current = null;\n        setPhase(\"idle\");\n        setDownloadProgress(null);\n      }\n    }\n  }, []);\n\n  const cancel = useCallback(() => controllerRef.current?.abort(), []);\n\n  const reset = useCallback(() => {\n    setOutput(\"\");\n    setDetected(null);\n    setError(null);\n  }, []);\n\n  return { phase, downloadProgress, output, detected, error, translate, cancel, reset };\n}\n<\/abortcontroller><\/string><\/detection><\/number><\/phase><\/code><\/pre>\n<p>\u062c\u0628 \u0635\u0627\u0631\u0641 \u062a\u0631\u062c\u0645\u06c1 \u067e\u0631 \u06a9\u0644\u06a9 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u062a\u0648 \u062f\u0631\u062c \u0630\u06cc\u0644 \u06c1\u0648\u062a\u0627 \u06c1\u06d2:<\/p>\n<ol>\n<li><strong>\u0627\u067e\u0646\u06cc \u067e\u0631\u0648\u0627\u0632 \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646 \u06a9\u0686\u06be \u0628\u06be\u06cc \u0645\u0646\u0633\u0648\u062e \u06a9\u0631\u06cc\u06ba\u06d4<\/strong> \u0627\u0648\u0631 \u0627\u06cc\u06a9 \u0646\u06cc\u0627 \u0628\u0646\u0627\u0626\u06cc\u06ba <code>AbortController<\/code>. \u06a9\u06c1 <code>signal<\/code> \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u06cc\u06c1 \u062a\u0645\u0627\u0645 \u06a9\u0627\u0644\u0648\u06ba \u0645\u06cc\u06ba \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4 <code>cancel()<\/code> \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u0627\u060c \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u0627 \u0627\u0648\u0631 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u0646\u0627 \u0628\u0646\u062f \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li><strong>\u0627\u06af\u0631 \u0636\u0631\u0648\u0631\u06cc \u06c1\u0648 \u062a\u0648 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0626\u06cc\u06ba.<\/strong> \u0627\u06af\u0631 \u0630\u0631\u06cc\u0639\u06c1 &quot;Language Detection&#8221; \u06c1\u0648 \u062a\u0648 \u06a9\u06c1\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4 <code>detectLanguage()<\/code>. \u0627\u06af\u0631 \u0646\u062a\u06cc\u062c\u06c1 \u06c1\u06d2: <code>null<\/code> \u06cc\u0627 \u0627\u06af\u0631 \u06cc\u06c1 \u0627\u0639\u062a\u0645\u0627\u062f \u06a9\u06cc \u062d\u062f \u0633\u06d2 \u0646\u06cc\u0686\u06d2 \u06c1\u06d2\u06d4 <code>LowConfidenceError<\/code>\u0635\u0627\u0631\u0641\u06cc\u0646 \u062f\u06cc\u06a9\u06be\u06cc\u06ba \u06af\u06d2 \u06a9\u06c1 &#8216;\u0628\u0631\u0627\u06c1 \u06a9\u0631\u0645 \u0627\u067e\u0646\u06cc \u0645\u0627\u062e\u0630 \u0632\u0628\u0627\u0646 \u06a9\u0648 \u062f\u0633\u062a\u06cc \u0637\u0648\u0631 \u067e\u0631 \u0645\u0646\u062a\u062e\u0628 \u06a9\u0631\u06cc\u06ba\u06d4&#8217;<\/li>\n<li><strong>\u062a\u0648\u062b\u06cc\u0642 \u06a9\u0631\u06cc\u06ba\u06d4<\/strong> \u062e\u0648\u062f \u0632\u0628\u0627\u0646 \u06a9\u0627 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u0646\u06d2 \u06a9\u0627 \u06a9\u0648\u0626\u06cc \u0641\u0627\u0626\u062f\u06c1 \u0646\u06c1\u06cc\u06ba\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u06c1\u0645 \u0627\u06cc\u06a9 \u0648\u0627\u0636\u062d \u067e\u06cc\u063a\u0627\u0645 \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0628\u0627\u062a \u062e\u062a\u0645 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li><strong>\u0627\u067e\u0646\u0627 \u0645\u062a\u0631\u062c\u0645 \u062a\u06cc\u0627\u0631 \u0631\u06a9\u06be\u06cc\u06ba\u06d4<\/strong> \u06cc\u06c1 \u0648\u06c1 \u0645\u0631\u062d\u0644\u06c1 \u06c1\u06d2 \u062c\u06c1\u0627\u06ba \u0622\u067e \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 <code>downloadProgress<\/code> \u067e\u0631\u0648\u06af\u0631\u06cc\u0633 \u0628\u0627\u0631 \u06a9\u0648 \u0627\u067e \u0688\u06cc\u0679 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0633\u0644\u0633\u0644\u06c1 \u0628\u0646\u062f\u06cc \u06a9\u06d2 \u0630\u0631\u06cc\u0639\u06d2 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4<\/strong> \u06c1\u0645 \u06c1\u06cc\u06ba <code>translateStreaming()<\/code> \u06c1\u0631 \u062d\u0635\u06c1 \u06a9\u0648 \u0622\u0624\u0679 \u067e\u0679 \u0645\u06cc\u06ba \u062c\u0648\u0691\u062a\u0627 \u06c1\u06d2\u06d4 \u0686\u0627\u0631 \u062c\u0645\u0644\u0648\u06ba \u06a9\u06d2 \u0679\u06cc\u0633\u0679 \u0645\u06cc\u06ba\u060c \u06a9\u0631\u0648\u0645 \u0646\u06d2 \u0641\u06cc \u062c\u0645\u0644\u06c1 \u0627\u06cc\u06a9 \u062d\u0635\u06c1 \u0648\u0627\u067e\u0633 \u06a9\u06cc\u0627\u06d4 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0645\u06cc\u06ba\u060c \u0637\u0648\u06cc\u0644 \u0645\u062a\u0646 \u06a9\u0648 \u0633\u0679\u0631\u06cc\u0645 \u06a9\u0631\u0646\u0627 \u0627\u0686\u06be\u0627 \u062e\u06cc\u0627\u0644 \u06c1\u06d2\u06d4 \u0645\u062e\u062a\u0635\u0631 \u062c\u0645\u0644\u0648\u06ba \u06a9\u06d2 \u0644\u06cc\u06d2\u060c \u0622\u067e \u06a9\u0648 \u0627\u06cc\u06a9 \u062d\u0635\u06c1 \u0645\u0644\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 \u06cc\u06c1 \u0627\u0633\u06cc \u0637\u0631\u062d \u0628\u0631\u062a\u0627\u0624 \u06a9\u0631\u062a\u0627 \u06c1\u06d2: <code>translate()<\/code>.<\/li>\n<\/ol>\n<p>\u06c1\u0645 \u0627\u0633 \u0633\u0644\u0633\u0644\u06d2 \u06a9\u0648 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u0648\u0626\u06d2 \u067e\u0691\u06be\u062a\u06d2 \u06c1\u06cc\u06ba: <code>getReader()<\/code> \u0627\u0633 \u06a9\u06d2 \u0628\u062c\u0627\u0626\u06d2 <code>for await<\/code>. <code>for await<\/code> \u0645\u0632\u06cc\u062f <code>ReadableStream<\/code> \u0636\u0631\u0648\u0631\u062a <code>dom.asynciterable<\/code> \u0679\u0627\u0626\u067e \u0627\u0633\u06a9\u0631\u067e\u0679 \u0644\u0627\u0626\u0628\u0631\u06cc\u0631\u06cc \u0627\u0648\u0631 <code>getReader()<\/code> \u06a9\u06c1\u06cc\u06ba \u0628\u06be\u06cc \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u06a9\u06c1 <code>finally<\/code> \u0628\u0644\u0627\u06a9 \u0635\u0631\u0641 UI \u06a9\u0648 \u062f\u0648\u0628\u0627\u0631\u06c1 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06d2 \u06af\u0627 \u0627\u06af\u0631 \u06cc\u06c1 \u06a9\u0627\u0644 \u0627\u0628 \u0628\u06be\u06cc \u0645\u0648\u062c\u0648\u062f\u06c1 \u06a9\u0627\u0644 \u06c1\u06d2\u06d4 \u0627\u0633 \u062a\u0635\u062f\u06cc\u0642 \u06a9\u06d2 \u0628\u063a\u06cc\u0631\u060c \u0645\u0646\u0633\u0648\u062e \u0634\u062f\u06c1 \u067e\u0686\u06be\u0644\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0646\u0626\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06cc \u062d\u06cc\u062b\u06cc\u062a \u06a9\u0648 \u062f\u0648\u0628\u0627\u0631\u06c1 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06d2 \u0633\u06a9\u062a\u06cc \u06c1\u06d2\u06d4<\/p>\n<p>\u06a9\u06c1 <code>useEffect<\/code> \u06a9\u0644\u06cc\u0646 \u0627\u067e \u0632\u06cc\u0631 \u0627\u0644\u062a\u0648\u0627\u0621 \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc\u0648\u06ba \u0627\u0648\u0631 \u06a9\u0627\u0644\u0648\u06ba \u06a9\u0648 \u0631\u0648\u06a9\u062a\u0627 \u06c1\u06d2\u06d4 <code>destroyAll()<\/code> \u062c\u0628 \u062c\u0632\u0648 \u0627\u0646 \u0645\u0627\u0624\u0646\u0679 \u06c1\u0648\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0645\u0627\u0688\u0644 \u062c\u0627\u0631\u06cc \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-how-to-build-the-interface\">\u0627\u0646\u0679\u0631\u0641\u06cc\u0633 \u0628\u0646\u0627\u0646\u06d2 \u06a9\u0627 \u0637\u0631\u06cc\u0642\u06c1<\/h2>\n<h3 id=\"heading-handling-server-rendering-safely\">\u0633\u0631\u0648\u0631 \u0631\u06cc\u0646\u0688\u0631\u0646\u06af \u06a9\u0648 \u0645\u062d\u0641\u0648\u0638 \u0637\u0631\u06cc\u0642\u06d2 \u0633\u06d2 \u06c1\u06cc\u0646\u0688\u0644 \u06a9\u0631\u0646\u0627<\/h3>\n<p>\u0628\u0646\u0627\u0646\u0627 <code>components\/translator-app.tsx<\/code>. \u067e\u06c1\u0644\u0627 \u0641\u06cc\u0635\u0644\u06c1 \u06cc\u06c1 \u06c1\u06d2 \u06a9\u06c1 \u0622\u067e \u06a9\u06d2 \u0633\u0631\u0648\u0631 \u06a9\u06cc \u0637\u0631\u0641 \u0633\u06d2 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062f\u06c1 \u0627\u06cc\u067e \u06a9\u06d2 \u0644\u06cc\u06d2 \u0628\u0631\u0627\u0624\u0632\u0631 \u0633\u067e\u0648\u0631\u0679 \u06a9\u0648 \u06a9\u06cc\u0633\u06d2 \u0686\u06cc\u06a9 \u06a9\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4<\/p>\n<p>\u0622\u067e \u06a9\u0627\u0644 \u0646\u06c1\u06cc\u06ba \u06a9\u0631 \u0633\u06a9\u062a\u06d2 <code>isBuiltInAISupported()<\/code> \u0631\u06cc\u0646\u0688\u0631\u0646\u06af\u06d4 \u0633\u0631\u0648\u0631 \u062c\u0648\u0627\u0628 \u062f\u06d2 \u06af\u0627 <code>false<\/code>\u0628\u0631\u0627\u0624\u0632\u0631 \u062c\u0648\u0627\u0628 \u062f\u06cc\u062a\u0627 \u06c1\u06d2\u06d4 <code>true<\/code>\u0631\u06cc \u0627\u06cc\u06a9\u0679 \u0631\u067e\u0648\u0631\u0679\u0633 \u06a9\u06cc \u0627\u0634\u0627\u0631\u06d2 \u06a9\u06cc \u0632\u0628\u0627\u0646 \u0645\u06cc\u06ba \u062a\u0636\u0627\u062f\u06d4 <code>useSyncExternalStore<\/code> \u06cc\u06c1 \u0633\u0631\u0648\u0631\u0632 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u0644\u06af \u0627\u0644\u06af \u0633\u0646\u06cc\u067e \u0634\u0627\u0679\u0633 \u0644\u06d2 \u06a9\u0631 \u0635\u0641\u0627\u0626\u06cc \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0627\u0633 \u0645\u0633\u0626\u0644\u06d2 \u06a9\u0648 \u062d\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-tsx\">const supported = useSyncExternalStore<boolean null=\"\">(\n  noopSubscribe,\n  isBuiltInAISupported, \/\/ client snapshot\n  () => null,           \/\/ server snapshot\n);\n<\/boolean><\/code><\/pre>\n<p>\u0633\u0631\u0648\u0631 \u0627\u0648\u0631 \u067e\u06c1\u0644\u06cc \u06a9\u0644\u0627\u0626\u0646\u0679 \u0631\u06cc\u0646\u0688\u0631\u0646\u06af \u062f\u0648\u0646\u0648\u06ba \u06a9\u0627 \u062d\u0648\u0627\u0644\u06c1 \u062f\u06cc\u062a\u06d2 \u06c1\u06cc\u06ba: <code>null<\/code>\u062a\u0648 \u06cc\u06c1 \u0645\u06cc\u0644 \u06a9\u06be\u0627\u062a\u0627 \u06c1\u06d2\u06d4 \u062c\u0648\u0627\u0628 \u062f\u06cc\u06ba \u067e\u06be\u0631 \u06a9\u0644\u0627\u0626\u0646\u0679 \u06a9\u06d2 \u0627\u0635\u0644 \u062c\u0648\u0627\u0628 \u067e\u0631 \u0633\u0648\u0626\u0686 \u06a9\u0631\u06cc\u06ba\u06d4 \u0627\u06cc\u067e \u062f\u06a9\u06be\u0627\u062a\u06cc \u06c1\u06d2 &quot;\u0628\u0631\u0627\u0624\u0632\u0631 \u0633\u067e\u0648\u0631\u0679 \u06a9\u06cc \u062c\u0627\u0646\u0686 \u06a9\u0631 \u0631\u06c1\u0627 \u06c1\u06d2&#8230;&#8221; <code>null<\/code>\u06a9\u06d2 \u0628\u0627\u0631\u06d2 \u0645\u06cc\u06ba \u0646\u0648\u0679\u0633 <code>false<\/code>\u0627\u0648\u0631 \u0645\u062a\u0631\u062c\u0645 <code>true<\/code>. \u0635\u0641\u062d\u06c1 \u06a9\u06be\u0644\u06d2 \u0631\u06c1\u0646\u06d2 \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646 \u06a9\u0633\u06cc \u0628\u06be\u06cc \u0686\u06cc\u0632 \u06a9\u0648 \u0633\u0628\u0633\u06a9\u0631\u0627\u0626\u0628 \u0646\u06c1\u06cc\u06ba \u06a9\u06cc\u0627 \u06af\u06cc\u0627 \u06c1\u06d2 \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u0628\u0631\u0627\u0624\u0632\u0631 \u0633\u067e\u0648\u0631\u0679 \u062a\u0628\u062f\u06cc\u0644 \u0646\u06c1\u06cc\u06ba \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4 <code>noopSubscribe<\/code> \u06a9\u0686\u06be \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627\u06d4<\/p>\n<h3 id=\"heading-the-unsupported-notice\">\u0627\u0637\u0644\u0627\u0639 \u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/h3>\n<p>API \u06a9\u06d2 \u0628\u063a\u06cc\u0631 \u0628\u0631\u0627\u0624\u0632\u0631 \u0679\u0648\u0679\u06d2 \u06c1\u0648\u0626\u06d2 \u0641\u0627\u0631\u0645\u06cc\u0679\u0646\u06af \u06a9\u06d2 \u0628\u062c\u0627\u0626\u06d2 \u0648\u0627\u0636\u062d \u0648\u0636\u0627\u062d\u062a \u062d\u0627\u0635\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u0628\u0646\u0627\u0646\u0627 <code>components\/unsupported-notice.tsx<\/code>:<\/p>\n<pre><code class=\"language-tsx\">export function UnsupportedNotice() {\n  return (\n    <div classname=\"notice\" role=\"alert\">\n      <h2>This browser doesn't support Chrome's built-in translation<\/h2>\n      <p>\n        The Translator and Language Detector APIs are available in Chrome on desktop (version 138\n        or later). They aren't available on mobile, Firefox or Safari.\n      <\/p>\n      <p>\n        Open this page in desktop Chrome, or read about the APIs in the{\" \"}\n        Chrome documentation.\n      <\/p>\n    <\/div>\n  );\n}\n<\/code><\/pre>\n<h3 id=\"heading-the-language-selector\">\u0632\u0628\u0627\u0646 \u06a9\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u0646\u062f\u06c1<\/h3>\n<p>\u0628\u0646\u0627\u0646\u0627 <code>components\/language-select.tsx<\/code>. \u0648\u0627\u0642\u0639\u06cc <code><label\/><\/code> \u0633\u06d2 \u0645\u0646\u0633\u0644\u06a9 \u06c1\u06d2 <code>htmlFor<\/code> \u06a9\u0646\u0679\u0631\u0648\u0644\u0632 \u06a9\u0648 \u0642\u0627\u0628\u0644 \u0631\u0633\u0627\u0626\u06cc \u0628\u0646\u0627\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0627\u0646\u06c1\u06cc\u06ba \u06a9\u0644\u06a9 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0642\u0627\u0628\u0644 \u0628\u0646\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-tsx\">import { AUTO, LANGUAGES } from \"@\/lib\/languages\";\n\ninterface Props {\n  id: string;\n  label: string;\n  value: string;\n  onChange: (code: string) => void;\n  \/** Adds a \"Detect language\" option (source selector only). *\/\n  allowAuto?: boolean;\n}\n\nexport function LanguageSelect({ id, label, value, onChange, allowAuto }: Props) {\n  return (\n    <p>\n      <label htmlfor=\"{id}\">{label}<\/label>\n      <select id=\"{id}\" value=\"{value}\" onchange=\"{(event)\"> onChange(event.target.value)}>\n        {allowAuto && <option value=\"{AUTO}\">Detect language<\/option>}\n        {LANGUAGES.map((language) => (\n          <option key=\"{language.code}\" value=\"{language.code}\">\n            {language.name}\n          <\/option>\n        ))}\n      <\/select>\n    <\/p>\n  );\n}\n<\/code><\/pre>\n<h3 id=\"heading-the-text-panel\">\u0679\u06cc\u06a9\u0633\u0679 \u067e\u06cc\u0646\u0644<\/h3>\n<p>\u0628\u0646\u0627\u0646\u0627 <code>components\/text-panel.tsx<\/code>. \u0627\u06cc\u06a9 \u062c\u0632\u0648 \u0627\u0646 \u067e\u0679 \u0627\u0648\u0631 \u0622\u0624\u0679 \u067e\u0679 \u062f\u0648\u0646\u0648\u06ba \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u0633 \u0645\u06cc\u06ba \u0622\u067e \u06a9\u06d2 \u0688\u06cc\u0632\u0627\u0626\u0646 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u0627\u067e\u06cc \u0627\u0648\u0631 \u0631\u06cc\u0688 \u0622\u0624\u0679 \u0644\u0627\u0624\u0688 \u0628\u0679\u0646 \u0634\u0627\u0645\u0644 \u06c1\u06cc\u06ba\u06d4<\/p>\n<pre><code class=\"language-tsx\">\"use client\";\n\nimport { useState } from \"react\";\n\ninterface Props {\n  id: string;\n  label: string;\n  value: string;\n  \/** BCP 47 code of the text, so screen readers and speech use the right voice. *\/\n  lang?: string;\n  rtl?: boolean;\n  readOnly?: boolean;\n  placeholder?: string;\n  onChange?: (value: string) => void;\n}\n\nexport function TextPanel({ id, label, value, lang, rtl, readOnly, placeholder, onChange }: Props) {\n  const [copied, setCopied] = useState(false);\n\n  async function copy() {\n    await navigator.clipboard.writeText(value);\n    setCopied(true);\n    setTimeout(() => setCopied(false), 1500);\n  }\n\n  function speak() {\n    \/\/ The Web Speech API is separate from the built-in AI APIs, and works in most browsers.\n    speechSynthesis.cancel();\n    const utterance = new SpeechSynthesisUtterance(value);\n    if (lang) utterance.lang = lang;\n    speechSynthesis.speak(utterance);\n  }\n\n  return (\n    <div classname=\"field\">\n      <label htmlfor=\"{id}\" classname=\"visually-hidden\">\n        {label}\n      <\/label>\n      <textarea id=\"{id}\" rows=\"{6}\" value=\"{value}\" lang=\"{lang}\" dir=\"auto\" lets=\"\" the=\"\" browser=\"\" choose=\"\" direction=\"\" of=\"\" whatever=\"\" user=\"\" types.=\"\" :=\"\" readonly=\"{readOnly}\" placeholder=\"{placeholder}\" onchange=\"{(event)\"> onChange?.(event.target.value)}\n      \/>\n      <p>\n        <button type=\"button\" classname=\"icon\" onclick=\"{copy}\" disabled=\"{!value}\" aria-label=\"{`Copy\">\n          {copied ? \"\u2713\" : \"\u29c9\"}\n        <\/button>\n        <button type=\"button\" classname=\"icon\" onclick=\"{speak}\" disabled=\"{!value}\" aria-label=\"{`Read\" aloud=\"\">\n          &#x1f50a;\n        <\/button>\n      <\/p>\n    <\/textarea><\/div>\n  );\n}\n<\/code><\/pre>\n<p>\u06a9\u0686\u06be \u062a\u0641\u0635\u06cc\u0644\u0627\u062a:<\/p>\n<ul>\n<li><strong>\u06a9\u0627\u067e\u06cc<\/strong> \u06a9\u0644\u067e \u0628\u0648\u0631\u0688 API \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0628\u0644\u0646\u062f \u0622\u0648\u0627\u0632 \u0633\u06d2 \u067e\u0691\u06be\u06cc\u06ba<\/strong> \u0648\u06cc\u0628 \u0627\u0633\u067e\u06cc\u0686 API \u06a9\u0627 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 <code>speechSynthesis<\/code>. \u06cc\u06c1 \u0628\u0644\u0679 \u0627\u0646 AI API \u0633\u06d2 \u0627\u0644\u06af \u0628\u0631\u0627\u0624\u0632\u0631 \u06a9\u06cc \u062e\u0635\u0648\u0635\u06cc\u062a \u06c1\u06d2 \u0627\u0648\u0631 \u0632\u06cc\u0627\u062f\u06c1 \u062a\u0631 \u0628\u0631\u0627\u0624\u0632\u0631\u0632 \u0645\u06cc\u06ba \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06cc \u06c1\u06d2\u06d4 \u06c1\u0645 \u0646\u06d2 \u0645\u0642\u0631\u0631 \u06a9\u06cc\u0627 <code>utterance.lang<\/code> \u0644\u06c1\u0630\u0627 \u0628\u0631\u0627\u0624\u0632\u0631 \u0645\u0645\u0627\u062b\u0644 \u0622\u0648\u0627\u0632 \u06a9\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><code>dir=\"auto\"<\/code>    \u062c\u06cc\u0633\u0627 \u06a9\u06c1 \u0622\u067e \u0679\u0627\u0626\u067e \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u0628\u0631\u0627\u0624\u0632\u0631 \u0622\u067e \u06a9\u06d2 \u0679\u0627\u0626\u067e \u06a9\u0631\u062f\u06c1 \u06a9\u0633\u06cc \u0628\u06be\u06cc \u0645\u062a\u0646 \u06a9\u06cc \u0633\u0645\u062a \u06a9\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0631\u0633\u06a9\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 \u0639\u0631\u0628\u06cc \u0627\u0646 \u067e\u0679 \u0628\u063a\u06cc\u0631 \u06a9\u0633\u06cc \u0627\u0636\u0627\u0641\u06cc \u0645\u0646\u0637\u0642 \u06a9\u06d2 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u0622\u0624\u0679 \u067e\u0679 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2: <code>lang<\/code> \u0627\u0648\u0631 <code>dir<\/code> \u0644\u06c1\u0630\u0627 \u0627\u0633\u06a9\u0631\u06cc\u0646 \u0631\u06cc\u0688\u0631 \u0627\u0633 \u06a9\u0627 \u0635\u062d\u06cc\u062d \u062a\u0644\u0641\u0638 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 RTL \u0627\u0633\u06a9\u0631\u067e\u0679 \u0635\u062d\u06cc\u062d \u0637\u0631\u06cc\u0642\u06d2 \u0633\u06d2 \u067e\u06cc\u0634 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u062f\u0648\u0646\u0648\u06ba \u0628\u0679\u0646 <code>aria-label<\/code>s\u060c \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u0645\u0631\u0626\u06cc \u0645\u0648\u0627\u062f \u0635\u0631\u0641 \u0627\u06cc\u06a9 \u0622\u0626\u06cc\u06a9\u0646 \u06c1\u06d2\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-putting-it-together\">\u062e\u0644\u0627\u0635\u06c1 \u06cc\u06c1 \u06a9\u06c1<\/h3>\n<p>\u0627\u06c1\u0645 \u0627\u062c\u0632\u0627\u0621 \u06c1\u06cc\u06ba:<\/p>\n<pre><code class=\"language-tsx\">\"use client\";\n\nimport { useState, useSyncExternalStore } from \"react\";\nimport { useTranslation } from \"@\/hooks\/use-translation\";\nimport { isBuiltInAISupported } from \"@\/lib\/chrome-ai\";\nimport { AUTO, isRtl, languageName } from \"@\/lib\/languages\";\nimport { LanguageSelect } from \".\/language-select\";\nimport { TextPanel } from \".\/text-panel\";\nimport { UnsupportedNotice } from \".\/unsupported-notice\";\n\nconst noopSubscribe = () => () => {};\n\nexport function TranslatorApp() {\n  \/\/ `null` on the server and during hydration, then the real answer on the client.\n  \/\/ This avoids a hydration mismatch, because the server can't know what the browser supports.\n  const supported = useSyncExternalStore<boolean null=\"\">(\n    noopSubscribe,\n    isBuiltInAISupported,\n    () => null,\n  );\n\n  const { phase, downloadProgress, output, detected, error, translate, cancel, reset } =\n    useTranslation();\n\n  const [source, setSource] = useState(AUTO);\n  const [target, setTarget] = useState(\"es\");\n  const [text, setText] = useState(\"\");\n\n  if (supported === null) return <p classname=\"status\">Checking browser support\u2026<\/p>;\n  if (!supported) return <unsupportednotice\/>;\n\n  const busy = phase !== \"idle\";\n  const sourceLang = source === AUTO ? detected?.language : source;\n\n  const statusMessage = (() => {\n    if (error) return error;\n    if (phase === \"detecting\") return \"Detecting language\u2026\";\n    if (phase === \"preparing\") return \"Preparing the translator\u2026\";\n    if (phase === \"translating\") return \"Translating\u2026\";\n    if (detected && source === AUTO) {\n      return `Detected ${languageName(detected.language)} (${Math.round(detected.confidence * 100)}% confidence).`;\n    }\n    return \"\";\n  })();\n\n  function swap() {\n    if (!sourceLang) return;\n    setSource(target);\n    setTarget(sourceLang);\n    setText(output);\n    reset();\n  }\n\n  return (\n    <form onsubmit=\"{(event)\"> {\n        event.preventDefault();\n        \/\/ This runs inside a click handler, so Chrome sees \"user activation\".\n        \/\/ That's required before it will download a model.\n        void translate(text.trim(), source, target);\n      }}\n    >\n      <div classname=\"grid\">\n        <p>\n          <languageselect id=\"source-language\" label=\"From\" value=\"{source}\" onchange=\"{(code)\"> {\n              setSource(code);\n              reset();\n            }}\n            allowAuto\n          \/>\n          <textpanel id=\"source-text\" label=\"Source text\" value=\"{text}\" lang=\"{sourceLang}\" placeholder=\"Type or paste text\u2026\" onchange=\"{setText}\"\/>\n        <\/languageselect><\/p>\n\n        <button type=\"button\" classname=\"swap\" onclick=\"{swap}\" disabled=\"{busy\" aria-label=\"Swap languages\" title=\"Swap languages\">\n          \u21c4\n        <\/button>\n\n        \n      <\/div>\n\n      <p>\n        {busy ? (\n          <button type=\"button\" classname=\"secondary\" onclick=\"{cancel}\">\n            Cancel\n          <\/button>\n        ) : (\n          <button type=\"submit\" disabled=\"{!text.trim()}\">\n            Translate\n          <\/button>\n        )}\n      <\/p>\n\n      {downloadProgress !== null && (\n        <label classname=\"progress\">\n          Downloading language pack\u2026 {Math.round(downloadProgress * 100)}%\n          <progress max=\"{1}\" value=\"{downloadProgress}\"\/>\n        <\/label>\n      )}\n\n      {\/* A live region announces status changes and errors to screen readers. *\/}\n      <p role=\"status\" aria-live=\"polite\" classname=\"{error\" error=\"\" :=\"\">\n        {statusMessage}\n      <\/p>\n    <\/form>\n  );\n}\n<\/boolean><\/code><\/pre>\n<p>\u0686\u0646\u062f \u062a\u0641\u0635\u06cc\u0644\u0627\u062a \u0642\u0627\u0628\u0644 \u062a\u0648\u062c\u06c1 \u06c1\u06cc\u06ba\u06d4<\/p>\n<p>\u0627\u0633\u0679\u0627\u0626\u0644\u0627\u0626\u0632\u0688 <code>onSubmit<\/code> \u06a9\u0627\u0644 \u06c1\u06cc\u0646\u0688\u0644\u0631 <code>translate()<\/code>. \u0686\u0648\u0646\u06a9\u06c1 \u06cc\u06c1 \u0641\u0627\u0631\u0645 \u062c\u0645\u0639 \u06a9\u0631\u0627\u0646\u06d2 \u0648\u0627\u0644\u06d2 \u06a9\u0644\u06a9 \u06a9\u06d2 \u0627\u0646\u062f\u0631 \u0686\u0644\u062a\u0627 \u06c1\u06d2\u060c \u06a9\u0631\u0648\u0645 \u0635\u0627\u0631\u0641 \u06a9\u06cc \u0627\u06cc\u06a9\u0679\u06cc\u0648\u06cc\u0634\u0646 \u06a9\u06cc \u062a\u0635\u062f\u06cc\u0642 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u06a9\u0631\u0648\u0645 \u06a9\u0648 \u0645\u0627\u0688\u0644 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u0646\u0627 \u0634\u0631\u0648\u0639 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0627\u062c\u0627\u0632\u062a \u062f\u06d2 \u06af\u0627\u06d4 \u06a9\u0627\u0644 \u06a9\u0631\u0646\u0627 <code>Translator.create()<\/code> \u067e\u0631 <code>useEffect<\/code> \u0635\u0641\u062d\u06c1 \u0644\u0648\u0688 \u06c1\u0648\u0646\u06d2 \u067e\u0631 \u0635\u0627\u0631\u0641 \u06a9\u06cc \u06a9\u0648\u0626\u06cc \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u0646\u06c1\u06cc\u06ba \u06c1\u0648\u062a\u06cc\u06d4<\/p>\n<p>\u0633\u0648\u06cc\u067e \u0628\u0679\u0646 \u062f\u0648\u0646\u0648\u06ba \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u0648 \u062a\u0628\u062f\u06cc\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u062a\u0631\u062c\u0645\u06d2 \u06a9\u0648 \u0627\u0646 \u067e\u0679 \u0628\u0627\u06a9\u0633 \u0645\u06cc\u06ba \u0645\u0646\u062a\u0642\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u06af\u0631 \u0630\u0631\u06cc\u0639\u06c1 &quot;Language Detection&#8221; \u06c1\u06d2\u060c \u062a\u0648 \u06cc\u06c1 \u067e\u062a\u06c1 \u0686\u0644\u0646\u06d2 \u0648\u0627\u0644\u06cc \u0632\u0628\u0627\u0646 \u06a9\u0627 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06d2 \u06af\u0627 \u0627\u0648\u0631 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u0645\u0648\u062c\u0648\u062f \u06c1\u0648\u0646\u06d2 \u062a\u06a9 \u0627\u0633\u06d2 \u063a\u06cc\u0631 \u0641\u0639\u0627\u0644 \u06a9\u0631 \u062f\u06cc\u0627 \u062c\u0627\u0626\u06d2 \u06af\u0627\u06d4<\/p>\n<p>\u0627\u0633\u0679\u06cc\u0679\u0633 \u0628\u0627\u0631 \u0627\u0633 \u0637\u0631\u062d \u062f\u06a9\u06be\u062a\u0627 \u06c1\u06d2: <code\/>. Screen readers announce messages like &quot;Translating\u2026&#8221;, the detection result, and errors without moving focus. The progress bar has a visible label.<\/p>\n<h3 id=\"heading-the-page-and-layout\">The page and layout<\/h3>\n<p>Finally, wire it into the app. <code>app\/page.tsx<\/code> \u0633\u0631\u0648\u0631 \u06a9\u0627 \u0627\u06cc\u06a9 \u062c\u0632\u0648 \u062c\u0648 \u06a9\u0644\u0627\u0626\u0646\u0679 \u06a9\u06d2 \u0627\u062c\u0632\u0627\u0621 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-tsx\">import { TranslatorApp } from \"@\/components\/translator-app\";\n\nexport default function Home() {\n  return (\n    <main>\n      \n      <p classname=\"lede\">\n        Text is detected and translated on your device by Chrome. It isn't sent to a\n        translation server.\n      <\/p>\n      <translatorapp\/>\n    <\/main>\n  );\n}\n<\/code><\/pre>\n<p>\u0627\u0648\u0631 <code>app\/layout.tsx<\/code>:<\/p>\n<pre><code class=\"language-tsx\">import type { Metadata } from \"next\";\nimport \".\/globals.css\";\n\nexport const metadata: Metadata = {\n  title: \"Translate with Chrome's built-in AI\",\n  description:\n    \"A Next.js app that translates text on-device using Chrome's Translator and Language Detector APIs.\",\n};\n\nexport default function RootLayout({\n  children,\n}: {\n  children: React.ReactNode;\n}) {\n  return (\n    \n      {children}\n    \n  );\n}\n<\/code><\/pre>\n<p>CSS API \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u062e\u0635\u0648\u0635 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u0645\u06cc\u06ba \u0627\u0633\u06d2 \u06cc\u06c1\u0627\u06ba \u062f\u0648\u0628\u0627\u0631\u06c1 \u067e\u06cc\u0634 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u0648\u06ba \u06af\u0627\u06d4 \u06a9\u0627\u067e\u06cc <code>app\/globals.css<\/code> \u0645\u062e\u0632\u0646 \u0633\u06d2\u06d4 \u0628\u0679\u0646\u0648\u06ba \u0627\u0648\u0631 \u067e\u0631\u0648\u06af\u0631\u06cc\u0633 \u0628\u0627\u0631 \u06a9\u0648 \u062f\u0648 \u06a9\u0627\u0644\u0645 \u0644\u06d2 \u0622\u0624\u0679 \u0645\u06cc\u06ba \u0627\u0633\u0679\u0627\u0626\u0644 \u06a9\u0631\u06cc\u06ba\u060c \u0686\u06be\u0648\u0679\u06cc \u0627\u0633\u06a9\u0631\u06cc\u0646\u0648\u06ba \u067e\u0631 \u0627\u06cc\u06a9 \u06a9\u0627\u0644\u0645 \u0645\u06cc\u06ba \u0633\u0645\u0679 \u06a9\u0631\u06d4<\/p>\n<p>\u0627\u067e\u0646\u06cc \u062d\u062f\u0648\u062f \u06a9\u06cc \u062c\u0627\u0646\u0686 \u06a9\u0631\u06cc\u06ba\u06d4 <code>app\/page.tsx<\/code> \u0627\u0648\u0631 <code>app\/layout.tsx<\/code> \u06cc\u06c1 \u0633\u0631\u0648\u0631 \u06a9\u0627 \u062c\u0632\u0648 \u06c1\u06d2\u060c <code>translator-app.tsx<\/code> \u0633\u06d2 \u0634\u0631\u0648\u0639 \u06a9\u0631\u06cc\u06ba\u06d4 <code>\"use client\"<\/code>\u062a\u0648 \u06cc\u06c1 \u0627\u0648\u0631 \u0627\u0633 \u06a9\u06cc \u06c1\u0631 \u0686\u06cc\u0632 \u0628\u0631\u0627\u0624\u0632\u0631 \u0645\u06cc\u06ba \u0686\u0644\u062a\u06cc \u06c1\u06d2\u06d4 \u06cc\u06c1 \u0627\u06cc\u06a9 \u067e\u0631\u06cc\u0645\u06cc\u0679\u0631 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u06cc\u06a9 \u0627\u0686\u06be\u06cc \u062c\u06af\u06c1 \u06c1\u06d2\u060c \u06a9\u06cc\u0648\u0646\u06a9\u06c1 \u06a9\u0631\u0648\u0645 \u06a9\u06d2 API \u06a9\u0648 \u0686\u06be\u0648\u0646\u06d2 \u0648\u0627\u0644\u06cc \u06a9\u0648\u0626\u06cc \u0628\u06be\u06cc \u0686\u06cc\u0632 \u06a9\u0644\u0627\u0626\u0646\u0679 \u067e\u0631 \u0686\u0644\u0646\u06cc \u0686\u0627\u06c1\u06cc\u06d2\u06d4<\/p>\n<h2 id=\"heading-how-to-run-and-test-the-app\">\u0627\u067e\u0646\u06cc \u0627\u06cc\u067e \u06a9\u0648 \u0686\u0644\u0627\u0646\u06d2 \u0627\u0648\u0631 \u062c\u0627\u0646\u0686\u0646\u06d2 \u06a9\u0627 \u0637\u0631\u06cc\u0642\u06c1<\/h2>\n<p>\u0688\u0648\u06cc\u0644\u067e\u0645\u0646\u0679 \u0633\u0631\u0648\u0631 \u0634\u0631\u0648\u0639 \u06a9\u0631\u06cc\u06ba \u0627\u0648\u0631 URL \u06a9\u06be\u0648\u0644\u06cc\u06ba\u06d4 <strong>\u0688\u06cc\u0633\u06a9 \u0679\u0627\u067e \u06a9\u0631\u0648\u0645<\/strong>:<\/p>\n<pre><code class=\"language-bash\">npm run dev\n<\/code><\/pre>\n<p>\u067e\u06be\u0631 \u062f\u0631\u062c \u0630\u06cc\u0644 \u0645\u0646\u0638\u0631 \u0646\u0627\u0645\u06d2 \u06a9\u0648 \u0622\u0632\u0645\u0627\u0626\u06cc\u06ba: \u06cc\u06c1 \u06c1\u06d2 \u062c\u0648 \u0645\u06cc\u06ba \u0646\u06d2 MacOS \u067e\u0631 \u06a9\u0631\u0648\u0645 156 \u0645\u06cc\u06ba \u062f\u06cc\u06a9\u06be\u0627:<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0645\u06cc\u06ba \u0646\u06d2 \u06a9\u06cc\u0627 \u06a9\u06cc\u0627<\/th>\n<th>\u06a9\u06cc\u0627 \u06c1\u0648 \u0631\u06c1\u0627 \u06c1\u06d2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>&quot;\u06cc\u06c1 \u0627\u06cc\u06a9 \u0622\u0632\u0645\u0627\u0626\u0634\u06cc \u062c\u0645\u0644\u06c1 \u06c1\u06d2\u060c&#8221; \u0645\u06cc\u06ba \u0646\u06d2 \u0679\u0627\u0626\u067e \u06a9\u06cc\u0627\u06d4 \u0630\u0631\u06cc\u0639\u06c1 \u0645\u0642\u0631\u0631 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0633\u0627\u062a\u06be <em>\u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u0627<\/em> \u0627\u0648\u0631 \u0645\u0642\u0635\u062f <em>\u06c1\u0633\u067e\u0627\u0646\u0648\u06cc<\/em><\/td>\n<td>&quot;\u0627\u0646\u06af\u0631\u06cc\u0632\u06cc (100% \u0627\u0639\u062a\u0645\u0627\u062f)&#8221; \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u06cc\u0627 \u0627\u0648\u0631 \u0627\u0633 \u06a9\u0627 \u062a\u0631\u062c\u0645\u06c1 &quot;\u06cc\u06c1 \u0627\u06cc\u06a9 \u0622\u0632\u0645\u0627\u0626\u0634\u06cc \u062c\u0645\u0644\u06c1 \u06c1\u06d2\u06d4&#8221;<\/td>\n<\/tr>\n<tr>\n<td>\u0622\u067e \u0646\u06d2 \u0627\u06cc\u06a9 \u0632\u0628\u0627\u0646 \u06a9\u0627 \u062c\u0648\u0691\u0627 \u0645\u0646\u062a\u062e\u0628 \u06a9\u06cc\u0627 \u06c1\u06d2 \u062c\u0648 \u0622\u067e \u0646\u06d2 \u067e\u06c1\u0644\u06d2 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u0646\u06c1\u06cc\u06ba \u06a9\u06cc\u0627 \u06c1\u06d2 (\u0627\u0646\u06af\u0631\u06cc\u0632\u06cc \u0633\u06d2 \u0641\u0631\u0627\u0646\u0633\u06cc\u0633\u06cc)<\/td>\n<td>\u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06c1\u0648\u062a\u06d2 \u06c1\u06cc \u0627\u06cc\u06a9 \u067e\u0631\u0648\u06af\u0631\u06cc\u0633 \u0628\u0627\u0631 \u0638\u0627\u06c1\u0631 \u06c1\u0648\u06af\u0627\u06d4 \u0645\u0646\u0633\u0644\u06a9 \u06c1\u0648\u0646\u06d2 \u0645\u06cc\u06ba \u062a\u0642\u0631\u06cc\u0628\u0627\u064b 15 \u0633\u06cc\u06a9\u0646\u0688 \u0644\u06af\u06cc\u06ba \u06af\u06d2 \u0627\u0648\u0631 \u062a\u0631\u062c\u0645\u06c1 \u0638\u0627\u06c1\u0631 \u06c1\u0648 \u062c\u0627\u0626\u06d2 \u06af\u0627\u06d4<\/td>\n<\/tr>\n<tr>\n<td>\u06c1\u0633\u067e\u0627\u0646\u0648\u06cc \u062c\u0645\u0644\u0648\u06ba \u06a9\u0627 \u0627\u0646\u06af\u0631\u06cc\u0632\u06cc \u0645\u06cc\u06ba \u062a\u0631\u062c\u0645\u06c1\u06d4<\/td>\n<td>&quot;\u06c1\u0633\u067e\u0627\u0646\u0648\u06cc (100% \u0642\u0627\u0628\u0644 \u0627\u0639\u062a\u0645\u0627\u062f)&#8221; \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u06cc\u0627 \u0627\u0648\u0631 \u0648\u0627\u067e\u0633 \u0622\u06cc\u0627 &quot;\u06c1\u06cc\u0644\u0648\u060c \u0622\u067e \u06a9\u0627 \u062f\u0646 \u06a9\u06cc\u0633\u0627 \u0631\u06c1\u0627\u061f \u0645\u062c\u06be\u06d2 \u0627\u0645\u06cc\u062f \u06c1\u06d2 \u06a9\u06c1 \u0633\u0628 \u06a9\u0686\u06be \u0679\u06be\u06cc\u06a9 \u062c\u0627 \u0631\u06c1\u0627 \u06c1\u06d2\u06d4&#8221;<\/td>\n<\/tr>\n<tr>\n<td>\u0622\u067e \u0646\u06d2 \u06c1\u0627\u0624\u0633\u0627 \u062c\u0645\u0644\u06c1 \u062f\u0631\u062c \u06a9\u06cc\u0627 \u06c1\u06d2\u06d4<\/td>\n<td>\u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u0646\u06d2 \u0627\u0633\u06d2 \u067e\u06c1\u0686\u0627\u0646 \u0644\u06cc\u0627 (<code>ha<\/code>)\u060c \u0645\u062a\u0631\u062c\u0645 \u0646\u06d2 \u0627\u0637\u0644\u0627\u0639 \u062f\u06cc \u06a9\u06c1 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u0646\u0627 \u0645\u0645\u06a9\u0646 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2: <code>ha<\/code> \u0627\u0646\u06af\u0631\u06cc\u0632\u06cc \u0645\u06cc\u06ba\u06d4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u06c1\u0627\u0624\u0633\u0627 \u06a9\u06d2 \u0646\u062a\u0627\u0626\u062c \u0627\u06cc\u06a9 \u0627\u0686\u06be\u0627 \u0633\u0628\u0642 \u06c1\u06cc\u06ba\u06d4 \u0632\u0628\u0627\u0646 <em>\u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2<\/em> \u0627\u0648\u0631 \u0632\u0628\u0627\u0646 <em>\u062a\u0631\u062c\u0645\u06c1<\/em> \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u0645\u062a\u0646\u0648\u0639 \u0633\u06cc\u0679 \u06a9\u0648 \u0633\u067e\u0648\u0631\u0679 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u06a9\u0631\u0648\u0645 \u06a9\u06d2 \u0645\u062a\u0631\u062c\u0645\u06cc\u0646 \u06a9\u06cc \u0641\u06c1\u0631\u0633\u062a \u0645\u06cc\u06ba \u06c1\u0627\u0624\u0633\u0627\u060c \u06cc\u0648\u0631\u0648\u0628\u0627\u060c \u06cc\u0627 \u0627\u06cc\u06af\u0628\u0648 \u0634\u0627\u0645\u0644 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 \u0627\u0646 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u0644\u06cc\u06d2 \u0622\u067e \u06a9\u0648 \u0627\u06cc\u06a9 \u0645\u062e\u062a\u0644\u0641 \u0646\u0642\u0637\u06c1 \u0646\u0638\u0631 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u06af\u06cc\u060c \u062c\u06cc\u0633\u06d2 \u06a9\u06c1 \u0633\u0631\u0648\u0631 \u0633\u0627\u0626\u06cc\u0688 \u0645\u0627\u0688\u0644 \u06cc\u0627 \u06a9\u0644\u0627\u0624\u0688 \u0679\u0631\u0627\u0646\u0633\u0644\u06cc\u0634\u0646 API\u06d4<\/p>\n<p>\u06a9\u0686\u06be \u0627\u0646\u062a\u06c1\u0627\u0626\u06cc \u06a9\u06cc\u0633\u0632 \u0628\u06be\u06cc \u0622\u0632\u0645\u0627\u0626\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li>\u06a9\u0644\u06a9 \u06a9\u0631\u06cc\u06ba <strong>\u0645\u0646\u0633\u0648\u062e\u06cc<\/strong> \u062c\u0628\u06a9\u06c1 \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06c1\u0648 \u0631\u06c1\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u0628\u0631\u0627\u06c1 \u06a9\u0631\u0645 \u0627\u0633 \u0637\u0631\u062d \u06a9\u0627 \u0627\u06cc\u06a9 \u0644\u0641\u0638 \u062f\u0631\u062c \u06a9\u0631\u06cc\u06ba: <em>\u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u0627<\/em> \u0645\u0646\u062a\u062e\u0628 \u0645\u062e\u062a\u0635\u0631 \u0627\u0646 \u067e\u0679 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u06be\u0648\u062c \u0628\u06c1\u062a \u06a9\u0645 \u0642\u0627\u0628\u0644 \u0627\u0639\u062a\u0645\u0627\u062f \u06c1\u06d2\u060c \u0627\u0633 \u0644\u06cc\u06d2 \u0622\u067e \u06a9\u0648 \u062f\u0633\u062a\u06cc \u0637\u0648\u0631 \u067e\u0631 \u0632\u0628\u0627\u0646 \u0645\u0646\u062a\u062e\u0628 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u06a9\u06c1\u0627 \u062c\u0627 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u0628\u0631\u0627\u06c1 \u06a9\u0631\u0645 \u062f\u0648\u0646\u0648\u06ba \u0637\u0631\u0641 \u0633\u06d2 \u0627\u06cc\u06a9 \u06c1\u06cc \u0632\u0628\u0627\u0646 \u06a9\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<p>\u0627\u06af\u0631 \u0622\u067e \u06a9\u06d2 \u0646\u0626\u06d2 \u06a9\u0631\u0648\u0645 \u067e\u0631\u0648\u0641\u0627\u0626\u0644 \u0645\u06cc\u06ba \u0622\u067e \u06a9\u06cc \u067e\u06c1\u0644\u06cc \u06a9\u0648\u0634\u0634 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u062c\u0627\u062a\u06cc \u06c1\u06d2 \u0627\u0648\u0631 \u0622\u067e \u06a9\u0648 \u06cc\u06c1 \u067e\u06cc\u063a\u0627\u0645 &#8216;\u06cc\u06c1 \u062a\u0631\u062c\u0645\u06c1 \u062a\u06cc\u0627\u0631 \u0646\u06c1\u06cc\u06ba \u06a9\u06cc\u0627 \u062c\u0627 \u0633\u06a9\u062a\u0627&#8217; \u0646\u0638\u0631 \u0622\u062a\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u0628\u0631\u0627\u06c1 \u06a9\u0631\u0645 \u0627\u06cc\u06a9 \u0644\u0645\u062d\u06c1 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631\u06cc\u06ba \u0627\u0648\u0631 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4 \u062c\u0628 \u0622\u067e \u067e\u06c1\u0644\u06cc \u0628\u0627\u0631 \u0646\u06cc\u0627 \u067e\u0631\u0648\u0641\u0627\u0626\u0644 \u0686\u0644\u0627\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u062a\u0648 \u06a9\u0631\u0648\u0645 <code>NotSupportedError<\/code> \u0627\u06af\u0644\u06cc \u06a9\u0648\u0634\u0634 \u0645\u06cc\u06ba \u06a9\u0627\u0645\u06cc\u0627\u0628 \u06c1\u0648\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2\u06d4 <code>describeError<\/code> \u0632\u0628\u0627\u0646 \u067e\u0631 \u062a\u0646\u0642\u06cc\u062f \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0628\u062c\u0627\u0626\u06d2 \u0648\u0636\u0627\u062d\u062a \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<h2 id=\"heading-limitations-and-production-considerations\">\u062d\u062f\u0648\u062f \u0627\u0648\u0631 \u067e\u06cc\u062f\u0627\u0648\u0627\u0631 \u06a9\u06d2 \u062a\u062d\u0641\u0638\u0627\u062a<\/h2>\n<p>\u0628\u0644\u0679 \u0627\u0646 AI APIs \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0648\u0688 \u06a9\u0648 \u0686\u06be\u0648\u0679\u0627 \u0628\u0646\u0627 \u062f\u06cc\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u0644\u06cc\u06a9\u0646 \u0627\u0633 \u0645\u06cc\u06ba \u0631\u06a9\u0627\u0648\u0679\u06cc\u06ba \u06c1\u06cc\u06ba \u062c\u0646 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0622\u067e \u06a9\u0648 \u0645\u0646\u0635\u0648\u0628\u06c1 \u0628\u0646\u062f\u06cc \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-browser-support\">\u0628\u0631\u0627\u0624\u0632\u0631 \u0633\u067e\u0648\u0631\u0679<\/h3>\n<p>\u06a9\u0631\u0648\u0645 (\u0627\u0648\u0631 \u0627\u06cc\u062c) \u0688\u06cc\u0633\u06a9 \u0679\u0627\u067e \u06a9\u06cc \u062e\u0635\u0648\u0635\u06cc\u0627\u062a \u06a9\u06d2 \u0633\u0627\u062a\u06be\u06d4 \u0627\u0633\u06d2 \u0628\u062a\u062f\u0631\u06cc\u062c \u0628\u06c1\u062a\u0631\u06cc \u0633\u0645\u062c\u06be\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li>\u062e\u0635\u0648\u0635\u06cc\u062a \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u0627 <code>\"Translator\" in self<\/code> \u0627\u0633\u06d2 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u062c\u06cc\u0633\u06d2 \u0622\u067e \u0646\u06d2 \u06a9\u06cc\u0627 \u062a\u06be\u0627\u06d4<\/li>\n<li>\u06cc\u06c1 \u06a9\u0644\u0627\u0624\u0688 \u0679\u0631\u0627\u0646\u0633\u0644\u06cc\u0634\u0646 API \u06a9\u06cc \u0637\u0631\u062d \u06c1\u0631 \u06a9\u0633\u06cc \u06a9\u06d2 \u0644\u06cc\u06d2 \u0641\u0627\u0644 \u0628\u06cc\u06a9 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0635\u0627\u0631\u0641\u06cc\u0646 \u06a9\u0648 \u06cc\u06c1 \u0628\u062a\u0627\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0679\u06cc\u06a9\u0633\u0679 \u0627\u0646 \u06a9\u06d2 \u0622\u0644\u06d2 \u06a9\u0648 \u06a9\u0628 \u0686\u06be\u0648\u0691\u06d2 \u06af\u0627\u06d4<\/li>\n<li>\u0627\u067e\u0646\u06cc \u0628\u0627\u0642\u06cc \u0645\u0635\u0646\u0648\u0639\u0627\u062a \u06a9\u0648 \u062e\u0635\u0648\u0635\u06cc\u0627\u062a \u06a9\u06d2 \u067e\u06cc\u0686\u06be\u06d2 \u0646\u06c1 \u0686\u06be\u067e\u0627\u0626\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-privacy\">\u062a\u0646\u06c1\u0627\u0626\u06cc<\/h3>\n<p>\u0628\u0627\u0644\u06a9\u0644 \u0648\u0627\u0636\u062d \u06a9\u0631\u06cc\u06ba \u06a9\u06c1 &quot;\u0646\u062c\u06cc&#8221; \u06a9\u0627 \u06a9\u06cc\u0627 \u0645\u0637\u0644\u0628 \u06c1\u06d2\u06d4<\/p>\n<ul>\n<li><strong>\u062a\u0631\u062c\u0645\u06c1 \u0627\u0648\u0631 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u0627 \u0645\u0642\u0627\u0645\u06cc \u0637\u0648\u0631 \u067e\u0631 \u0686\u0644\u062a\u0627 \u06c1\u06d2\u06d4<\/strong> \u062a\u0631\u062c\u0645\u06c1 API \u06a9\u0648 \u0645\u062a\u0646 \u0646\u06c1\u06cc\u06ba \u0628\u06be\u06cc\u062c\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li><strong>\u0645\u0627\u0688\u0644 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06c1\u0648\u062a\u06d2 \u0631\u06c1\u06cc\u06ba \u06af\u06d2\u06d4<\/strong> \u062c\u0628 \u0622\u067e \u067e\u06c1\u0644\u06cc \u0628\u0627\u0631 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba \u062a\u0648 Chrome \u0646\u06cc\u0679 \u0648\u0631\u06a9 \u0633\u06d2 \u0644\u06cc\u0646\u06af\u0648\u06cc\u062c \u067e\u06cc\u06a9 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/li>\n<li>\u0622\u067e \u06a9\u06d2 \u0627\u067e\u0646\u06d2 \u062a\u062c\u0632\u06cc\u06d2 \u0627\u0648\u0631 \u063a\u0644\u0637\u06cc \u06a9\u06cc \u0644\u0627\u06af\u0646\u06af \u06a9\u0648 \u0622\u067e \u06a9\u06d2 \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u062f\u06c1 \u0645\u062a\u0646 \u06a9\u0648 \u067e\u06a9\u0691\u0646\u06d2 \u0646\u06c1 \u062f\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-quality-and-honesty\">\u0645\u0639\u06cc\u0627\u0631 \u0627\u0648\u0631 \u0627\u06cc\u0645\u0627\u0646\u062f\u0627\u0631\u06cc<\/h3>\n<ul>\n<li>\u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u06a9\u0627 \u0627\u0645\u06a9\u0627\u0646 \u06c1\u06d2\u06d4 \u0627\u0639\u062a\u0645\u0627\u062f \u062f\u06a9\u06be\u0627\u0626\u06cc\u06ba\u060c \u062d\u062f \u0645\u0642\u0631\u0631 \u06a9\u0631\u06cc\u06ba\u060c \u0627\u0648\u0631 \u0635\u0627\u0631\u0641\u06cc\u0646 \u06a9\u0648 \u0627\u0646 \u06a9\u0648 \u0627\u0648\u0648\u0631 \u0631\u0627\u0626\u06cc\u0688 \u06a9\u0631\u0646\u06d2 \u062f\u06cc\u06ba\u06d4<\/li>\n<li>\u06a9\u0631\u0648\u0645 \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u0646\u06d2 \u062e\u0628\u0631\u062f\u0627\u0631 \u06a9\u06cc\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0688\u06cc\u0679\u06cc\u06a9\u0679\u0631 \u062a\u0645\u0627\u0645 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06cc \u0645\u06a9\u0645\u0644 \u062f\u0631\u0633\u062a\u06af\u06cc \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0634\u0646\u0627\u062e\u062a \u0646\u06c1\u06cc\u06ba \u06a9\u0631 \u0633\u06a9\u062a\u0627\u06d4<\/li>\n<li>\u0642\u0627\u0646\u0648\u0646\u06cc\u060c \u0637\u0628\u06cc\u060c \u0645\u0627\u0644\u06cc\u060c \u06cc\u0627 \u062f\u06cc\u06af\u0631 \u0627\u06c1\u0645 \u0645\u0648\u0627\u062f \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u06a9\u0645\u0644 \u0637\u0648\u0631 \u067e\u0631 \u0645\u0634\u06cc\u0646\u06cc \u062a\u0631\u062c\u0645\u06c1 \u067e\u0631 \u0627\u0646\u062d\u0635\u0627\u0631 \u0646\u06c1 \u06a9\u0631\u06cc\u06ba\u06d4 \u0645\u0642\u0627\u0645\u06cc \u0628\u0648\u0644\u0646\u06d2 \u0648\u0627\u0644\u0648\u06ba \u0633\u06d2 \u0627\u0646 \u0632\u0628\u0627\u0646\u0648\u06ba \u06a9\u06d2 \u0622\u0624\u0679 \u067e\u0679 \u06a9\u0627 \u062c\u0627\u0626\u0632\u06c1 \u0644\u06cc\u06ba \u062c\u0646 \u06a9\u06cc \u0622\u067e \u062e\u062f\u0645\u062a \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<\/ul>\n<h3 id=\"heading-performance-and-resources\">\u06a9\u0627\u0631\u06a9\u0631\u062f\u06af\u06cc \u0627\u0648\u0631 \u0648\u0633\u0627\u0626\u0644<\/h3>\n<ul>\n<li><strong>\u0679\u06a9\u0691\u0627 \u0644\u0645\u0628\u0627 \u0627\u0646 \u067e\u0679\u06d4<\/strong> \u062a\u0631\u062c\u0645\u06c1 \u062a\u0631\u062a\u06cc\u0628 \u0648\u0627\u0631 \u0639\u0645\u0644 \u06a9\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 \u0637\u0648\u06cc\u0644 \u0645\u062a\u0646 \u0627\u0633 \u06a9\u06d2 \u0628\u0639\u062f \u0622\u0646\u06d2 \u0648\u0627\u0644\u06cc \u06c1\u0631 \u0686\u06cc\u0632 \u0645\u06cc\u06ba \u062a\u0627\u062e\u06cc\u0631 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u0644\u0648\u0688\u0646\u06af \u06a9\u06cc \u062d\u06cc\u062b\u06cc\u062a \u062f\u06a9\u06be\u0627\u0626\u06cc\u06ba \u0627\u0648\u0631 \u0628\u0691\u06cc \u062f\u0633\u062a\u0627\u0648\u06cc\u0632\u0627\u062a \u06a9\u0648 \u062a\u0642\u0633\u06cc\u0645 \u06a9\u0631\u06cc\u06ba\u06d4<\/li>\n<li><strong>\u0627\u067e\u0646\u06d2 \u06a9\u0648\u0679\u06d2 \u0686\u06cc\u06a9 \u06a9\u0631\u06cc\u06ba\u06d4<\/strong> \u06a9\u0686\u06be \u0646\u0641\u0627\u0630 \u0627\u0646 \u067e\u0679 \u06a9\u06d2 \u0633\u0627\u0626\u0632 \u06a9\u0648 \u0645\u062d\u062f\u0648\u062f \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u06a9\u0648\u0626\u06cc \u0631\u0627\u0633\u062a\u06c1 \u0646\u06c1\u06cc\u06ba <code>Translator<\/code> \u0628\u06d2 \u0646\u0642\u0627\u0628 <code>inputQuota<\/code> \u0627\u0648\u0631 <code>measureInputUsage()<\/code>\u0622\u067e \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u0627\u0633\u06d2 \u0686\u06cc\u06a9 \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba (\u06cc\u06c1 MDN \u06a9\u0627 \u0627\u06cc\u06a9 \u0646\u0645\u0648\u0646\u06c1 \u06c1\u06d2\u060c \u0645\u06cc\u06ba \u0646\u06d2 \u0627\u0633\u06d2 \u0627\u0633 \u0688\u06cc\u0645\u0648 \u0633\u06d2 \u0645\u0646\u0633\u0644\u06a9 \u0646\u06c1\u06cc\u06ba \u06a9\u06cc\u0627 \u06c1\u06d2)\u06d4<\/li>\n<\/ul>\n<pre><code class=\"language-ts\">const translator = await getTranslator(\"en\", \"es\");\nconst usage = await translator.measureInputUsage(text);\nif (usage > translator.inputQuota) {\n  throw new Error(\"That text is too long to translate in one go.\");\n}\n<\/code><\/pre>\n<ul>\n<li><strong>\u0627\u067e\u0646\u06d2 \u0648\u0633\u0627\u0626\u0644 \u06a9\u0648 \u0639\u0648\u0627\u0645\u06cc \u0628\u0646\u0627\u0626\u06cc\u06ba\u06d4<\/strong> \u06a9\u0627\u0644 <code>destroy()<\/code> \u0645\u062a\u0631\u062c\u0645\u06cc\u0646 \u06a9\u06d2 \u0628\u0627\u0631\u06d2 \u0645\u06cc\u06ba \u0622\u067e \u06a9\u0648 \u0645\u0632\u06cc\u062f \u0636\u0631\u0648\u0631\u062a \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 <code>destroyAll()<\/code> \u06a9\u0631\u0648<\/li>\n<\/ul>\n<h3 id=\"heading-embedding-and-workers\">\u0627\u06cc\u0645\u0628\u06cc\u0688\u0646\u06af\u0632 \u0627\u0648\u0631 \u0648\u0631\u06a9\u0631\u0632<\/h3>\n<ul>\n<li>API Web Workers \u0645\u06cc\u06ba \u062f\u0633\u062a\u06cc\u0627\u0628 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u060c \u0644\u06c1\u0630\u0627 \u0627\u0633\u06d2 \u0645\u0631\u06a9\u0632\u06cc \u062f\u06be\u0627\u06af\u06d2 \u0633\u06d2 \u06c1\u0679\u0627\u06cc\u0627 \u0646\u06c1\u06cc\u06ba \u062c\u0627 \u0633\u06a9\u062a\u0627 \u062c\u06cc\u0633\u0627 \u06a9\u06c1 \u0622\u067e Transformers.js \u062c\u06cc\u0633\u06cc \u0644\u0627\u0626\u0628\u0631\u06cc\u0631\u06cc\u0648\u06ba \u0645\u06cc\u06ba \u06a9\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/li>\n<li>\u06a9\u0631\u0627\u0633 \u0627\u0648\u0631\u06cc\u062c\u0646 iframes \u06a9\u0648 \u0627\u062c\u0627\u0632\u062a \u06a9\u06cc \u067e\u0627\u0644\u06cc\u0633\u06cc\u0648\u06ba \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4 <code>allow<\/code> \u06cc\u06c1 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u067e\u0631\u0627\u067e\u0631\u0679\u06cc \u06c1\u06d2\u06d4<\/li>\n<\/ul>\n<h2 id=\"heading-conclusion\">\u0646\u062a\u06cc\u062c\u06c1<\/h2>\n<p>\u06c1\u0645 \u0646\u06d2 \u0627\u06cc\u06a9 Next.js \u0679\u0631\u0627\u0646\u0633\u0641\u0627\u0631\u0645\u0631 \u0628\u0646\u0627\u06cc\u0627 \u06c1\u06d2 \u062c\u0648 \u0688\u06cc\u0648\u0627\u0626\u0633 \u067e\u0631 \u0628\u063a\u06cc\u0631 \u06a9\u0633\u06cc \u0645\u0627\u0688\u0644 \u06c1\u0648\u0633\u0679\u0646\u06af \u06cc\u0627 \u0627\u0646\u0641\u0631\u0646\u0633 \u0628\u06cc\u06a9 \u0627\u06cc\u0646\u0688 \u06a9\u06d2 \u0686\u0644\u062a\u0627 \u06c1\u06d2\u06d4 \u0631\u0627\u0633\u062a\u06d2 \u0645\u06cc\u06ba\u060c \u062e\u0635\u0648\u0635\u06cc\u062a \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u0627 \u0645\u062a\u0631\u062c\u0645 \u0627\u0648\u0631 \u0632\u0628\u0627\u0646 \u06a9\u0627 \u067e\u062a\u06c1 \u0644\u06af\u0627\u0646\u06d2 \u0648\u0627\u0644\u06d2 APIs \u06a9\u0627 \u0627\u06cc\u06a9 \u0627\u06c1\u0645 \u062d\u0635\u06c1 \u06c1\u06d2\u06d4 <code>availability()<\/code>\u060c <code>create()<\/code> \u062c\u06cc\u0633\u06d2 \u062c\u06cc\u0633\u06d2 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u0622\u06af\u06d2 \u0628\u0691\u06be\u062a\u0627 \u06c1\u06d2\u060c <code>detect()<\/code> \u0642\u0627\u0628\u0644 \u0627\u0639\u062a\u0645\u0627\u062f \u0633\u06a9\u0648\u0631 \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631\u060c <code>translateStreaming()<\/code>\u0627\u06af\u0644\u0627 \u0645\u0646\u0633\u0648\u062e \u06a9\u0631\u06cc\u06ba\u06d4 <code>AbortController<\/code>\u0627\u0648\u0631 <code>destroy()<\/code>.<\/p>\n<p>\u06c1\u0645 \u0646\u06d2 \u0627\u0646 \u0686\u06cc\u0644\u0646\u062c\u0648\u06ba \u06a9\u0627 \u0628\u06be\u06cc \u0627\u0632\u0627\u0644\u06c1 \u06a9\u06cc\u0627 \u062c\u0648 \u0628\u0631\u0627\u0624\u0632\u0631 \u067e\u0631 \u0645\u0628\u0646\u06cc AI \u0633\u0631\u0648\u0631 \u0631\u06cc\u0646\u0688\u0631\u0646\u06af \u0641\u0631\u06cc\u0645 \u0648\u0631\u06a9 \u06a9\u0648 \u0645\u062a\u0639\u0627\u0631\u0641 \u06a9\u0631\u0648\u0627\u062a\u0627 \u06c1\u06d2\u06d4 <code>Translator<\/code>\u0645\u0627\u0688\u0644\u0632 \u0622\u0646 \u0688\u06cc\u0645\u0627\u0646\u0688 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u06cc\u06d2 \u062c\u0627\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u0635\u0627\u0631\u0641 \u06a9\u06cc \u0628\u0627\u062a \u0686\u06cc\u062a \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u060c \u0633\u067e\u0648\u0631\u0679 \u06a9\u0686\u06be \u0628\u0631\u0627\u0624\u0632\u0631\u0632 \u062a\u06a9 \u0645\u062d\u062f\u0648\u062f \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0645\u0639\u06cc\u0627\u0631 \u0632\u0628\u0627\u0646 \u06a9\u06d2 \u0644\u062d\u0627\u0638 \u0633\u06d2 \u0645\u062e\u062a\u0644\u0641 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u0628\u0631\u0627\u0624\u0632\u0631 \u067e\u0631 \u0645\u0628\u0646\u06cc AI \u0633\u0631\u0648\u0631 \u0633\u0627\u0626\u0688 AI \u06a9\u0648 \u062a\u0628\u062f\u06cc\u0644 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u0644\u0627\u06af\u062a \u0627\u0648\u0631 \u062a\u0627\u062e\u06cc\u0631 \u06a9\u0648 \u06a9\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0622\u0644\u06c1 \u067e\u0631 \u0635\u0627\u0631\u0641 \u06a9\u06d2 \u0639\u0627\u0631\u0636\u06cc \u0645\u062a\u0646 \u06a9\u0648 \u0631\u06a9\u06be\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u062f\u0648\u0633\u0631\u0627 \u0622\u067e\u0634\u0646 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 \u062c\u0628 Chrome \u06a9\u06cc \u0637\u0631\u0641 \u0633\u06d2 \u062a\u0639\u0627\u0648\u0646 \u06a9\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0628 \u0622\u067e \u06a9\u06d2 \u067e\u0627\u0633 \u06a9\u062b\u06cc\u0631 \u0644\u0633\u0627\u0646\u06cc \u062a\u062c\u0631\u0628\u0627\u062a \u0628\u0646\u0627\u0646\u06d2 \u06a9\u0627 \u0627\u06cc\u06a9 \u0686\u06be\u0648\u0679\u0627\u060c \u0645\u0639\u06cc\u0627\u0631 \u067e\u0631 \u0645\u0628\u0646\u06cc \u0637\u0631\u06cc\u0642\u06c1 \u06c1\u06d2\u06d4<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u062a\u0631\u062c\u0645\u06c1 \u06a9\u06cc \u0632\u06cc\u0627\u062f\u06c1 \u062a\u0631 \u062e\u0635\u0648\u0635\u06cc\u0627\u062a \u0627\u0633\u06cc \u0637\u0631\u062d \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u062c\u0628 \u0635\u0627\u0631\u0641 \u0645\u062a\u0646 \u062f\u0627\u062e\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u0622\u067e \u06a9\u06cc \u0627\u06cc\u067e \u0627\u0633\u06d2 \u062a\u0631\u062c\u0645\u06c1 API \u06a9\u0648 \u0628\u06be\u06cc\u062c\u062a\u06cc \u06c1\u06d2\u060c \u0627\u0648\u0631 API \u062a\u0631\u062c\u0645\u06c1 \u06a9\u0648 \u0648\u0627\u067e\u0633 \u0628\u06be\u06cc\u062c\u062a\u0627 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06cc\u06a9\u0646 \u06cc\u06c1 \u06c1\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0645\u06cc\u06ba \u0644\u0627\u06af\u062a \u0627\u0648\u0631 \u062a\u0627\u062e\u06cc\u0631 \u06a9\u0627 \u0627\u0636\u0627\u0641\u06c1 \u06a9\u0631\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0635\u0627\u0631\u0641 \u06a9\u06d2 \u0645\u062a\u0646 \u06a9\u0648 \u0622\u0644\u06c1 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32582","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/posts\/32582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/comments?post=32582"}],"version-history":[{"count":0,"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/posts\/32582\/revisions"}],"wp:attachment":[{"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/media?parent=32582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/categories?post=32582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/umang.pk\/en_us\/wp-json\/wp\/v2\/tags?post=32582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}