Skip to content

Commit

Permalink
Add StringOperatorType (#6134)
Browse files Browse the repository at this point in the history
  • Loading branch information
napestershine committed Jun 27, 2020
1 parent 86905e6 commit ba2f7cc
Show file tree
Hide file tree
Showing 33 changed files with 340 additions and 1 deletion.
51 changes: 51 additions & 0 deletions src/Form/Type/Operator/StringOperatorType.php
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* 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,
],
]);
}

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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>

0 comments on commit ba2f7cc

Please sign in to comment.