Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to translate custom attributes in admin backend #13250

Closed
cmuench opened this issue Jan 18, 2018 · 3 comments
Closed

Unable to translate custom attributes in admin backend #13250

cmuench opened this issue Jan 18, 2018 · 3 comments
Labels
Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release

Comments

@cmuench
Copy link
Contributor

cmuench commented Jan 18, 2018

Preconditions

A custom attribute is created.
We have different frontend labels for the attribute. Store views with different locale settings exist.
Admin users are speaking different languages and need a localized attribute label.

Steps to reproduce

Create an custom attribute with different frontend labels.

Expected result

There are two possible results:

  1. A user can see the specific frontend label of the selected store-view. This could be a problem e.g. the user speaks french and the assigned locale of the store view is in another language.

  2. The default frontend label can be translated e.g. with the Magento translation functions. This needs a i18n language file or that we can use the inline translation in admin backend.

Actual result

The default frontend label is used.
Have a look into this method:
\Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::setupAttributeMeta.

$meta = $this->arrayManager->set($configPath, [], [
            'dataType' => $attribute->getFrontendInput(),
            'formElement' => $this->getFormElementsMapValue($attribute->getFrontendInput()),
            'visible' => $attribute->getIsVisible(),
            'required' => $attribute->getIsRequired(),
            'notice' => $attribute->getNote(),
            'default' => (!$this->isProductExists()) ? $attribute->getDefaultValue() : null,
            'label' => $attribute->getDefaultFrontendLabel(),  // <-- This is the line
            'code' => $attribute->getAttributeCode(),
            'source' => $groupCode,
            'scopeLabel' => $this->getScopeLabel($attribute),
            'globalScope' => $this->isScopeGlobal($attribute),
            'sortOrder' => $sortOrder * self::SORT_ORDER_MULTIPLIER,
        ]);

At least the translation function should be used:

'label' => __($attribute->getDefaultFrontendLabel()),
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 18, 2018
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jan 23, 2018
@magento-engcom-team
Copy link
Contributor

@cmuench, thank you for your report.
We've acknowledged the issue and added to our backlog.

@ghost ghost self-assigned this Jan 29, 2019
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ghost
Copy link

ghost commented Mar 29, 2019

HI @cmuench thank you for you report, this issue has already fixed in 2.3-develop branch -> #13251 and available on 2.3.1 release.

@ghost ghost closed this as completed Mar 29, 2019
@ghost ghost added Fixed in 2.3.x The issue has been fixed in 2.3 release line and removed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Mar 29, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

No branches or pull requests

2 participants