Skip to main content
19 votes
Accepted

Magento2: List translation strings from a module

Magento 2 already has a command that can collect all the texts from a certain folder that are translatable. Since one module can mean 1 folder, let's say your module name is app/code/Vendor/Module you ...
Marius's user avatar
  • 198k
8 votes

How to translate module with i18n

Translation file path should be app/code/My_vendor/My_module/i18n/jp_JP.csv You should write a translate text code in your controller app/code/<My_vendor>/<My_module>/Controller/...
Suresh Chikani's user avatar
5 votes
Accepted

How to translate module with i18n

2 points: You placed translate file into wrong place. The correct path should be app/code/<My_vendor>/<My_module>/i18n/jp_JP.csv. And you didn't use __('text to translate') to parse the ...
PY Yick's user avatar
  • 2,705
4 votes
Accepted

Translation file magento 2 i18n

If the manual translation doesn't work, you can try Magento generation of translation dictionary by collecting translatable phrases in Magento 2.3.x. Since you are configuring a Magento store in ...
fmsthird's user avatar
  • 4,592
4 votes
Accepted

The "i18n:collect-phrases" command does not collect all translatable strings from JS

Magento 2 use the \Magento\Setup\Module\I18n\Parser\Adapter\Js::_parse() method to collect all translatable lines (strings) from a files. It will open all js files one-by-one and read each line of ...
Siarhey Uchukhlebau's user avatar
3 votes
Accepted

How can I automatically collect new translations without overriding already translated strings?

I have searched over the web and didn't find something that can solve your problem, but I think such kind of feature will be very useful, so I've written my own solution for this problem: module-...
underser's user avatar
  • 550
3 votes

Change 'Sort by Position' text to 'Sort by New' Magento 2.2.6

di.xml override Magento\Catalog\Model\Config.php app\code\[Vendor]\[Module]\etc\frontend\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
Sweety Masmiya's user avatar
3 votes

Add Language translation text in magento2

have you used this syntax where you put your text? Template file: <?php /* @escapeNotVerified */ echo __('Your text') ?> Knockout file: data-bind="i18n: 'Your text'"
Chandra Prakash Gupta's user avatar
2 votes
Accepted

Magento 2: get current store view in JS

follow below steps 1) in your block file namespace Mageplaza\HelloWorld\Block; class HelloWorld extends \Magento\Framework\View\Element\Template { protected $_storeManager; public ...
Hitesh's user avatar
  • 1,569
2 votes
Accepted

Magento 2 - Error in line 196 Dictionary.php - Undefined offset

We modified the function in order to show us the text with the error. You can then search for it with a ctrl + f: vendor\magento\framework\App\Language\Dictionary.php private function readPackCsv($...
Raül's user avatar
  • 790
2 votes
Accepted

Translation csv file in magento theme directory

You can put it inside app/design/frontend/Magento/{luma/blank}/en_US/i18n/your_csv_file.csv If Magento directory is empty create the {luma or blank} and the rest of the folder. Then run upgrade ...
fmsthird's user avatar
  • 4,592
2 votes
Accepted

How to translate text in shipping-estimation.html

I think I found a solution that works for me at least. My translation file is in: app/design/frontend/**MyPackage**/**MyTheme**/i18n/XX_XX.csv I added the string there. Then I copied this file to ...
Webninja's user avatar
  • 1,593
2 votes
Accepted

Add translation for a plugin

Create some new translations with: php bin/magento i18n:collect-phrases -o app/code/Company/Module/i18n/he_IL.csv app/code/Company/Module This will create the csv file that you want, in the place ...
Magento Developer's user avatar
1 vote
Accepted

How to translate i18n value from tag in html?

That looks like the correct way to use the i18n databind. But that doesn't always populate properly on the frontend unless static content has been deployed. It's relies on the translation json file ...
Mark Rees's user avatar
  • 356
1 vote

How to translate i18n value from tag in html?

You can try like this: <button click="datafill"> <span>__('I am the gift Receiver')</span> </button>
Jorden Di Egidio's user avatar
1 vote

How to change text "You have no items in your shopping cart." in minicart in magento 2

Create en_US.csv file in your module vendor/Module/i18n/en_US.csv Add below text in en_US.csv file. "You have no items in your shopping cart.","Add Your Changed Text Here." Flush Your Magento ...
Rizwan Khan's user avatar
  • 1,939
1 vote
Accepted

How to change text "You have no items in your shopping cart." in minicart in magento 2

Please check with below path. app/design/frontend/Magento/theme-name/Magento_Checkout/templates/cart/noItems.phtml
Anas Mansuri's user avatar
  • 2,627
1 vote

Translate Knockout Variables

For translation is: <!-- ko i18n: --> not <!-- ko text: --> in this file is ko text. You can change in backend: Stores => Configurations => Sales => Shipping Methods=> Free Shipping=...
BartZalas's user avatar
  • 1,757
1 vote

Translation file magento 2 i18n

You need to use full phrase (this one was without ":") : "Excl. Tax","Excl. Vat" because it's data-label="<?php echo $block->escapeHtml(__('Excl. Tax'));?>"> and if You translate for ...
BartZalas's user avatar
  • 1,757
1 vote

Change 'Sort by Position' text to 'Sort by New' Magento 2.2.6

Well, since they're both English, I don't think that approach will work. You need to make some changes to the source code. In your module, in the file module_dir/Model/Config.php: <?php ...
Jorge1o1's user avatar
  • 331
1 vote
Accepted

Magento 2 : How to concat a string variable to option value in knockout template which already bind to i18n string?

To ensure that the text you add in a .js file is collected by the i18n tool and added to the dictionary: Link the mage/translate library define (['jquery', 'mage/translate'], function ($) {...}); ...
Vivek Kumar's user avatar
  • 5,665
1 vote

Magento 2.3 translations (translate label) in the admin panel (backend)

You can download code from here Edit/Add CSV as per your Locale. app/design/adminhtml/Shah/default/i18n
Mital Shah's user avatar
1 vote

Magento 2.3 translations (translate label) in the admin panel (backend)

With your custom module, you can create an i18n folder and place your translation file inside. The path should look like this: app\code\vendor\module\i18n\yourTranslationFile.csv which in your ...
fmsthird's user avatar
  • 4,592
1 vote
Accepted

Translation of a module

You will need to create .csv file depending on your locale selected for stores. Then In your custom module you can need to follow below standard for translation. In php or phtml files: echo __("...
Mohit chauhan's user avatar
1 vote

Change 'Sort by Position' text to 'Sort by New' Magento 2.2.6

Create plugin <type name="Magento\Catalog\Model\Config"> <plugin name="custom_sortby_text" type="Vendor\Module\Plugin\Catalog\Model\Config" /> </type> config.php ...
Tirth Patel's user avatar
  • 1,039
1 vote

Page home magento 2

inside i18n folder you put translations for static string (from code) for example for strings like: <?= __("Hello world"); ?> Home page is most probably CMS Page and it can be translated in ...
Jan Żaba's user avatar
  • 131
1 vote

Add Language translation text in magento2

Not tested: But You can try using fr_FR.csv under /vendor/magento/module-customer/i18n directory and check the translation. Hope that may help you.
Purushotam Sharma's user avatar
1 vote

Add Language translation text in magento2

You can installed French Language pack https://github.com/mageplaza/magento-2-french-language-pack Or you can Create language file at below path and add translation text. app/design/frontend/Vendor/...
Navin Bhudiya's user avatar
1 vote
Accepted

Magento 2 - How to Overwrite Default Translation Core en_US Dictionary Package

You have to create a en_US.csv file under your theme like app/design/frontend/<Vendor_Name>/<Theme_Name>/i18n/en_US.csv
Nikolas's user avatar
  • 2,291

Only top scored, non community-wiki answers of a minimum length are eligible