language.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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']
  6. export const LanguagesSupportedUnderscore = ['en_US', 'zh_Hans', 'pt_BR', 'es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'ko_KR', 'ru_RU', 'it_IT']
  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. export const getModelRuntimeSupported = (locale: string) => {
  50. if (locale === 'zh-Hans')
  51. return locale.replace('-', '_')
  52. return LanguagesSupported[0].replace('-', '_')
  53. }
  54. export const languageMaps = {
  55. 'en-US': 'en-US',
  56. 'zh-Hans': 'zh-Hans',
  57. 'pt-BR': 'pt-BR',
  58. 'es-ES': 'es-ES',
  59. 'fr-FR': 'fr-FR',
  60. 'de-DE': 'de-DE',
  61. 'ja-JP': 'ja-JP',
  62. 'ko-KR': 'ko-KR',
  63. 'ru-RU': 'ru-RU',
  64. 'it-IT': 'it-IT',
  65. }
  66. export type I18nText = {
  67. 'en-US': string
  68. 'zh-Hans': string
  69. 'pt-BR': string
  70. 'es-ES': string
  71. 'fr-FR': string
  72. 'de-DE': string
  73. 'ja-JP': string
  74. 'ko-KR': string
  75. 'ru-RU': string
  76. 'it-IT': string
  77. }
  78. export const NOTICE_I18N = {
  79. title: {
  80. en_US: 'Important Notice',
  81. zh_Hans: '重要公告',
  82. pt_BR: 'Aviso Importante',
  83. es_ES: 'Aviso Importante',
  84. fr_FR: 'Avis important',
  85. de_DE: 'Wichtiger Hinweis',
  86. ja_JP: '重要なお知らせ',
  87. ko_KR: '중요 공지',
  88. },
  89. desc: {
  90. 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.',
  91. zh_Hans: '为了有效提升数据检索能力及稳定性,Dify 将于 2023 年 8 月 29 日 03:00 至 08:00 期间进行服务升级,届时 Dify 云端版及应用将无法访问。感谢您的耐心与支持。',
  92. 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.',
  93. 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.',
  94. 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.',
  95. 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.',
  96. 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.',
  97. 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.',
  98. },
  99. href: '#',
  100. }