language.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 languages = [
  7. {
  8. value: 'en-US',
  9. name: 'English(United States)',
  10. },
  11. {
  12. value: 'zh-Hans',
  13. name: '简体中文',
  14. },
  15. {
  16. value: 'pt-BR',
  17. name: 'Português(Brasil)',
  18. },
  19. // {
  20. // value: 'es-ES',
  21. // name: 'Español(España)',
  22. // },
  23. // {
  24. // value: 'fr-FR',
  25. // name: 'Français(France)',
  26. // },
  27. // {
  28. // value: 'de-DE',
  29. // name: 'Deutsch(Deutschland)',
  30. // },
  31. // {
  32. // value: 'ja-JP',
  33. // name: '日本語(日本)',
  34. // },
  35. // {
  36. // value: 'ko-KR',
  37. // name: '한국어(대한민국)',
  38. // },
  39. // {
  40. // value: 'ru-RU',
  41. // name: 'Русский(Россия)',
  42. // },
  43. // {
  44. // value: 'it-IT',
  45. // name: 'Italiano(Italia)',
  46. // },
  47. ]
  48. export const getModelRuntimeSupported = (locale: string) => {
  49. if (locale === 'zh-Hans')
  50. return locale.replace('-', '_')
  51. return LanguagesSupported[0].replace('-', '_')
  52. }
  53. export const languageMaps = {
  54. 'en-US': 'en-US',
  55. 'zh-Hans': 'zh-Hans',
  56. 'pt-BR': 'pt-BR',
  57. 'es-ES': 'es-ES',
  58. 'fr-FR': 'fr-FR',
  59. 'de-DE': 'de-DE',
  60. 'ja-JP': 'ja-JP',
  61. 'ko-KR': 'ko-KR',
  62. 'ru-RU': 'ru-RU',
  63. 'it-IT': 'it-IT',
  64. }
  65. export type I18nText = {
  66. 'en-US': string
  67. 'zh-Hans': string
  68. 'pt-BR': string
  69. 'es-ES': string
  70. 'fr-FR': string
  71. 'de-DE': string
  72. 'ja-JP': string
  73. 'ko-KR': string
  74. 'ru-RU': string
  75. 'it-IT': string
  76. }
  77. export const NOTICE_I18N = {
  78. title: {
  79. 'en-US': 'Important Notice',
  80. 'zh-Hans': '重要公告',
  81. 'pt-BR': 'Aviso Importante',
  82. 'es-ES': 'Aviso Importante',
  83. 'fr-FR': 'Avis important',
  84. 'de-DE': 'Wichtiger Hinweis',
  85. 'ja-JP': '重要なお知らせ',
  86. 'ko-KR': '중요 공지',
  87. },
  88. desc: {
  89. '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.',
  90. 'zh-Hans': '为了有效提升数据检索能力及稳定性,Dify 将于 2023 年 8 月 29 日 03:00 至 08:00 期间进行服务升级,届时 Dify 云端版及应用将无法访问。感谢您的耐心与支持。',
  91. '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.',
  92. '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.',
  93. '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.',
  94. '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.',
  95. '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.',
  96. '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.',
  97. },
  98. }