简体   繁体   中英

In Akeneo 2.1, how can I get a list of active locales?

I am creating a console Command in Akeneo 2.1, but I'm trying to get a list of active locales. How can I get this?

The LocaleRepository provide a getActivatedLocales method which exactly do that. You can find it here

The locale repository code is pim_catalog.repository.locale and you can get the service in your command by calling $this->getContainer()->get('pim_enrich.repository.locale'); (if your command is container aware of course).

Here is an example of a container aware command: Query help command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM