GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support `locale` module on Android · Issue #135753 · python/cpython

Support locale module on Android #135753

New issue
Copy link
New issue
Copy link
Open
Open
Support locale module on Android#135753
Copy link
Labels
OS-androidstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@mhsmith
mhsmith
opened on Jun 20, 2025
Issue body actions

Migrated from chaquo/chaquopy#1150:


From beeware/toga#2562:

Hello, how can I recognize the current language with locale.getlocale()?
When i try it on android, it only returns ('en_US', 'UTF-8'), even if default language was set to an other language.

I don't think Android sets any of the standard LC_... environment variables, probably because it supports changing the locale within the lifetime of a single process. Instead, it provides an Android-specific API:

context.getResources().getConfiguration().getLocales().get(0)

This will return a string in the form en_US, which can be passed to locale.setlocale.

The difficult part is getting a reference to the context object. For details, see #90371 (comment).

Reacted by Hyuri, An Long and Abdur-Rahmaan Janhangeer

Activity

  1. mhsmith
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    OS-android
    on Jun 20, 2025
  2. StanFromIreland
    added this to Locale issues 🗺on Jun 20, 2025
  3. github-project-automation
    moved this to Todo in Locale issues 🗺on Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-androidstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • Locale issues 🗺
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.