[PR #584] [MERGED] feat: |Worker| support multi language #642

Closed
opened 2026-02-26 21:32:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584
Author: @dreamhunter2333
Created: 2/19/2025
Status: Merged
Merged: 2/19/2025
Merged by: @dreamhunter2333

Base: mainHead: feature/dev


📝 Commits (1)

  • 045985c feat: |Worker| support multi language

📊 Changes

23 files changed (+912 additions, -851 deletions)

View changed files

📝 CHANGELOG.md (+5 -1)
📝 frontend/package.json (+4 -4)
📝 frontend/pnpm-lock.yaml (+208 -284)
📝 frontend/src/api/index.js (+4 -3)
frontend/src/i18n.ts (+15 -0)
📝 frontend/src/main.js (+1 -12)
📝 pages/package.json (+2 -2)
📝 vitepress-docs/package.json (+2 -2)
📝 vitepress-docs/pnpm-lock.yaml (+308 -308)
📝 worker/package.json (+6 -6)
📝 worker/pnpm-lock.yaml (+207 -199)
📝 worker/src/admin_api/index.ts (+4 -1)
📝 worker/src/constants.ts (+1 -1)
worker/src/i18n/en.ts (+24 -0)
worker/src/i18n/index.ts (+16 -0)
worker/src/i18n/type.ts (+20 -0)
worker/src/i18n/zh.ts (+24 -0)
📝 worker/src/mails_api/index.ts (+16 -9)
📝 worker/src/mails_api/send_mail_api.ts (+4 -1)
📝 worker/src/telegram_api/miniapp.ts (+4 -1)

...and 3 more files

📄 Description

PR Type

enhancement, dependencies


Description

  • Added multi-language support to the Worker.

  • Implemented language-specific messages in English and Chinese.

  • Updated dependencies and version numbers.

  • Included language context in API requests and responses.


Changes walkthrough 📝

Relevant files
Enhancement
15 files
worker.ts
Add multi-language support in Worker                                         
+31/-16 
index.ts
Add language support to mail API                                                 
+16/-9   
zh.ts
Add Chinese language messages                                                       
+24/-0   
en.ts
Add English language messages                                                       
+24/-0   
index.ts
Add language support to admin API                                               
+4/-1     
send_mail_api.ts
Add language support to send mail API                                       
+4/-1     
miniapp.ts
Add language support to Telegram miniapp                                 
+4/-1     
user.ts
Add language support to user API                                                 
+4/-1     
type.ts
Define type for locale messages                                                   
+20/-0   
types.d.ts
Add language context to types                                                       
+2/-0     
i18n.ts
Initialize i18n for frontend                                                         
+15/-0   
index.ts
Add language message retrieval logic                                         
+16/-0   
constants.ts
Update version constant                                                                   
+1/-1     
index.js
Include language header in API requests                                   
+4/-3     
main.js
Import i18n in main frontend file                                               
+1/-12   
Dependencies
5 files
pnpm-lock.yaml
Update dependencies                                                                           
+308/-308
package.json
Update version and dependencies                                                   
+6/-6     
package.json
Update version and dependencies                                                   
+4/-4     
package.json
Update version and dependencies                                                   
+2/-2     
package.json
Update version and dependencies                                                   
+2/-2     
Documentation
1 files
CHANGELOG.md
Update changelog for version 0.9.0                                             
+5/-1     
Additional files
2 files
pnpm-lock.yaml +208/-284
pnpm-lock.yaml +207/-199

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.

  • 🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

    ## 📋 Pull Request Information **Original PR:** https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 2/19/2025 **Status:** ✅ Merged **Merged:** 2/19/2025 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/dev` --- ### 📝 Commits (1) - [`045985c`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/045985c86f7de03623f210295464264aa39b931e) feat: |Worker| support multi language ### 📊 Changes **23 files changed** (+912 additions, -851 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+5 -1) 📝 `frontend/package.json` (+4 -4) 📝 `frontend/pnpm-lock.yaml` (+208 -284) 📝 `frontend/src/api/index.js` (+4 -3) ➕ `frontend/src/i18n.ts` (+15 -0) 📝 `frontend/src/main.js` (+1 -12) 📝 `pages/package.json` (+2 -2) 📝 `vitepress-docs/package.json` (+2 -2) 📝 `vitepress-docs/pnpm-lock.yaml` (+308 -308) 📝 `worker/package.json` (+6 -6) 📝 `worker/pnpm-lock.yaml` (+207 -199) 📝 `worker/src/admin_api/index.ts` (+4 -1) 📝 `worker/src/constants.ts` (+1 -1) ➕ `worker/src/i18n/en.ts` (+24 -0) ➕ `worker/src/i18n/index.ts` (+16 -0) ➕ `worker/src/i18n/type.ts` (+20 -0) ➕ `worker/src/i18n/zh.ts` (+24 -0) 📝 `worker/src/mails_api/index.ts` (+16 -9) 📝 `worker/src/mails_api/send_mail_api.ts` (+4 -1) 📝 `worker/src/telegram_api/miniapp.ts` (+4 -1) _...and 3 more files_ </details> ### 📄 Description ### **PR Type** enhancement, dependencies ___ ### **Description** - Added multi-language support to the Worker. - Implemented language-specific messages in English and Chinese. - Updated dependencies and version numbers. - Included language context in API requests and responses. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>15 files</summary><table> <tr> <td><strong>worker.ts</strong><dd><code>Add multi-language support in Worker</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-c007030a206d7e4e2a4879ba673551e7633ad914b67cfac204096edced3f80a2">+31/-16</a>&nbsp; </td> </tr> <tr> <td><strong>index.ts</strong><dd><code>Add language support to mail API</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-83710df6a60b2b512e134f32ad9890ab9a255040f6019f0d5603f72f4561cea4">+16/-9</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>zh.ts</strong><dd><code>Add Chinese language messages</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-afab3b78ff6b384c74a17417198e84933a9dfb3cd845fab91db1000084e192e1">+24/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>en.ts</strong><dd><code>Add English language messages</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-866bab2459173d441c05aaffe80d1c0d5aaef950056259c00364174c71a5b20c">+24/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>index.ts</strong><dd><code>Add language support to admin API</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-b470c4c47ce4a700cd8aac644d07d8a747d439bb6d69e9392a198b3a931fe2e7">+4/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>send_mail_api.ts</strong><dd><code>Add language support to send mail API</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-92070e9d7b3228209a2024053eb4429a76907de17f9566b97b22d0d12e4e0934">+4/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>miniapp.ts</strong><dd><code>Add language support to Telegram miniapp</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-6feb8b070d6d6d9eb8a7470cecf5cfa424c9ced860a94a085df2aa47cd11ba5e">+4/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>user.ts</strong><dd><code>Add language support to user API</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-aafbb1e6861a3f5ecb2bd9d51e2bf9f11f13aa96302eb755f91c233bae2a296e">+4/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>type.ts</strong><dd><code>Define type for locale messages</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-93a787364db63c92c7cff26f2a070af388094baa0b813de844843d5978808945">+20/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>types.d.ts</strong><dd><code>Add language context to types</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-583fb024d5c9d1efac71bbea788d8379e5e8fc2f0bb1696a9863c6f6cac54bee">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>i18n.ts</strong><dd><code>Initialize i18n for frontend</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-013231347151156419a1933433fc8306f4e2747675f973eba6d1f20b374f2e50">+15/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>index.ts</strong><dd><code>Add language message retrieval logic</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-b57af9f265405661c012637412faf96817ca297e2316168d3b16dcd9c3276bc9">+16/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>constants.ts</strong><dd><code>Update version constant</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-cab08ba19c1499ed426fc4918a5613e22eb95c3427c7467ce330f5ee0d69d01e">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>index.js</strong><dd><code>Include language header in API requests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-80f7e17c8e1f299b7316ce792286ebcaab67ed3afc050e3c5019ed33ab61b34b">+4/-3</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>main.js</strong><dd><code>Import i18n in main frontend file</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-2f46f8a9c2b03069ecfe187fdaec0f865901d86ba8426dda8b437788b10e8ca7">+1/-12</a>&nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>5 files</summary><table> <tr> <td><strong>pnpm-lock.yaml</strong><dd><code>Update dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-655c1410f6eacceaa9003212a9f840a660ace35e32e60d792be3640ec774af6f">+308/-308</a></td> </tr> <tr> <td><strong>package.json</strong><dd><code>Update version and dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-89dc6f41a53ce13f2da5a00dd34868762e6cd0df46eddc9f5c3c4510b1493870">+6/-6</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>package.json</strong><dd><code>Update version and dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-da6498268e99511d9ba0df3c13e439d10556a812881c9d03955b2ef7c6c1c655">+4/-4</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>package.json</strong><dd><code>Update version and dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-74314f72f6616d400be4cb0d161867d8148f23c22d4c12c7188aedb129c00c59">+2/-2</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>package.json</strong><dd><code>Update version and dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-3adbfbfaa65ecc60f48c8d009a52c697d4c80d61ee887799df22407fcb73f380">+2/-2</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>CHANGELOG.md</strong><dd><code>Update changelog for version 0.9.0</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed">+5/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Additional files</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>pnpm-lock.yaml</strong></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-41b1ff3a74ba81fa74c8dd225d66d81573be3f2990e1d98b9b09798b147d40a8">+208/-284</a></td> </tr> <tr> <td><strong>pnpm-lock.yaml</strong></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/584/files#diff-b40cf923090a5fb5f6cc0d6ce716c560645419d762871abb50383fdb423288c6">+207/-199</a></td> </tr> </table></details></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
    kerem 2026-02-26 21:32:11 +03:00
    Sign in to join this conversation.
    No milestone
    No project
    No assignees
    1 participant
    Notifications
    Due date
    The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

    No due date set.

    Dependencies

    No dependencies set.

    Reference
    starred/cloudflare_temp_email#642
    No description provided.