winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Wrong locale used by winget-cli

Open parasit opened this issue 1 year ago • 2 comments

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"
    }
}

parasit avatar Jan 10 '24 18:01 parasit

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

yaci avatar Sep 26 '24 22:09 yaci

I have the same issue, Polish installed, with Japanese in the background. I can confirm that the trick with installing US locale and setting Japanese as the third language in the list works ok.

My env (called both before and after applying the trick)

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

Windows: Windows.Desktop v10.0.26100.2605
システム アーキテクチャ: X64
パッケージ: Microsoft.DesktopAppInstaller v1.24.25200.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           無効
ProxyCommandLineOptions                   無効
DefaultProxy                              無効
> winget --info
Windows Package Manager v1.9.25200
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.2605
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.24.25200.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

ukaszg avatar Dec 12 '24 22:12 ukaszg