strings.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. var langs = /** @type {const} */ ([
  2. 'en', 'zh-cn',
  3. ])
  4. /** @type {StringDict<LangDict<string>>} */
  5. var strings = {
  6. layout: {
  7. title: {
  8. en: 'NaiveBoom - Relatively Safe',
  9. 'zh-cn': 'NaiveBoom - 比较安全',
  10. },
  11. info: {
  12. en: "<b>Gosh!</b> You disabled JavaScript, please enable. <br> Otherwise this site won't work.",
  13. 'zh-cn': '<b>上帝啊!</b> 您禁用了JavaScript,请开启它 <br> 如果您禁止使用JavaScript,将无法使用我们的服务!',
  14. },
  15. guide: {
  16. en: "<a href='https://www.enablejavascript.io/en' target='_blank' class='alert-link'>Find out how to enable JavaScript.</a>",
  17. 'zh-cn': "<a href='https://www.enablejavascript.io/cn' target='_blank' class='alert-link'>查看如何启用JavaScript</a>",
  18. },
  19. homepage: {
  20. en: 'Home Page',
  21. 'zh-cn': '首页',
  22. },
  23. },
  24. error: {
  25. title: {
  26. en: 'NaiveBoom - Error',
  27. 'zh-cn': 'NaiveBoom - 出现错误',
  28. },
  29. info: {
  30. en: 'An error occurred on this page.',
  31. 'zh-cn': '出现了一些情况,页面发生错误了。',
  32. },
  33. },
  34. index: {
  35. prompt: {
  36. en: "<p class='lead'>Anonymous Single-View Message</p>"
  37. + '<p>Type or paste something in the editor below,'
  38. + '<br>then press <u><b>Generate</b></u> to get a short link.</p>'
  39. + '<p>Share this link with your friend, and they only get to open it once,'
  40. + '<br>when they close the page, the message will be gone <b>forever</b>!</p>',
  41. 'zh-cn': "<p class='lead'>无需注册的阅后即焚</p>"
  42. + '<p>在下面的框框里输入或粘贴一些内容'
  43. + '<br>然后点一下「生成」按钮,你就会得到一个短的网址</p>'
  44. + '<p>将这个网址发给你的朋友,TA只能看一次'
  45. + '<br>关掉页面后,内容就会 <b>永远消失</b>! </p>',
  46. },
  47. shareprompt: {
  48. en: 'Share this message with this link:',
  49. 'zh-cn': '可以把这个网址分享给你的朋友:',
  50. },
  51. generate: {
  52. en: 'Generate',
  53. 'zh-cn': '生成',
  54. },
  55. info: {
  56. en: "<h6>Naiveboom - Avoid naivetés"
  57. + "<a href='//en.wikipedia.org/wiki/Moha_(meme)' target='_blank' > <sup>[1]</sup></a></h6><p></p>"
  58. + '<p>Want to share a message but have concerns with it being exposed to 3<sup>rd</sup> parties?</p>'
  59. + '<p>Just paste it here (Markdown syntax and attachments supported),'
  60. + '<br>then generate a single-use link that invalidates itself after opening.</p>'
  61. + '<p>Now at the very least you would know when things goes wrong.</p>',
  62. 'zh-cn': '<h6>Naiveboom - 让Naive的事情不再发生</h6><p></p>'
  63. + '<p>举例:你有一段较为私密的信息需要发送,不想被第三者看到</p>'
  64. + '<p>你可以将这段文字粘贴到这个页面(支持Markdown格式和附件)'
  65. + '<br>产生一个一次性链接,阅后即焚</p>'
  66. + '<p>这样如果出事的话,至少你们能知道(笑)</p>',
  67. },
  68. '<close>': {
  69. en: 'Close',
  70. 'zh-cn': '关闭',
  71. },
  72. '<info>': {
  73. en: 'Info',
  74. 'zh-cn': '提示',
  75. },
  76. '<error>': {
  77. en: 'Error',
  78. 'zh-cn': '错误',
  79. },
  80. '<none>': {
  81. en: '(None)',
  82. 'zh-cn': '(空)',
  83. },
  84. '<loading>': {
  85. en: 'Loading...',
  86. 'zh-cn': '加载中...',
  87. },
  88. '<failed>': {
  89. en: 'Failed to perform action:',
  90. 'zh-cn': '操作失败!',
  91. },
  92. '<neterr>': {
  93. en: 'Network error',
  94. 'zh-cn': '网络错误',
  95. },
  96. '<unknerr>': {
  97. en: 'Unknown error',
  98. 'zh-cn': '未知错误',
  99. },
  100. },
  101. look: {
  102. info: {
  103. en: 'Uh oh 😯, the message is already gone...',
  104. 'zh-cn': '啊喔😯,你要查看的内容已经不见了...',
  105. },
  106. tips: {
  107. en: '<p>This means it has already been opened once, and the message was deleted from server.</p>'
  108. + '<p>Get it? This link is <b>single-use only!</b><p>',
  109. 'zh-cn': '<p>这是因为这个网址已经被看过一次了,被看过一次的内容就会自动消失</p>'
  110. + '<p>对,这就是人们常说的 <b>阅后即焚!</b></p>',
  111. },
  112. metoo: {
  113. en: 'I want to get a link too!',
  114. 'zh-cn': '我也要生成一个!',
  115. },
  116. retrieving: {
  117. en: 'Retrieving message...',
  118. 'zh-cn': '正在获取...',
  119. },
  120. }
  121. }
  122. /**
  123. * @template T
  124. * @typedef {{ [file: string]: { [key: string]: T } }} StringDict
  125. */
  126. /**
  127. * @template T
  128. * @typedef {{ [k in typeof langs[number]]: T }} LangDict
  129. */
  130. /** @type {LangDict<StringDict<string>>} */
  131. var langStrings = {}
  132. langs.forEach(function (lang) {
  133. langStrings[lang] = {}
  134. Object.keys(strings).forEach(function(file) {
  135. langStrings[lang][file] = {}
  136. Object.keys(strings[file]).forEach(function(key) {
  137. langStrings[lang][file][key] = strings[file][key][lang];
  138. })
  139. });
  140. });
  141. module.exports = langStrings