From 8a33b5ddd64aea14ae4a1bcf09727a11d869e21d Mon Sep 17 00:00:00 2001 From: mikolaj Date: Thu, 17 Aug 2023 14:01:59 +0200 Subject: [PATCH] Renamed domain names --- src/bundle/Form/Type/SearchType.php | 3 ++- .../{search.en.xliff => ibexa_search.en.xliff} | 7 ++++++- .../Resources/translations/messages.en.xliff | 16 ---------------- .../Resources/translations/pagination.en.xliff | 16 ---------------- .../views/themes/standard/search/form.html.twig | 2 +- .../views/themes/standard/search/index.html.twig | 10 +++++++--- 6 files changed, 16 insertions(+), 38 deletions(-) rename src/bundle/Resources/translations/{search.en.xliff => ibexa_search.en.xliff} (94%) delete mode 100644 src/bundle/Resources/translations/messages.en.xliff delete mode 100644 src/bundle/Resources/translations/pagination.en.xliff diff --git a/src/bundle/Form/Type/SearchType.php b/src/bundle/Form/Type/SearchType.php index c85f5a6..454922f 100644 --- a/src/bundle/Form/Type/SearchType.php +++ b/src/bundle/Form/Type/SearchType.php @@ -11,6 +11,7 @@ use Ibexa\Bundle\Search\Form\Data\SearchData; use Ibexa\Contracts\Core\Repository\PermissionResolver; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; +use JMS\TranslationBundle\Annotation\Desc; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\TextType as CoreTextType; @@ -90,7 +91,7 @@ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ 'data_class' => SearchData::class, - 'translation_domain' => 'search', + 'translation_domain' => 'ibexa_search', ]); } } diff --git a/src/bundle/Resources/translations/search.en.xliff b/src/bundle/Resources/translations/ibexa_search.en.xliff similarity index 94% rename from src/bundle/Resources/translations/search.en.xliff rename to src/bundle/Resources/translations/ibexa_search.en.xliff index a5e4b95..bc29b3f 100644 --- a/src/bundle/Resources/translations/search.en.xliff +++ b/src/bundle/Resources/translations/ibexa_search.en.xliff @@ -6,6 +6,11 @@ The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. + + Viewing %viewing% out of %total% items + Viewing %viewing% out of %total% items + key: pagination.viewing + Any Content Type Any Content Type @@ -63,7 +68,7 @@ All - All + All key: search.section.any diff --git a/src/bundle/Resources/translations/messages.en.xliff b/src/bundle/Resources/translations/messages.en.xliff deleted file mode 100644 index 8c6cbb2..0000000 --- a/src/bundle/Resources/translations/messages.en.xliff +++ /dev/null @@ -1,16 +0,0 @@ - - - -
- - The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. -
- - - Any section - Any section - key: search.section.any - - -
-
diff --git a/src/bundle/Resources/translations/pagination.en.xliff b/src/bundle/Resources/translations/pagination.en.xliff deleted file mode 100644 index f12b710..0000000 --- a/src/bundle/Resources/translations/pagination.en.xliff +++ /dev/null @@ -1,16 +0,0 @@ - - - -
- - The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. -
- - - Viewing %viewing% out of %total% items - Viewing %viewing% out of %total% items - key: pagination.viewing - - -
-
diff --git a/src/bundle/Resources/views/themes/standard/search/form.html.twig b/src/bundle/Resources/views/themes/standard/search/form.html.twig index f99042c..d557554 100644 --- a/src/bundle/Resources/views/themes/standard/search/form.html.twig +++ b/src/bundle/Resources/views/themes/standard/search/form.html.twig @@ -1,4 +1,4 @@ -{% trans_default_domain 'search' %} +{% trans_default_domain 'ibexa_search' %} {% form_theme form 'bootstrap_5_layout.html.twig' %} diff --git a/src/bundle/Resources/views/themes/standard/search/index.html.twig b/src/bundle/Resources/views/themes/standard/search/index.html.twig index 429eb9c..4b66e77 100644 --- a/src/bundle/Resources/views/themes/standard/search/index.html.twig +++ b/src/bundle/Resources/views/themes/standard/search/index.html.twig @@ -1,4 +1,4 @@ -{% trans_default_domain 'search' %} +{% trans_default_domain 'ibexa_search' %} {% block content %}
@@ -54,9 +54,13 @@ {% if pager.haveToPaginate %}
- {{ 'pagination.viewing'|trans({ + {{ 'pagination.viewing'|trans( + { '%viewing%': pager.currentPageResults|length, - '%total%': pager.nbResults}, 'pagination')|desc('Viewing %viewing% out of %total% items')|raw }} + '%total%': pager.nbResults + }, + 'ibexa_search' + )|desc('Viewing %viewing% out of %total% items')|raw }}