1

What i want?

I want to translate Magento 2 to Serbian language.

What i did?

I followed instructions on magento official guide for making a language package. I followed the "create a language package example" guide on this link https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-i18n.html

After that i ran these commands in order:

  • magento setup:upgrade
  • magento cache:flush

What happened?

Well nothing actually happened. There is no change on website.

Info:

  • distro: centos 7
  • Single-Store Mode is enabled
  • magento version: 2.3.3
  • name of the language file: sr_CS.csv

Package folder content:

composer.json language.xml registration.php sr_CS.csv

3
  • you need to set the store view config to serbian; otherwise, it will still use en_US, that's the default locale Dec 6, 2019 at 13:34
  • Sorry that i didn't mention that, but i already set my locale to serbian(latin). Also I am using single store mode if that changes anything... Dec 6, 2019 at 14:08
  • You could try copying the csv file to your theme. Maybe this will work Dec 6, 2019 at 15:20

2 Answers 2

1

Try Magento 2 Serbian (Latin) Language Pack by Mageplaza

Download Serbian (Latin) Language Pack

1
  • I tried that. Using composer and by using copy paste method, but neither works. Dec 6, 2019 at 14:10
0

There are two language packages for Serbian language you can find as far as I know. Both of the them doesn't work. First one is the "official" magento/crowdin project which I found useless, as it has only small portions of string translated. Second one is from mageplaza, and that one is a bit messy. I don't like the way some of the strings are translated, as well as there are translations for admin section which i don't need anyway.

If you run: bin/magento info:language:list, you will get following output:

enter image description here

As you could notice, the language codes for Serbian language is sr_Latn_RS and sr_Cyrl_RS not sr_CS which I think should be sr_RS. Anyway, what I have found the best so far, is that I translate the strings manually in 'sr_Latn_RS.csv' file created in `frontend/vendor/theme/i18' directory to create a language dictionary. I use console tool to collect phrases from modules I have a need to translate and than I used regex to append the appropriate suffix for module declaration at the end of the string. That way I have a full control over the translations, but it's very time consuming task. The language package could be created from that dictionary later on and published as composer package which could be installed in vendor directory afterwords.

What would be the best, in my opinion, is to have separate translations for front and back-end areas.

If you already find appropriate solution in that regard, please let me know.

Hope this help a bit.

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.