![]() Even after updating several files in several locations. I learned this the hard way, believe me… Sometimes I would update i18n files and get frustrated because I couldn’t see my changes. The second location is the generated static files. I18n “technically” gets cached in 2 locations, one of which is the standard cache which can be cleared in System > Cache Management. One thing I don’t know is what takes priority out of app/code and app/design. Then it checks the app/code and app/design files for any overrides. vendor/vendor/module/i18n/ (Never edit anything in this folder)īecause there are essentially 3 locations that i18n files can be initialised from, Magento always checks the app/vendor files first.Some labels are hard-coded in and can’t be translated via 918n (A side effect from lazy coding)īased on the first 2 points (above), here are some examples of where i18n files can be initialised:.i18n can also be initialised per module within app/Vendor/module/i18n/.i18n can be initialised in the child theme just as you mentioned.I don’t know why I find that so cool…Īnyway, being too lazy to research i18n in full because I’ve never had to do any “true” translating, I stumbled my way around. My favourite fact about the new translation system is that it’s now referred to as “i18n”, which is short for “internationalisation” (“i” followed by 18 letters then “n”). The bad part is having to work it all out Compared to M1, M2 is very compartmentalised, which is a good thing. Like you, I’ve had to make similar changes to my projects. I know there are plenty of stores out there that support multiple languages… So, my experience is somewhat limited. My projects have never really needed anything more than to support en_GB over en_US. Hi appreciate you putting in the time to show your findings when composing your question. I edited the name row so it says “name”: myvendor/magento2-language-en_gb The code I’m guessing is en_GB, vendor is MyVendorName and package is I’m guessing the name of the directory in my case en_gb language.xml file requires a code, vendor and package.I replicated form Magento’s documentation composer.json, language.xml, registration.php files and a added a language en_GB.csv file and placed all into app/i18n/en_gb directory. Then I tried to understand Magento’s documentation. ![]() Obviously, when I experimented I did a shortcut omitting a few I’m guessing very important steps. Some phrases are translated but the same phrases are not translated everywhere i.e. Hm… but I don’t think it is a correct way of doing it. ![]() I test a few phrases and I can see that it works. I created an i18n directory in app/design/frontend/Magento/luma_child and saved there an en_GB.csv file to translate my luma_child theme. When I watch your videos and follow your articles copy and past codes but I actually understand what I’m doing and why. Copy and paste are OK but I would like to understand what I am doing and why. I also watched this video:, however, the Vietnamese chap doesn’t explain what he is going. I know that M2 requires language pack installation and registration. ![]() I tied to do my homework before tormenting you. ![]() This bit is relatively easy and I’m familiar with it from M1 but in M2 it is not just this. I know that to translate phrases I need to edit language csv file using a text editor let’s say Notepad ++. In addition, I would like to translate phrases like “Proceed to Checkout” to “SECURE CHECKOUT” Magento as a default comes with American English. Can you please give me some tips on how to translate M2? ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |