microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.15k stars 1.44k forks source link

Wrong locale used by winget-cli #4056

Open parasit opened 9 months ago

parasit commented 9 months ago

Brief description of your issue

My default language in system is Polish, Japanese language pack is installed as secondary (I'm learning Japanese). Winget ignore Polish package and print all messages in japanese. Even though I have the locale set to pl-PL in the system and json winget configuration. Polish keyboard is enabled and set as default (POL in dock near clock)

Steps to reproduce

Install any package eg.:

winget install -e --id=JesseDuffield.lazygit

Expected behavior

Message in polish or english.

Actual behavior

Message in japanese:

➜ Get-WinSystemLocale
LCID             Name             DisplayName
----             ----             -----------
1045             pl-PL            polski (Polska)

➜ winget install -e --id=JesseDuffield.lazygit
既存のパッケージが既にインストールされています。インストールされているパッケージ...をアップグレードしようとしています
利用可能なアップグレードが見つかりませんでした。
構成されたソースから入手できる新しいパッケージ バージョンはありません。

Environment

➜ winget --info
v1.6.3482 の Windows パッケージ マネージャー
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.2861
システム アーキテクチャ: X64
パッケージ: Microsoft.DesktopAppInstaller v1.21.3482.0

Winget ディレクトリ
--------------------------------------------------------------------------------------------------------------------------------------
ログ                                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
ユーザー設定                              %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
ポータブル リンク ディレクトリ (ユーザー) %LOCALAPPDATA%\Microsoft\WinGet\Links
ポータブル リンク ディレクトリ (マシン)   C:\Program Files\WinGet\Links
ポータブル パッケージ ルート (ユーザー)   %LOCALAPPDATA%\Microsoft\WinGet\Packages
ポータブル パッケージ ルート              C:\Program Files\WinGet\Packages
ポータブル パッケージ ルート (x86)        C:\Program Files (x86)\WinGet\Packages
インストーラのダウンロード                %USERPROFILE%\Downloads

リンク
-----------------------------------------------------------------------------------
プライバシーに関する声明    https://aka.ms/winget-privacy
使用許諾契約                https://aka.ms/winget-license
サード パーティに関する通知 https://aka.ms/winget-3rdPartyNotice
ホーム ページ               https://aka.ms/winget
Windows ストアの使用条件    https://www.microsoft.com/en-us/storedocs/terms-of-sale

管理者設定                                状態
----------------------------------------------
LocalManifestFiles                        無効
BypassCertificatePinningForMicrosoftStore 無効
InstallerHashOverride                     無効
LocalArchiveMalwareScanOverride           無効

Settings.json:
{
   "$schema": "https://aka.ms/winget-settings.schema.json",
   "installBehavior": {
        "preferences": {
            "locale": [ "pl-PL", "en-US" ]
        }
    },
    "visual": {
        "progressBar": "rainbow"
    }
}
yaci commented 4 weeks ago

I am facing identical issue. My setup is identical to OP's (Polish locale enabled and used in everyday work, Japanese language installed for learning purposes).

I partially resolved the issue by regrouping languages in Settings -> Language -> Preferred Languages. I have three languages installed: Polish, Japanese and English and they were listed in that order. I swapped JP with EN, so now my order is Polish, English, Japanese. After reordering and restarting the terminal, winget's language is now set to English.

My environment:

winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4651
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0