[PR #4447] [MERGED] fix: i18n strings not falling back correctly #4807

Closed
opened 2026-03-17 02:18:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4447
Author: @AndrewBastin
Created: 10/17/2024
Status: Merged
Merged: 10/17/2024
Merged by: @AndrewBastin

Base: patchHead: fix/i18n-fallback


📝 Commits (1)

  • b660604 fix: i18n strings not falling back correctly

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 packages/hoppscotch-common/src/modules/i18n.ts (+8 -0)

📄 Description

This PR intends to fix an issue with the i18n system not falling back correctly to the fallback language (English) translations.
This results in the value printed out being the actual raw i18n tags. This is not visible when the language is changed from English, but once we are in a non-English language and we do a reload, the en language messages are not present and this causes the fields to be present there.

Current State (on reload when German is set as the language):
image

Notice the count.key field.

What's changed

  • Add code to load in fallback langauge regardless of set locale.

🔄 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/hoppscotch/hoppscotch/pull/4447 **Author:** [@AndrewBastin](https://github.com/AndrewBastin) **Created:** 10/17/2024 **Status:** ✅ Merged **Merged:** 10/17/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `patch` ← **Head:** `fix/i18n-fallback` --- ### 📝 Commits (1) - [`b660604`](https://github.com/hoppscotch/hoppscotch/commit/b660604a331d8d0280fe9d35723f31a40aa8dd9b) fix: i18n strings not falling back correctly ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/modules/i18n.ts` (+8 -0) </details> ### 📄 Description This PR intends to fix an issue with the i18n system not falling back correctly to the fallback language (English) translations. This results in the value printed out being the actual raw i18n tags. This is not visible when the language is changed from English, but once we are in a non-English language and we do a reload, the `en` language messages are not present and this causes the fields to be present there. Current State (on reload when German is set as the language): ![image](https://github.com/user-attachments/assets/abc17c39-88b2-401e-ac24-5b86842be273) Notice the `count.key` field. ### What's changed - Add code to load in fallback langauge regardless of set locale. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:18:41 +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/hoppscotch#4807
No description provided.