Skip to content

[Feature]: Localize language names to their own language and i18n timezone region labels #4702

Open

Description

@objecttothis

🏷️ Feature Type

✨ New Feature

📦 OpenSourcePOS Version

development (unreleased)

🎯 Problem Statement

The Language dropdown at Config > Localization shows every language name in English (e.g. "German (Switzerland)", "Chinese (Simplified)") regardless of which language it represents. Native speakers expect to see their language listed in its own script/self-name (endonym), e.g. "Deutsch (Schweiz)", "简体中文", so they can find and recognize their language even if they can't read English.

The list is hardcoded in get_languages():
https://github.com/opensourcepos/opensourcepos/blob/main/app/Helpers/locale_helper.php#L52-L103

A related but separate problem exists in get_timezones() just below it:
https://github.com/opensourcepos/opensourcepos/blob/main/app/Helpers/locale_helper.php#L108-L205

Here the region/city descriptions ("Chihuahua, La Paz, Mazatlan", "Beijing, Chongqing, Hong Kong, Urumqi", etc.) are hardcoded English strings baked directly into the array values, with no i18n at all — the timezone dropdown never localizes no matter what UI language is selected.

💡 Proposed Solution

Language list (get_languages()):

  • Keep the array hardcoded (it's a fixed list of locale keys, not user data), but change each value to the language's own endonym instead of the English name.
  • Example: 'de-CH:german' => 'German (Switzerland)' becomes 'de-CH:german' => 'Deutsch (Schweiz)'.
  • Since these are proper-noun self-names they don't need to route through lang() — they're the same regardless of the active UI language — but the list should be reviewed against native-speaker sources for accuracy.

Timezone list (get_timezones()):

  • Extract the free-text region/city portion of every entry into Config.php language keys (one per en/Config.php, then translated per locale), and localize the strings via lang() when the array is built.
  • The Etc/GMT offset prefixes (e.g. (GMT-08:00)) can stay as-is since they're not language-dependent.
  • This needs new keys added to app/Language/en/Config.php (source language) and equivalent translated keys added to every other app/Language/<locale>/Config.php file.

🔄 Alternatives Considered

  • Using PHP's intl extension (ResourceBundle/Locale::getDisplayLanguage()) to generate endonyms and CLDR timezone names dynamically instead of hardcoding. Would reduce maintenance but adds an intl extension dependency and less control over exact formatting/parenthetical region labels currently used; keeping the hardcoded approach per current codebase convention.

✅ Acceptance Criteria

Given the Config > Localization > Language dropdown
When it is rendered in any UI language
Then each language option displays in its own native language/script rather than in English

Given the Config > Localization > Timezone dropdown
When the active UI language is not English
Then the city/region descriptions are shown translated in that language, sourced from Config.php language files

✓ Confirmation

  • I have searched existing feature requests to ensure this is not a duplicate
  • I have provided a clear problem statement and proposed solution

Activity

  1. objecttothis commented on Oct 22, 2026

    @objecttothis
    MemberAuthor

    Claude Issue Checker Agent (cc @objecttothis)

    I investigated this against current master.

    Status: Still present (feature not implemented).

    Evidence (app/Helpers/locale_helper.php):

    • get_languages() still returns every language name as an English display name, e.g. 'de-CH:german' => 'German (Switzerland)', 'zh-Hans:simplified-chinese' => 'Chinese (Simplified)'. No endonyms/self-names have been introduced.
    • get_timezones() still hardcodes English region/city descriptions directly in the array values (e.g. 'America/Chihuahua' => '(GMT-07:00) Chihuahua, La Paz, Mazatlan', 'Asia/Hong_Kong' => '(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi') with no lang() call or Config.php key lookup — so these strings are never localized regardless of UI language, matching the problem statement exactly.

    I found no related merged commits or PRs touching locale_helper.php's get_languages()/get_timezones() for this purpose. This feature request appears to still be open work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions