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

i18n:collect-phrases -m can't find many important magento phrases #2630

Closed
kkkonrad opened this issue Dec 7, 2015 · 46 comments
Closed

i18n:collect-phrases -m can't find many important magento phrases #2630

kkkonrad opened this issue Dec 7, 2015 · 46 comments
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@kkkonrad
Copy link

kkkonrad commented Dec 7, 2015

looks like it can't find:

Order Summary
Review & Payments
Go to Wish List
View and edit cart
You can create an account after checkout

and other checkout phrases so frontend translation is imposible

@scholtz
Copy link

scholtz commented Dec 7, 2015

the same here.. we have translated everything from collected phrases to slovak language (https://connect20.aveo-trade.cz/cat:BuyPackage/details=1/extension=atconnect%2Fmagento2-language-sk_sk ) live preview is here: http://mag2-test.aveo-trade.cz/ and quite many phrases are not translated..

@scholtz
Copy link

scholtz commented Dec 8, 2015

Hi, i did not look it up yet properly, but it seems that also some of the translated texts are not put to the production..

For example "PDF Invoices" translated as "PDF Faktúry" (module,Magento_Sales) is shown in the administration as "PDF Invoices".

But many texts does not even collect.. for example from \vendor\magento\module-ui\view\base\web\templates\grid\actions.html it does not collect text "Select Items"

@jvanderbiest
Copy link

any update on this issue?

@scholtz
Copy link

scholtz commented Dec 28, 2015

i suggest someone should set this issue the highest priority because if M2 is not translated correctly to any language it is completly useless in every language besides English.. I dont understand how this could be released as official! :(

@mazhalai
Copy link
Contributor

We are working on a fix. Ticket: MAGETWO-47439

@mazhalai mazhalai added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 28, 2015
@piotrekkaminski
Copy link
Contributor

Related issue - please use MAGETWO-43958 to test. cc @mazhalai

@wanpower
Copy link

It could be a hard-to-fix issue, currently i18n:collect-phrases only extract phrases from given token with the i18n format __('phrase') for php/phtml files, and translate="true" for xml files.
This works well for the most cases, but when the target phrase was not listed in any file with the specific syntax, it will be missed by the command.
A workaround is to maintain an appendix dictionary and execute i18n:pack again in merge mode. Thanks for the fallback mechanism it won't require you to put the phrase in a proper module, so just use any module you like to keep the syntax acceptable. I just use "module,Magento_Backend" since it is coincidence the first one I started.
PS: Override the __ function to output all possible phrases and then do a full test you will get all phrases; subtract the existing ones you get with i18n:collect-phrases, then you will get all missing text quickly.

@thomvanderboon
Copy link

@scholtz

After installing the language pack did you run the following commands?

php bin/magento setup:static-content:deploy
php bin/magento setup:static-content:deploy nl_NL <-- change to your own locale
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

I also run the above commands in a nightly cron

here is my "how to" so far: http://www.vanderboon.net/wiki/Install_Test_Magento_2_Translation

I am running into a new problem.... Static text are show in the correct language, by dynamic are not. Will open new issue for this.

okorshenko pushed a commit that referenced this issue Jan 4, 2016
@okorshenko
Copy link
Contributor

@kkkonrad , in the scope of 352bd0c we have added processing of Javascript template files that fixes your initial case. Please, checkout latest version from develop branch

@kkkonrad
Copy link
Author

kkkonrad commented Jan 4, 2016

looks like it works but i can't translate now header step names in checkout:
-Shipping
-Review & Payments
in backend there are problem with grid phrases:
-search by keyword
-select items
-records found
-filtes
-columns
itp

can yo check this?

@thomvanderboon
Copy link

Is there a way to get in what module a certain string should be located?

I located for instance the "Review & Payments" text in the source code, but I can't get it translated.

I tried the following codes in my csv... but nothing is working

"Review & Payments","Controle en betalen",module,Magento_Payment
"Review & Payments","Bekijk en betalen",module,Magento_CheckOut
"Review & Payments","Bekijk en betalen",module,Magento_Sales
"Review & Payments","Bekijk en betalen",module,Magento_Customer

Any idea's?

@scholtz
Copy link

scholtz commented Jan 21, 2016

Hi, we have translated whole magento2 already to three languages: DE, TR, SK

we release it as composer package, and i believe there should be no special need for this code to run:

php bin/magento setup:static-content:deploy
php bin/magento setup:static-content:deploy nl_NL <-- change to your own locale
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

Our packages are the zip file with for example this content:
magento-two-language-de-de\composer.json

{
    "name": "atconnect/magento-two-language-de-de",
    "description": "Magento 2.0.0: de_DE",
    "version": "2.0.0.2-stable",
    "license": [
        "proprietary"
    ],
    "type": "magento2-language",
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

magento-two-language-de-de\language.xml

<?xml version="1.0"?>
<!--
/**
 * @copyright Copyright (c) AveoTrade
 Licence: https://connect20.aveo-trade.cz/cat:Agreement
 */
-->
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    <code>de_DE</code>
    <vendor>atconnect</vendor>
    <package>magento-two-language-de-de</package>
</language>

magento-two-language-de-de\registration.php

<?php
/**
 * Copyright © 2015 AveoTrade
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'atconnect_magento-two-language-de-de',
    __DIR__
);

magento-two-language-de-de\de_DE.csv

"1 Hour","1 Stunde",module,Magento_AdminNotification
"12 Hours","12 Stunden",module,Magento_AdminNotification
"2 Hours","2 Stunden",module,Magento_AdminNotification
"24 Hours","24 Stunden",module,Magento_AdminNotification
"6 Hours","6 Stunden",module,Magento_AdminNotification

You can see demo here:

http://mag2-test3.aveo-trade.cz

In Slovak language we have already ported to version 2.0.1, but still many things are missing..

not-translated-01
not-translated-02
not-translated-03
not-translated-04

@scholtz
Copy link

scholtz commented Jan 21, 2016

Also it would be cool if there was some tool to export the product names, descriptions, cms pages and so on for the translation. We would like to provide for example translation services for eshops, so that they have localised content, but right now i dont know how to export these texts, and import them using composer...

magento-team pushed a commit that referenced this issue Feb 5, 2016
magento-team pushed a commit that referenced this issue Feb 5, 2016
…tant magento phrases #2630

- added support of $t("some text")
- added support of xml attributes translation
magento-team pushed a commit that referenced this issue Feb 5, 2016
…tant magento phrases #2630

- added translate attributes to menu and ACL configurations
magento-team pushed a commit that referenced this issue Feb 5, 2016
magento-team pushed a commit that referenced this issue Feb 5, 2016
magento-team pushed a commit that referenced this issue Feb 5, 2016
…tant magento phrases #2630

- Updated regex that picks up php phrases.
magento-team pushed a commit that referenced this issue Feb 5, 2016
@okorshenko
Copy link
Contributor

@kkkonrad, thank you for reporting the issue. We have added support of javascript translations and improved coverage for menu and ACL configuration. (please, see related commits)

Please, let us know if we resolved your initial use-case and we can close this issue.
Thank you!

@okorshenko okorshenko added Progress: needs update Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development and removed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Feb 8, 2016
@thomvanderboon
Copy link

@jrm93 Which version are you using?

It is still broken in 2.0.4, Almost all issues have been resolved in latest developent version.
magento backend

@jrm93
Copy link

jrm93 commented Apr 30, 2016

@thomvanderboon These is at least 1 phrase (maybe more) that still not gets written to the .csv.

One example is "All Customers" in the Customers menu as shown in my example. I generate the file with the following command:

./magento i18n:collect-phrases -o lines.csv -m /home/rozenkel/public_html/

When i then user grep like this All Customers string is not found.

grep -n "All Customers" lines.csv

Did i do something wrong or is it just a bug in the system.

@thomvanderboon
Copy link

@jrm93 What version of Magento 2 are you running?

@jrm93
Copy link

jrm93 commented Apr 30, 2016

@thomvanderboon i am using version 2.0.4.

@thomvanderboon
Copy link

@jrm93 This issue has not been fixed in the 2.0.4 and will be fixed in one of the upcoming releases.

The issue has been fixed in the development branch, which has less stable code than the latest official release.

@jrm93
Copy link

jrm93 commented Apr 30, 2016

@thomvanderboon thanks for the information. Will clone development branch tomorrow to finish the rest of the translations.

@Krapulat
Copy link

@thomvanderboon Do you know when this fixes will be included in 2.0 branch? In 2.0.6 there are still strings that can't be translated.

@thomvanderboon
Copy link

@Krapulat No, I don't know....Send e-mail to magento? ;)

@teokolo
Copy link

teokolo commented May 19, 2016

2.0.6 does not contain these fixes yet :(

@micheese
Copy link

Does anyone has an update on this please?

@paliarush
Copy link
Contributor

@michiz05000 @teokolo could you please provide a list of phrases which are still not translatable? Please check them on 2.1 branch before reporting.

@KrystynaKabannyk
Copy link

Hello @kkkonrad, this issue has been fixed in the 2.1.0 Release, that's why I'm closing it. If you any questions or additional information regarding the issue feel free to reopen it or create a new one.

@Krapulat
Copy link

@KrystynaKabannyk I've upgraded to 2.1.0 and some strings in the checkout page can't be translated.

@Krapulat
Copy link

Krapulat commented Jul 1, 2016

For example, the strings in Checkout like "Shipping", "Review & Payments", "Order Summary", "You can create an account after checkout." and many others can't be translated.

Thanks.

@gesell
Copy link

gesell commented Sep 2, 2016

Still not translatable in Magento 2.1.

"Shipping" works.
"Review & Payments" not.

Has it to do with the "&"?

@jibrandlr
Copy link

@gesell "Review and Payments" IS translatable in my Magento 2.1 store

@gesell
Copy link

gesell commented Sep 2, 2016

Hi @Igarridoj

Thanks for your reply. How did you manage it? In my case it simply ignores this part of my CSV file (/app/design/frontend/Magento/luma/i18n/de_DE.csv)

@jibrandlr
Copy link

@gesell The row in my .csv file contains:
Review & Payments, My transalted phrase, module, Magento_Checkout

@razvanbalosin
Copy link

I think this has to be reopened as the checkout page is still not translatable (version 2.1.1)

@gewaechshaus
Copy link

I can't get "Review & Payments" to be translated by using de_DE.csv in a custom themes i18n folder... Think so 2

@jeanpham
Copy link

Unbelievable that this is possible...

https://snag.gy/2C8j6f.jpg

I'm desperately looking for a solution...anybody?

@andidhouse
Copy link

This should be escalated to the magento2 top management team now in my perspective. It looks like the m2 developers and m2 GitHub team are not handling bugreports properly since 1.5 years now.

There are hundreds of open bugs here never fixed. This one is also present in 2.1.7.

If you read on GitHub more and more people/developer/user are getting really more and more angry because the @magento-team does not fix important bugs for moths and years.

I think the only way is to escalate this to the top management team as no promises from magento2 team made here are kept.

@BenSpace48
Copy link
Contributor

It's embarrassing that this is still an issue.

@paliarush paliarush removed their assignment Jul 18, 2018
@paliarush
Copy link
Contributor

Hi @BenSpace48, I see that @magento-engcom-team has closed this issue about a year ago. Could you please clarify the scenario in which you still experience a bug?

@BenSpace48
Copy link
Contributor

BenSpace48 commented Jul 19, 2018

There are issues currently open for this problem so despite it being closed it still isn't fixed fully, I'm referring to the fact that these issues have been around since 2015 and are still causing problems.

It feels like Translations have always been broken when it comes to html and JS translations.

See #8508 (comment) and #11175

I find UI Components easier to work with than translations 😱

@paliarush
Copy link
Contributor

@BenSpace48 I understand that this is frustrating, unfortunately the only way to get these issues fixed is to report specific cases when translation does not work.

As far as I can see, the tickets you referred in previous comment have been triaged by @magento-engcom-team and will be fixed according to their priorities.

@z-amini
Copy link

z-amini commented Jun 22, 2020

@paliarush

Specific case

  • Magento version:
    2.3.4 Community edition
  • Php version:
    7.2
  • Phrase:
    Item in Cart
  • Location:
    vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html
33                <!-- ko if: (getCartLineItemsCount() === 1) -->
34                    <span translate="'Item in Cart'"/>
35                <!--/ko-->

Using i18n:collect-phrases -m, the phrase does not appear in results (while being present in its original translation file: vendor/magento/module-checkout/i18n/en_US.csv).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests