language.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. export type Item = {
  2. value: number | string
  3. name: string
  4. }
  5. export const LanguagesSupported = ['en-US', 'zh-Hans', 'pt-BR', 'es-ES', 'fr-FR', 'de-DE', 'ja-JP', 'ko-KR', 'ru-RU', 'it-IT', 'th-TH', 'id-ID']
  6. export const LanguagesSupportedUnderscore = ['en_US', 'zh_Hans', 'pt_BR', 'es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'ko_KR', 'ru_RU', 'it_IT', 'th_TH', 'id_ID']
  7. export const languages = [
  8. {
  9. value: 'en-US',
  10. name: 'English(United States)',
  11. },
  12. {
  13. value: 'zh-Hans',
  14. name: '简体中文',
  15. },
  16. {
  17. value: 'pt-BR',
  18. name: 'Português(Brasil)',
  19. },
  20. {
  21. value: 'es-ES',
  22. name: 'Español(España)',
  23. },
  24. {
  25. value: 'fr-FR',
  26. name: 'Français(France)',
  27. },
  28. {
  29. value: 'de-DE',
  30. name: 'Deutsch(Deutschland)',
  31. },
  32. {
  33. value: 'ja-JP',
  34. name: '日本語(日本)',
  35. },
  36. {
  37. value: 'ko-KR',
  38. name: '한국어(대한민국)',
  39. },
  40. {
  41. value: 'ru-RU',
  42. name: 'Русский(Россия)',
  43. },
  44. {
  45. value: 'it-IT',
  46. name: 'Italiano(Italia)',
  47. },
  48. {
  49. value: 'th-TH',
  50. name: 'ไทย(ประเทศไทย)',
  51. },
  52. {
  53. value: 'id-ID',
  54. name: 'Bahasa Indonesia',
  55. },
  56. ]
  57. export const getModelRuntimeSupported = (locale: string) => {
  58. if (locale === 'zh-Hans')
  59. return locale.replace('-', '_')
  60. return LanguagesSupported[0].replace('-', '_')
  61. }
  62. export const languageMaps = {
  63. 'en-US': 'en-US',
  64. 'zh-Hans': 'zh-Hans',
  65. 'pt-BR': 'pt-BR',
  66. 'es-ES': 'es-ES',
  67. 'fr-FR': 'fr-FR',
  68. 'de-DE': 'de-DE',
  69. 'ja-JP': 'ja-JP',
  70. 'ko-KR': 'ko-KR',
  71. 'ru-RU': 'ru-RU',
  72. 'it-IT': 'it-IT',
  73. }
  74. export type I18nText = {
  75. 'en-US': string
  76. 'zh-Hans': string
  77. 'pt-BR': string
  78. 'es-ES': string
  79. 'fr-FR': string
  80. 'de-DE': string
  81. 'ja-JP': string
  82. 'ko-KR': string
  83. 'ru-RU': string
  84. 'it-IT': string
  85. }
  86. export const NOTICE_I18N = {
  87. title: {
  88. en_US: 'Important Notice',
  89. zh_Hans: '重要公告',
  90. pt_BR: 'Aviso Importante',
  91. es_ES: 'Aviso Importante',
  92. fr_FR: 'Avis important',
  93. de_DE: 'Wichtiger Hinweis',
  94. ja_JP: '重要なお知らせ',
  95. ko_KR: '중요 공지',
  96. },
  97. desc: {
  98. en_US: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  99. zh_Hans: '为了有效提升数据检索能力及稳定性,Dify 将于 2023 年 8 月 29 日 03:00 至 08:00 期间进行服务升级,届时 Dify 云端版及应用将无法访问。感谢您的耐心与支持。',
  100. pt_BR: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  101. es_ES: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  102. fr_FR: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  103. de_DE: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  104. ja_JP: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  105. ko_KR: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
  106. },
  107. href: '#',
  108. }