Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added StringOperatorType #6134

Merged
merged 7 commits into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/Form/Type/Operator/StringOperatorType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sonata\AdminBundle\Form\Type\Operator;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType as FormChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class StringOperatorType extends AbstractType
{
public const TYPE_CONTAINS = 1;
public const TYPE_NOT_CONTAINS = 2;
public const TYPE_EQUAL = 3;
public const TYPE_STARTS_WITH = 4;
public const TYPE_ENDS_WITH = 5;

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'choice_translation_domain' => 'SonataAdminBundle',
'choices' => [
'label_type_contains' => self::TYPE_CONTAINS,
'label_type_not_contains' => self::TYPE_NOT_CONTAINS,
'label_type_equals' => self::TYPE_EQUAL,
'label_type_starts_with' => self::TYPE_STARTS_WITH,
'label_type_ends_with' => self::TYPE_ENDS_WITH,
napestershine marked this conversation as resolved.
Show resolved Hide resolved
],
]);
}

public function getParent()
{
return FormChoiceType::class;
}

public function getBlockPrefix()
{
return 'sonata_type_operator_string';
}
}
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.ar.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>تبديل التنقل</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>ابدا ب</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>ينتهي بـ</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.bg.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Превключване на навигацията</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>започва с</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>завършва със</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.ca.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Commuta la navegació</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>comença amb</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>acaba amb</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.cs.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Přepnout navigaci</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>začíná s</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>končí s</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.de.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Navigation ein-/ausblenden</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>beginnt mit</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>endet mit</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Toggle Navigation</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>starts with</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>ends with</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.es.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Cambiar modo de navegación</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>comienza con</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>termina con</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.eu.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Txandakatu nabigazioa</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>hasten da</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>bukatzen da</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.fa.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>تغییر مسیر ناوبری</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>شروع می شود با</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>به پایان می رسد با</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.fr.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Basculer la navigation</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>commence par</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>termine par</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.hr.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Uključi navigaciju</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>počinje sa</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>završava sa</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.hu.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Váltás a navigációhoz</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>kezdődik</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>végződik</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.it.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Attivare/disattivare la navigazione</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>inizia con</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>finisce con</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.ja.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>ナビゲーションを切り替え</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>で始まる</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>で終わる</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.lb.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Navigatioun an-/ausblenden</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>fänkt mat</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>goung mat</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.lt.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Perjungti naršymą</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>prasideda su</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>baigiasi su</target>
</trans-unit>
</body>
</file>
</xliff>
12 changes: 11 additions & 1 deletion src/Resources/translations/SonataAdminBundle.lv.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@
</trans-unit>
<trans-unit id="flash_lock_error">
<source>flash_lock_error</source>
<target>Cits lietotājs ir modificējis objektu "%name%". Lūdzu, %link_start%click here%link_end%, lai pārlādētu lapu un pielietotu izmaiņas vēlreiz.</target>
<target>Cits lietotājs ir modificējis objektu "%name%". Lūdzu, %link_start%click here%link_end%, lai
pārlādētu lapu un pielietotu izmaiņas vēlreiz.
</target>
</trans-unit>
<trans-unit id="flash_batch_delete_success">
<source>flash_batch_delete_success</source>
Expand Down Expand Up @@ -486,6 +488,14 @@
<source>read_less</source>
<target>Aizvērt</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>sākas ar</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>beidzas ar</target>
</trans-unit>
<trans-unit id="toggle_navigation">
<source>toggle_navigation</source>
<target>Pārslēgt navigāciju</target>
Expand Down
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.nl.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Navigatie weergeven of verbergen</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>begint met</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>eindigt met</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.no.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@
<source>toggle_navigation</source>
<target>Bytt navigering</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>begynner med</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>slutter med</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.pl.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Zwiń/rozwiń menu nawigacji</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>zaczyna się na</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>kończy się na</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.pt.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@
<source>toggle_navigation</source>
<target>Alternar de navegação</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>começa com</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>termina com</target>
</trans-unit>
</body>
</file>
</xliff>
8 changes: 8 additions & 0 deletions src/Resources/translations/SonataAdminBundle.pt_BR.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@
<source>toggle_navigation</source>
<target>Alternar de navegação</target>
</trans-unit>
<trans-unit id="label_type_starts_with">
<source>label_type_starts_with</source>
<target>começa com</target>
</trans-unit>
<trans-unit id="label_type_ends_with">
<source>label_type_ends_with</source>
<target>termina com</target>
</trans-unit>
</body>
</file>
</xliff>
Loading