0

What is the purpose of the i18n/en_US.csv files within modules? As in... how are they specifically used?

I realize it's for the purposes of translations, but I have tested adding translations for another language (ex: Italian) in an i18n/it_IT.csv file and it translates as expected regardless of if the i18n/en_US.csv file is in place. Is it actually being used? If so, can someone give me an example of when it would be problematic if that file was not in place or missing some phrases in our modules or theme?

2 Answers 2

0

I believe that's mostly useful for shops relying on third party modules.

If you want to translate the module into other languages, you don't need to lanunch Magento and run i18n: collect-phrases manually. This is just for convenience, not for technical reasons.

You can easily diff the file with original after module update and submit new phrases to translation.

0

Assuming your base language is en_US, it allows you to change a string in en_US directly in this file instead of changing it in the code.

Instead of changing in the code __('original string') to __('new string') you can change it in the en_US.csv doing this :

original string, new string

Like that you wont have to rechange the strings in all your other translation files that were based on the original string.

Not having the en_US.csv should not cause any issue unless inside it you already have some translation like original string, new string

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.