Locastic / ApiPlatformTranslationBundle

Translation bundle for ApiPlatform based on Sylius translation
MIT License
84 stars 27 forks source link

Filter on current locale translations #57

Open rsereir opened 2 years ago

rsereir commented 2 years ago

Hello !

I am trying to filter on current locale translations but i don't find any way to do that..

This is working for filter on all translations: #[ApiFilter(SearchFilter::class, properties: ['translations.name'])]

I also want to order my list by current translation name:

'domains_list' => [ // @todo order
            'method' => 'GET',
            'path' => '/domains',
            'access_control' => 'is_granted(\''.Account::ROLE_USER.'\')',
            'normalization_context' => ['groups' => ['domains:list', 'domains:translations']],
            'order' => ['translations.name' => 'ASC'], // <- here i want to order on current locale
        ],

Someone have any idea to do that without rewriting all filter class ?

Thanks :)