You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

language-list.js 1.1 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738
  1. const languageList = [
  2. {
  3. name:"English",i18n:"en",searchlist:["en","ja"],
  4. guideURL:sanbonGuideUrl //or (id,name)=>`http://www.puzzledragonx.com/en/search.asp?q=${name}`
  5. },
  6. {
  7. name:"中文(傳統)",i18n:"zh-hant",i18n_RegExp:/^zh-(?:hant-)?(TW|HK)/i,searchlist:["cht","ja"],
  8. guideURL:mydelfGuideUrl
  9. },
  10. {
  11. name:"中文(简体)",i18n:"zh-hans",i18n_RegExp:/^zh-(?:hans-)?/i,searchlist:["chs","ja"],
  12. guideURL:mydelfGuideUrl
  13. },
  14. {
  15. name:"日本語",i18n:"ja",searchlist:["ja"],
  16. guideURL:sanbonGuideUrl
  17. },
  18. {
  19. name:"한국어",i18n:"ko",searchlist:["ko","ja"],
  20. guideURL:sanbonGuideUrl
  21. },
  22. ];
  23. function sanbonTranslateRegion(code) {
  24. switch (code) {
  25. case "ja": return "jp";
  26. case "ko": return "kr";
  27. case "en": return "na";
  28. }
  29. };
  30. function sanbonGuideUrl(id) {
  31. return `https://sanbon.me/${sanbonTranslateRegion(currentDataSource.code)}/monster/${id}`;
  32. }
  33. function mydelfGuideUrl(id) {
  34. const url = new URL(location);
  35. url.searchParams.set("guide",1);
  36. url.searchParams.set("id",id);
  37. return url;
  38. }