Skip to content

qt: fix sub-asset creation in non-English locales (#440)#452

Open
JSanchezFDZ wants to merge 1 commit into
Raptor3um:developfrom
JSanchezFDZ:fix/createasset-subasset-language
Open

qt: fix sub-asset creation in non-English locales (#440)#452
JSanchezFDZ wants to merge 1 commit into
Raptor3um:developfrom
JSanchezFDZ:fix/createasset-subasset-language

Conversation

@JSanchezFDZ

Copy link
Copy Markdown

Problem

When the wallet display language is set to anything other than English,
the Create asset dialog does not show the root-asset selector after
choosing the Sub asset type, so a parent asset can never be selected
and sub-asset creation becomes impossible (issue #440).

Root cause

CreateAssetsDialog::onAssetTypeSelected() was driven by the translated
combobox text:

if (name == "Root") { ... }
else if (name == "Sub") { ... }

In non-English locales Qt translates the combobox items (e.g. "Racine" /
"Sous" in French), so neither branch matches, the else if is skipped and
RootAssetBox/RootAssetLabel are never made visible.

Fix

Use the locale-independent item index instead (index 0 == Root, any other
index == Sub), which is exactly how the rest of the dialog already decides
the asset type after #418. The translated string is no longer compared, so
the behaviour is identical across all languages.

Closes #440.

onAssetTypeSelected() compared the asset-type combobox against the
English literals "Root"/"Sub". The combobox text is translated by Qt in
non-English locales, so neither branch matched and the root-asset
selector was never shown, making it impossible to pick a parent asset
when creating a sub-asset in any language other than English.

Switch the check to the locale-independent item index (index 0 == Root,
any other index == Sub), matching how the rest of the dialog already
determines the asset type (issue Raptor3um#418).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant