lan.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. //設定cookie
  2. function setCookie(name,value)
  3. {
  4. var Days = 30;
  5. var exp = new Date();
  6. exp.setTime(exp.getTime() + Days*24*60*60*1000);
  7. document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
  8. }
  9. //獲取cookie
  10. function getCookie(name)
  11. {
  12. var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
  13. if(arr=document.cookie.match(reg))
  14. return unescape(arr[2]);
  15. else
  16. return null;
  17. }
  18. // 讀取語系設定
  19. let lang = localStorage.getItem('lan');
  20. console.log('目前語系設定: ' + lang); // test
  21. if(lang == null) {
  22. console.log('未設定語系'); // test
  23. // 自動設定語系
  24. var userlang = window.navigator.userLanguage || window.navigator.language;
  25. userlang = userlang.toLowerCase();
  26. console.log('userlang: ' + userlang); // test
  27. if (userlang == 'zh-tw') {
  28. console.log('自動設定語系: 繁體中文');
  29. lang = 'zh';
  30. } else if (userlang == 'en-us') {
  31. console.log('自動設定語系: 英文');
  32. lang = 'en';
  33. } else if (userlang == 'zh-cn') {
  34. console.log('自動設定語系: 繁體中文');
  35. lang = 'zh';
  36. } else {
  37. console.log('自動設定語系: 繁體中文');
  38. lang = 'zh';
  39. }
  40. }
  41. var zh = {
  42. "logleftbox1": "將你的生活、創作 、宣傳做成影片",
  43. "logleftbox2": "開始使用 AI Spokesgirl",
  44. "make_video" : "影片製作",
  45. "make_slides" : "投影影片製作",
  46. "make_video_long": "長影片製作",
  47. "make_video_eng": "純英文影片製作",
  48. "login" : "登入",
  49. "login_link" : "立即登入",
  50. "user_profile": "會員資料",
  51. "logout": "登出",
  52. "logout-m": "<i class='fas fa-sign-out-alt text-white me-3'></i>登&emsp;&ensp;出",
  53. "en": "English",
  54. "zh": "中文",
  55. "choose_character": "選擇人物",
  56. "usage_intro": "使用說明",
  57. "history": "歷史紀錄",
  58. "preview_videos": "預覽影片",
  59. "video_link": "影片連結",
  60. "video_title": "標題",
  61. "p_choose_character": "請選擇人物",
  62. "lines": "台詞",
  63. "img_link": "影像連結",
  64. "content": "內容素材",
  65. "processing_progress": "處理進度",
  66. "usage_intro": "使用說明",
  67. "one_line_to_one_img": "1. 一句台詞請對應提供一個影像連結做為搭配",
  68. "sup_img_profile": "2. 影像連結檔案格式支援:",
  69. "submit_to_wait": "3. 點選“送出”之後需等待一段影片製作的時間,請您耐心等候,待製作完畢可於通知網址查看",
  70. "add_eng": "加入英文:",
  71. "submit": "送出",
  72. "privacy_term": "同意隱私政策及使用條款",
  73. "newHere": "還沒有帳號?",
  74. "oldHere": "已經有帳號?",
  75. "goRegister": "註冊",
  76. "goRegister_link": "立即註冊",
  77. "pricing" : "早鳥方案",
  78. "pricing-m" : "<i class='fas fa-tags me-2'></i>&ensp;早鳥方案",
  79. "errorEmail": "請輸入正確E-mail",
  80. "errorPsd": "密碼至少為4個字元",
  81. "used": "已使用",
  82. "left": "未使用",
  83. "sec": "秒",
  84. "username": "帳號/用戶名稱",
  85. "password": "密碼",
  86. "resetPsd": "更改密碼",
  87. "forgotPsd": "忘記密碼",
  88. "details": "查看詳情",
  89. "refill": "我要加值",
  90. "Createsthtoday": "今天要做甚麼影片呢?",
  91. "date": "日期",
  92. "video_duration": "影片時間",
  93. "slide_link": "SLIDE 連結",
  94. "new_pwd": "新密碼",
  95. "confirm_pwd": "驗證碼",
  96. "pricing_lan": "語言選擇: 中文 | 英文",
  97. "pricing_avatars": "多款預設AI代言主播任你選",
  98. "pricing_content": "畫面素材支援: 圖檔 | 影檔 | 簡報",
  99. "pricing_discount": "限時優惠",
  100. "pricing_checkout": "立即查看",
  101. "mins": "分鐘",
  102. "launch_special": "早鳥方案",
  103. "index_li1_1": "支援中英文內容",
  104. "index_li1_2": "可加入字幕",
  105. "index_li2_1": "無人物肖像權問題",
  106. "index_li2_2": "人物表情、動作自然",
  107. "index_li2_3": "因應主題,選擇合適人物",
  108. "index_li3_1": "可上傳圖片或是影片作為背景",
  109. "index_li3_2": "可輸入文字腳本及投影片",
  110. "index_action": "想要快速製作影音內容?立即註冊,開始創作!",
  111. "follow_us": "關注我們",
  112. "contact_name": "集仕多股份有限公司",
  113. "address": "新竹縣竹北市復興二路229號9樓之9",
  114. "contact_tel": "聯絡電話",
  115. "contact_mail": "聯絡信箱",
  116. "draft_edit": "編輯",
  117. "drafts": "草稿夾",
  118. "save_draft_btn": "存為草稿",
  119. "upload_file": "上傳檔案",
  120. "intro_img": "static/img/intro2.jpg",
  121. "no_draft": "目前沒有草稿喔",
  122. "trial_title": "想要免費獲得更多時間額度?",
  123. "trial_txt": "透過社群分享專屬連結,邀請好友註冊 AI Spokesgirl,凡是好友透過連結註冊成功,您可以免費獲得2分鐘製作額度。",
  124. "share": "分享",
  125. "close": "關閉",
  126. "steps_title": "步驟快速合成影片",
  127. "steps_no1": "選擇AI人物",
  128. "steps_no2": "輸入腳本文字",
  129. "steps_no3": "輸入圖片素材",
  130. "try_it_out": "立即開始",
  131. "demo_link": "./make_video.html",
  132. "usecase_1": "產品介紹",
  133. "usecase_2": "教育培訓",
  134. "usecase_3": "氣象播報",
  135. "usecase_4": "新聞播報",
  136. "usecase_5": "個人內容創作",
  137. "usecase_6": "觀光導覽",
  138. "usecase_7": "展覽導覽",
  139. "usecase_8": "廣告行銷",
  140. "usecase_9": "機構資訊宣導",
  141. "hero_title": "製作影片 一鍵合成",
  142. "hero_txt1": "輸入文字素材,即速產生影片",
  143. "hero_txt2": "創作影片,不再需要錄影機、演員、麥克風繁雜器材。",
  144. "hero_txt3": "大幅省下時間、人力、器材成本。",
  145. "feature": "大特色",
  146. "feature_no1_title1": "輸入文字腳本及素材",
  147. "feature_no1_title2": "一鍵輸出合成影片",
  148. "feature_no2_title": "多位AI虛擬人物選擇",
  149. "feature_no3_title": "投影片轉製為影片",
  150. "feature_no4_title": "多語言支援",
  151. "feature_no1_li1": "只需等待數分鐘即產製完成",
  152. "feature_no1_li2": "可上傳圖片或是影片作為背景",
  153. "feature_no1_li3": "生成MP4檔",
  154. "feature_no2_li1": "無人物肖像權問題",
  155. "feature_no2_li2": "人物表情、動作自然",
  156. "feature_no2_li3": "因應主題,選擇合適人物",
  157. "feature_no3_li1": "輸入文字腳本及投影片連結,一鍵完成影片",
  158. "feature_no3_li2": "生成MP4檔",
  159. "feature_no4_li1": "支援中英文內容",
  160. "feature_no4_li2": "可加入字幕",
  161. "make_video_hand": "手動製作影片",
  162. "make_video_auto": "自動影片製作",
  163. "make_video_trial": "免費註冊使用",
  164. "application":"實際應用",
  165. "5G_network": "5G網路",
  166. "metaverse": "元宇宙",
  167. "local_news": "地方日報",
  168. "index-about": "簡介",
  169. "index-features": "特色",
  170. "index-videos": "影片導覽",
  171. "index-steps": "使用流程",
  172. "index-usecases": "應用情境",
  173. "index-demo": "即時展示",
  174. "time-lapse": "操作影片",
  175. "index_title1": "強大的Ai虛擬代言人",
  176. "index_title2": "快速生成影片工具",
  177. "make_video_txt1": "文字轉影片,輕鬆完成",
  178. "make_video_txt2": "無需演員及相機,一鍵生成影片",
  179. "make_video_auto_txt": "選擇日期,一鍵自動完成氣象報導影片",
  180. "selectDate": "選擇您想製作的日期",
  181. "Previewweathers": "氣象報導影片內容預覽"
  182. };
  183. var en = {
  184. "logleftbox1": "Make your first video for promotion, creation and life today",
  185. "logleftbox2": "Let's get started with AI Spokesgirl",
  186. "make_video" : "Make Videos",
  187. "make_slides" : "Make Videos By Slides",
  188. "make_video_long": "Make Long Videos",
  189. "make_video_eng": "Make English Video",
  190. "login" : "Login",
  191. "login_link" : "Login",
  192. "user_profile": "User Profile",
  193. "logout": "Logout",
  194. "en": "English",
  195. "zh": "中文",
  196. "choose_character": "Choose Character",
  197. "usage_intro": "Usage Introduction",
  198. "history": "History",
  199. "preview_videos": "Preview Videos",
  200. "video_link": "Video Link",
  201. "video_title": "Video Title",
  202. "p_choose_character": "Choose Character",
  203. "lines": "Lines",
  204. "img_link": "Image Link",
  205. "content": "Content",
  206. "processing_progress": "Processing Progress",
  207. "usage_intro": "Usage Introduction",
  208. "one_line_to_one_img": "1. Please Provide an Image Link Corresponding to a Line as a Collocation",
  209. "sup_img_profile": "2. Supported File Format:",
  210. "submit_to_wait": "3. After Clicking Submit, You Will Need To Wait For A Period Of Time For The Production Of The Video. Please Wait Patiently. You Can Check It At The Notification URL When The Production Is Completed.",
  211. "add_eng": "Allow English Lines:",
  212. "submit": "Submit",
  213. "privacy_term": "I Agree to privacy policy and terms of use.",
  214. "newHere": "New here?",
  215. "oldHere": "Already have an account?",
  216. "goRegister": "REGISTER",
  217. "goRegister_link": "REGISTER",
  218. "pricing" : "Pricing",
  219. "errorEmail": "Please enter valid Email format.",
  220. "errorPsd": "Passwords must be at least 4 characters long.",
  221. "used": "Already Used",
  222. "left": "Left",
  223. "sec": "Sec",
  224. "username": "User Name",
  225. "password": "Password",
  226. "resetPsd": "Reset Password",
  227. "forgotPsd": "Forgot Password",
  228. "details": "Details",
  229. "refill": "Refill",
  230. "Createsthtoday": "Create something today!",
  231. "date": "Date",
  232. "video_duration": "Duration",
  233. "slide_link": "SLIDE Link",
  234. "new_pwd": "New Password",
  235. "confirm_pwd": "Confirmation Code",
  236. "pricing_lan": "Language Options: Ch | Eng",
  237. "pricing_avatars": "Over 6 Avatars Available",
  238. "pricing_content": "You can upload: images, MP4, slides",
  239. "pricing_discount": "Special Discount",
  240. "pricing_checkout": "Check it out",
  241. "mins": "Minutes",
  242. "launch_special": "Launch special",
  243. "index_li1_1": "Support english & chinese content",
  244. "index_li1_2": "Caption included",
  245. "index_li2_1": "Free of portrait rights",
  246. "index_li2_2": "Natural facial expression",
  247. "index_li2_3": "Choose built-in avatars for your need",
  248. "index_li3_1": "Generate videos from text",
  249. "index_li3_2": "Upload images, video, slides as backgrounds",
  250. "index_action": "Want to make video faster? Sign up to start creating!",
  251. "follow_us": "Follow us",
  252. "contact_name": "Choozmo Inc.",
  253. "address": "Rm. 9, 9F., No. 229, Fuxing 2nd Rd., Zhubei City, Hsinchu County 302052, Taiwan (R.O.C.)",
  254. "contact_tel": "Tel",
  255. "contact_mail": "Email",
  256. "draft_edit": "Edit",
  257. "drafts": "Drafts",
  258. "save_draft_btn": "Save as Draft",
  259. "upload_file": "Upload",
  260. "intro_img": "static/img/intro_en.png",
  261. "no_draft": "No drafts yet.",
  262. "trial_title": "Want to get more minutes?",
  263. "trial_txt": "Invite your friends to AI Spokesgirl and for each eligible one that signs up from your referral, we'll give you 2 more minutes free!",
  264. "share": "Share:",
  265. "close": "Close",
  266. "steps_title": "easy steps to create a video",
  267. "steps_no1": "Select AI avatar",
  268. "steps_no2": "Type in script",
  269. "steps_no3": "Upload images/videos",
  270. "try_it_out": "Try it out",
  271. "demo_link": "./make_video_eng.html",
  272. "usecase_1": "Product Walkthrough",
  273. "usecase_2": "Learning & Development",
  274. "usecase_3": "Weather Report",
  275. "usecase_4": "News Report",
  276. "usecase_5": "Personal Creation",
  277. "usecase_6": "Sightseeing Guide",
  278. "usecase_7": "Museum Guide",
  279. "usecase_8": "Marketing",
  280. "usecase_9": "Agencies Info",
  281. "hero_title": "Create AI video at a click!",
  282. "hero_txt1": "No more actors, cameras and microphones.",
  283. "hero_txt2": "Make a video by typing and clicking in 3 steps.",
  284. "hero_txt3": "AI Spokesgirl saves you time and money.",
  285. "feature": "Features",
  286. "feature_no1_title1": "Type in script",
  287. "feature_no1_title2": "Produce video at a click",
  288. "feature_no2_title": "Over 6 Avatars Available",
  289. "feature_no3_title": "Slides to video",
  290. "feature_no4_title": "Language Options: Ch | Eng",
  291. "feature_no1_li1": "In minutes, you can get a video.",
  292. "feature_no1_li2": "Upload images, video, slides as backgrounds",
  293. "feature_no1_li3": "Generate videos from text",
  294. "feature_no2_li1": "Free of portrait rights",
  295. "feature_no2_li2": "Natural facial expression",
  296. "feature_no2_li3": "Choose built-in avatars for your need",
  297. "feature_no3_li1": "Type in slide link ",
  298. "feature_no3_li2": "Get downloadable MP4 video",
  299. "feature_no4_li1": "Support english & chinese content",
  300. "feature_no4_li2": "Caption included",
  301. "make_video_hand": "Make Video",
  302. "make_video_auto": "Auto Video Maker",
  303. "make_video_trial": "Free Trial",
  304. "5G_network": "5G Network",
  305. "application":"Application",
  306. "metaverse": "Metaverse",
  307. "local_news": "Local News",
  308. "index-about": "About",
  309. "index-features": "Features",
  310. "index-videos": "Samples",
  311. "index-steps": "Steps",
  312. "index-usecases": "Use Cases",
  313. "index-demo": "Try it",
  314. "time-lapse": "Time-lapse: Steps",
  315. "index_title1": "Flexible AI Spokesgirl Solution",
  316. "index_title2": "Create Video in Minutes",
  317. "make_video_txt1": "Transfer text to video at a click",
  318. "make_video_txt2": "No more actors and camera needed. Create a video at a click.",
  319. "make_video_auto_txt": "Select a date. We'll crawl data and make a whether report video automatically!",
  320. "selectDate": "Select A Date",
  321. "Previewweathers": "Auto Content Preview"
  322. };
  323. function switchLanContent(val){
  324. $('[set-lan]').each(function(){
  325. var me = $(this);
  326. var a = me.attr('set-lan').split(':');
  327. var p = a[0]; //文字放置位置
  328. var m = a[1]; //文字標示
  329. //用虎選擇語言後保存在cookie中,這裡讀取cooikes的語言版本
  330. // var lan = getCookie('lan');
  331. // console.log(lan);
  332. //選取語言文字
  333. switch(val){
  334. case 'zh':
  335. var t = zh[m];
  336. break;
  337. case 'en':
  338. var t = en[m];
  339. break;
  340. default:
  341. var t = zh[m];
  342. }
  343. //所選語言沒有就換
  344. if(t==undefined) t = en[m];
  345. if(t==undefined) t = zh[m];
  346. if(t==undefined) return true; //都沒有就跳出
  347. //文字放置位置有(html,val等,可以自己添加)
  348. switch(p){
  349. case 'html':
  350. me.html(t);
  351. break;
  352. case 'placeholder':
  353. me.attr('placeholder', t);
  354. console.log("placeholder");
  355. case 'val':
  356. case 'value':
  357. me.val(t);
  358. break;
  359. case 'img':
  360. me.attr('src', t);
  361. break;
  362. case 'href':
  363. me.attr('href', t);
  364. default:
  365. me.html(t);
  366. }
  367. });
  368. }
  369. changeLang(lang);
  370. function changeLang(val) {
  371. localStorage.setItem('lan', `${val}`);
  372. // setCookie('lan', val);
  373. switchLanContent(val);
  374. }
  375. // 4. 轉換
  376. function changeLan(val) {
  377. var val = val.value;
  378. console.log(`val: ${val}`);
  379. localStorage.setItem('lan', `${val}`);
  380. // setCookie('lan', val);
  381. switchLanContent(val);
  382. }
  383. // js裡面的轉換
  384. function get_lan(m)
  385. {
  386. //獲取文字
  387. var lan = getCookie('lan'); //語言版本
  388. //選取語言文字
  389. switch(lan){
  390. case 'zh':
  391. var t = zh[m];
  392. break;
  393. case 'hk':
  394. var t = hk[m];
  395. break;
  396. default:
  397. var t = en[m];
  398. }
  399. //如果沒有找到就轉換其他語言
  400. if(t==undefined) t = zh[m];
  401. if(t==undefined) t = en[m];
  402. if(t==undefined) t = hk[m];
  403. if(t==undefined) t = m; //如果還是沒有就直接用標示
  404. return t;
  405. }
  406. function direct() {
  407. console.log(lang);
  408. if(lang == 'en') {
  409. window.location.href = './make_video_eng.html';
  410. } else {
  411. window.location.href = './make_video.html';
  412. }
  413. }
  414. function directAuto(){
  415. if(lang == 'en') {
  416. window.location.href = './autoMaker_v.html';
  417. } else {
  418. window.location.href = './autoMaker_v.html';
  419. }
  420. }