Support `locale` module on Android
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Migrated from https://github.com/chaquo/chaquopy/issues/1150:
From https://github.com/beeware/toga/discussions/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 https://github.com/python/cpython/issues/90371#issuecomment-2991401118.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Python の locale モジュールと、issue にリンクされている Android コンテキストのガイダンスから始めます。特定のファイルやテストは指定されていません。Android の現在の locale にアクセスする方法を確認し、locale.getlocale() が常に en_US を返すのではなく、それを反映することを検証しながら、locale.setlocale との互換性を維持してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, python
- 領域
- mobile-dev
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100