Description:
- Resolved an issue where the system incorrectly activated a non-English language for Guest users, even when English was the primary language in the browser settings.
- The bug occurred when additional languages (e.g., Arabic) were configured in the browser and one of those languages was already enabled in Frappe.
- Ensured that English is prioritized as the default language for Guest users when it is present in the browser language list, regardless of other enabled languages.
- Added a fix to explicitly enable English language for Guest users to prevent unintended language switching.
Steps to Reproduce:
- Create a new clean site and add additional languages (e.g., Arabic) in the browser settings.
- Ensure the additional language (e.g., Arabic) is already enabled in the database, which is by default.
- Observe that the system switches to the non-English translation (e.g., Arabic) for Guest users, even if English is the primary language in the browser settings.
Root Cause Analysis:
- Initially suspected `translate.py` was involved in language resolution.
- Checked enabled languages at the console using:
`frappe.get_all("Language", filters={"enabled": 1}, pluck="name")`
Result: ['fr', 'fa', 'es', 'de', 'ar']
- Identified that English was not enabled in the system, despite being a default requirement.
- Traced the issue to `languages.csv`, where English was not included among the enabled languages.
Fix:
- Enabled English in `languages.csv` to ensure it is included among the supported languages.
- This ensures English is chosen when included in the browser settings, resolving the issue.
1.6 KiB
1.6 KiB
| 1 | language_code | language_name | enabled |
|---|---|---|---|
| 2 | af | Afrikaans | 0 |
| 3 | am | አማርኛ | 0 |
| 4 | ar | العربية | 1 |
| 5 | bg | Български | 0 |
| 6 | bn | বাংলা | 0 |
| 7 | bo | བོད་སྐད་ | 0 |
| 8 | bs | Bosanski | 0 |
| 9 | ca | Català | 0 |
| 10 | cs | Čeština | 0 |
| 11 | da | Dansk | 0 |
| 12 | de | Deutsch | 1 |
| 13 | el | Ελληνικά | 0 |
| 14 | en | English | 1 |
| 15 | en-GB | English (United Kingdom) | 0 |
| 16 | en-US | English (United States) | 0 |
| 17 | eo | In-Context Translation | 0 |
| 18 | es | Español | 1 |
| 19 | es-AR | Español (Argentina) | 0 |
| 20 | es-BO | Español (Bolivia) | 0 |
| 21 | es-CL | Español (Chile) | 0 |
| 22 | es-CO | Español (Colombia) | 0 |
| 23 | es-DO | Español (República Dominicana) | 0 |
| 24 | es-EC | Español (Ecuador) | 0 |
| 25 | es-GT | Español (Guatemala) | 0 |
| 26 | es-MX | Español (México) | 0 |
| 27 | es-NI | Español (Nicaragua) | 0 |
| 28 | es-PE | Español (Perú) | 0 |
| 29 | et | Eesti | 0 |
| 30 | fa | فارسی | 1 |
| 31 | fi | Suomi | 0 |
| 32 | fil | Filipino | 0 |
| 33 | fr | Français | 1 |
| 34 | gu | ગુજરાતી | 0 |
| 35 | he | עברית | 0 |
| 36 | hi | हिन्दी | 0 |
| 37 | hr | Hrvatski | 0 |
| 38 | hu | Magyar | 0 |
| 39 | id | Indonesia | 0 |
| 40 | is | Íslenska | 0 |
| 41 | it | Italiano | 0 |
| 42 | ja | 日本語 | 0 |
| 43 | km | ខ្មែរ | 0 |
| 44 | kn | ಕನ್ನಡ | 0 |
| 45 | ko | 한국어 | 0 |
| 46 | ku | Kurdî | 0 |
| 47 | lo | ລາວ | 0 |
| 48 | lt | Lietuvių | 0 |
| 49 | lv | Latviešu | 0 |
| 50 | mk | Македонски | 0 |
| 51 | ml | മലയാളം | 0 |
| 52 | mn | Монгол | 0 |
| 53 | mr | मराठी | 0 |
| 54 | ms | Melayu | 0 |
| 55 | my | မြန်မာ | 0 |
| 56 | nl | Nederlands | 0 |
| 57 | no | Norsk | 0 |
| 58 | pl | Polski | 0 |
| 59 | ps | پښتو | 0 |
| 60 | pt | Português | 0 |
| 61 | ro | Română | 0 |
| 62 | ru | Русский | 0 |
| 63 | rw | Kinyarwanda | 0 |
| 64 | si | සිංහල | 0 |
| 65 | sk | Slovenčina | 0 |
| 66 | sl | Slovenščina | 0 |
| 67 | sq | Shqip | 0 |
| 68 | sr | Српски | 0 |
| 69 | sr-BA | Srpski | 0 |
| 70 | sv | Svenska | 0 |
| 71 | sw | Kiswahili | 0 |
| 72 | ta | தமிழ் | 0 |
| 73 | te | తెలుగు | 0 |
| 74 | th | ไทย | 0 |
| 75 | tr | Türkçe | 0 |
| 76 | uk | Українська | 0 |
| 77 | ur | اردو | 0 |
| 78 | uz | O‘Zbek | 0 |
| 79 | vi | Tiếng Việt | 0 |
| 80 | zh | 中文 | 0 |
| 81 | zh-TW | 繁體中文 | 0 |