diff --git a/packages/Webkul/Shop/src/Resources/lang/nl/app.php b/packages/Webkul/Shop/src/Resources/lang/nl/app.php index 16948a888..d2e98a659 100644 --- a/packages/Webkul/Shop/src/Resources/lang/nl/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/nl/app.php @@ -1,9 +1,9 @@ 'The given vat id has a wrong format', - 'security-warning' => 'Suspicious activity found!!!', - 'nothing-to-delete' => 'Nothing to delete', + 'invalid_vat_format' => 'Het opgegeven btw-nummer heeft een verkeerd formaat', + 'security-warning' => 'Verdachte activiteit gevonden!', + 'nothing-to-delete' => 'Er valt niets te verwijderen', 'layouts' => [ 'my-account' => 'Mijn account', @@ -16,9 +16,9 @@ return [ ], 'common' => [ - 'error' => 'Something went wrong, please try again later.', + 'error' => 'Er is iets misgegaan, probeer het later opnieuw.', 'image-upload-limit' => 'De maximale uploadgrootte van de afbeelding is 2 MB', - 'no-result-found' => 'We could not find any records.' + 'no-result-found' => 'We hebben geen records kunnen vinden.' ], 'home' => [ @@ -426,7 +426,7 @@ return [ 'sale' => 'Uitverkoop', 'new' => 'Nieuw', 'empty' => 'Geen producten beschikbaar in deze categorie', - 'add-to-cart' => 'Voeg toe aan winkelkar', + 'add-to-cart' => 'In winkelwagen', 'book-now' => 'boek nu', 'buy-now' => 'Koop nu', 'whoops' => 'Whoops!', @@ -452,7 +452,7 @@ return [ 'compare_options' => 'Compare Options', 'wishlist-options' => 'Wishlist Options', 'offers' => 'Buy :qty for :price each and save :discount%', - 'tax-inclusive' => 'Inclusive of all taxes', + 'tax-inclusive' => 'Inclusief BTW', ], // 'reviews' => [ diff --git a/packages/Webkul/Velocity/publishable/assets/images/flags/de.png b/packages/Webkul/Velocity/publishable/assets/images/flags/de.png new file mode 100644 index 000000000..b28cfd98a Binary files /dev/null and b/packages/Webkul/Velocity/publishable/assets/images/flags/de.png differ diff --git a/packages/Webkul/Velocity/publishable/assets/images/flags/es.png b/packages/Webkul/Velocity/publishable/assets/images/flags/es.png new file mode 100644 index 000000000..bef0a4563 Binary files /dev/null and b/packages/Webkul/Velocity/publishable/assets/images/flags/es.png differ diff --git a/packages/Webkul/Velocity/publishable/assets/images/flags/fr.png b/packages/Webkul/Velocity/publishable/assets/images/flags/fr.png new file mode 100644 index 000000000..a2b2de6e9 Binary files /dev/null and b/packages/Webkul/Velocity/publishable/assets/images/flags/fr.png differ diff --git a/packages/Webkul/Velocity/publishable/assets/images/flags/nl.png b/packages/Webkul/Velocity/publishable/assets/images/flags/nl.png new file mode 100644 index 000000000..dbb2c2c46 Binary files /dev/null and b/packages/Webkul/Velocity/publishable/assets/images/flags/nl.png differ diff --git a/packages/Webkul/Velocity/publishable/assets/images/flags/tr.png b/packages/Webkul/Velocity/publishable/assets/images/flags/tr.png new file mode 100644 index 000000000..640e7e8ba Binary files /dev/null and b/packages/Webkul/Velocity/publishable/assets/images/flags/tr.png differ diff --git a/packages/Webkul/Velocity/src/Helpers/Helper.php b/packages/Webkul/Velocity/src/Helpers/Helper.php index 1f5296be2..0f31f452c 100644 --- a/packages/Webkul/Velocity/src/Helpers/Helper.php +++ b/packages/Webkul/Velocity/src/Helpers/Helper.php @@ -2,8 +2,8 @@ namespace Webkul\Velocity\Helpers; -use Illuminate\Support\Facades\DB; use Webkul\Product\Helpers\Review; +use Illuminate\Support\Facades\Storage; use Webkul\Product\Facades\ProductImage; use Webkul\Product\Models\Product as ProductModel; use Webkul\Product\Repositories\ProductRepository; @@ -16,63 +16,76 @@ use Webkul\Velocity\Repositories\VelocityMetadataRepository; class Helper extends Review { /** - * productModel object + * Product model instance. * * @var \Webkul\Product\Contracts\Product */ - protected $productModel; + protected $productModel; /** - * orderBrands object + * Order brands instance. * * @var \Webkul\Velocity\Repositories\OrderBrandsRepository */ protected $orderBrandsRepository; /** - * ProductRepository object + * Product repository instance. * * @var \Webkul\Product\Repositories\ProductRepository */ protected $productRepository; /** - * ProductFlatRepository object + * Product flat repository instance. * * @var \Webkul\Product\Repositories\ProductFlatRepository */ protected $productFlatRepository; /** - * productModel object + * Attribute option instance. * * @var \Webkul\Attribute\Repositories\AttributeOptionRepository */ protected $attributeOptionRepository; /** - * ProductReviewRepository object + * Product review repository instance. * * @var \Webkul\Product\Repositories\ProductReviewRepository */ protected $productReviewRepository; /** - * VelocityMetadata object + * Velocity metadata instance. * * @var \Webkul\Velocity\Repositories\VelocityMetadataRepository */ protected $velocityMetadataRepository; /** - * Create a helper instamce + * List of all default locale images for velocity. + * + * @var array + */ + protected $defaultLocaleImageSources = [ + 'de' => '/themes/velocity/assets/images/flags/de.png', + 'en' => '/themes/velocity/assets/images/flags/en.png', + 'es' => '/themes/velocity/assets/images/flags/es.png', + 'fr' => '/themes/velocity/assets/images/flags/fr.png', + 'nl' => '/themes/velocity/assets/images/flags/nl.png', + 'tr' => '/themes/velocity/assets/images/flags/tr.png' + ]; + + /** + * Create a helper instance. * * @param \Webkul\Product\Contracts\Product $productModel * @param \Webkul\Velocity\Repositories\OrderBrandsRepository $orderBrands * @param \Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository * @param \Webkul\Product\Repositories\ProductReviewRepository $productReviewRepository * @param \Webkul\Velocity\Repositories\VelocityMetadataRepository $velocityMetadataRepository - * * @return void */ public function __construct( @@ -100,7 +113,9 @@ class Helper extends Review } /** - * @param \Webkul\Sales\Contracts\Order $order + * Top brand. + * + * @param \Webkul\Sales\Contracts\Order $order * * @return void */ @@ -118,11 +133,14 @@ class Helper extends Review 'product_id' => $orderItem->product_id, 'brand' => $products[$key]->brand, ]); - } catch(\Exception $exception) {} + } catch (\Exception $exception) { + } } } /** + * Get brands with categories. + * * @return \Illuminate\Support\Collection|\Exception */ public function getBrandsWithCategories() @@ -139,11 +157,11 @@ class Helper extends Review $categoryName = $brandName = $brandImplode = []; - foreach($product_categories as $totalData) { + foreach ($product_categories as $totalData) { $brand = $this->attributeOptionRepository->findOneWhere(['id' => $totalData['brand']]); foreach ($totalData['categories'] as $categories) { - foreach($categories['translations'] as $catName) { + foreach ($categories['translations'] as $catName) { if (isset($brand->admin_name)) { $brandData[$brand->admin_name][] = $catName['name']; $categoryName[] = $catName['name']; @@ -154,21 +172,21 @@ class Helper extends Review $uniqueCategoryName = array_unique($categoryName); - foreach($uniqueCategoryName as $key => $categoryNameValue) { - foreach($brandData as $brandDataKey => $brandDataValue) { - if(in_array($categoryNameValue,$brandDataValue)) { + foreach ($uniqueCategoryName as $key => $categoryNameValue) { + foreach ($brandData as $brandDataKey => $brandDataValue) { + if (in_array($categoryNameValue, $brandDataValue)) { $brandName[$categoryNameValue][] = $brandDataKey; } } } - foreach($brandName as $brandKey => $brandvalue) { - $brandImplode[$brandKey][] = implode(' | ',array_map("ucfirst", $brandvalue)); + foreach ($brandName as $brandKey => $brandvalue) { + $brandImplode[$brandKey][] = implode(' | ', array_map("ucfirst", $brandvalue)); } return $brandImplode; } - } catch (Exception $exception){ + } catch (\Exception $exception) { throw $exception; } } @@ -213,21 +231,25 @@ class Helper extends Review } /** + * Get shop recent views. + * * @param int $reviewCount * @return \Illuminate\Support\Collection */ public function getShopRecentReviews($reviewCount = 4) { $reviews = $this->productReviewRepository - ->getModel() - ->orderBy('id', 'desc') - ->where('status', 'approved') - ->take($reviewCount)->get(); + ->getModel() + ->orderBy('id', 'desc') + ->where('status', 'approved') + ->take($reviewCount)->get(); return $reviews; } /** + * Get json translations. + * * @return array */ public function jsonTranslations() @@ -248,6 +270,8 @@ class Helper extends Review } /** + * Format cart item. + * * @param \Webkul\Checkout\Contracts\CartItem $item * @return array */ @@ -268,10 +292,11 @@ class Helper extends Review } /** + * Format product. + * * @param \Webkul\Product\Contracts\Product $product * @param bool $list * @param array $metaInformation - * * @return array */ public function formatProduct($product, $list = false, $metaInformation = []) @@ -314,13 +339,13 @@ class Helper extends Review 'addWishlistClass' => ! (isset($list) && $list) ? '' : '', 'showCompare' => core()->getConfigData('general.content.shop.compare_option') == "1" - ? true : false, + ? true : false, 'btnText' => (isset($metaInformation['btnText']) && $metaInformation['btnText']) - ? $metaInformation['btnText'] : null, + ? $metaInformation['btnText'] : null, 'moveToCart' => (isset($metaInformation['moveToCart']) && $metaInformation['moveToCart']) - ? $metaInformation['moveToCart'] : null, + ? $metaInformation['moveToCart'] : null, 'addToCartBtnClass' => ! (isset($list) && $list) ? 'small-padding' : '', ])->render(), @@ -328,14 +353,13 @@ class Helper extends Review } /** - * Returns the count rating of the product + * Returns the count rating of the product. * * @param $items * @param $separator - * * @return array */ - public function fetchProductCollection($items, $moveToCart = false, $separator='&') + public function fetchProductCollection($items, $moveToCart = false, $separator = '&') { $productIds = collect(explode($separator, $items)); @@ -359,4 +383,34 @@ class Helper extends Review } })->toArray(); } + + /** + * Get current locale image source. + * + * @return string + */ + public function getCurrentLocaleImageSource(): string + { + $localeImages = core()->getCurrentChannel()->locales()->pluck('locale_image', 'code'); + + $currentLocaleImage = $localeImages[app()->getLocale()] ?? null; + + return $currentLocaleImage + ? Storage::url($currentLocaleImage) + : $this->getDefaultImageSourceOfCurrentLocale(); + } + + /** + * Get default image source of current locale. + * + * @return string + */ + public function getDefaultImageSourceOfCurrentLocale(): string + { + $currentLocale = app()->getLocale(); + + return isset($this->defaultLocaleImageSources[$currentLocale]) + ? asset($this->defaultLocaleImageSources[$currentLocale]) + : ''; + } } diff --git a/packages/Webkul/Velocity/src/Resources/lang/nl/app.php b/packages/Webkul/Velocity/src/Resources/lang/nl/app.php index 6c8e9f684..dc8eb36d5 100644 --- a/packages/Webkul/Velocity/src/Resources/lang/nl/app.php +++ b/packages/Webkul/Velocity/src/Resources/lang/nl/app.php @@ -83,9 +83,9 @@ return [ ], 'datagrid' => [ 'id' => 'Id', - 'title' => 'Title', + 'title' => 'Titel', 'status' => 'Status', - 'position' => 'Position', + 'position' => 'Positie', 'content-type' => 'Content Type', ] ], @@ -99,8 +99,8 @@ return [ 'sidebar-categories' => 'Sidebar categorieƫn', 'header_content_count' => 'Header Content Count', 'footer-left-raw-content' => '
We houden ervan om software te maken en de echte wereldproblemen met de binaire bestanden op te lossen. We zijn zeer toegewijd aan onze doelen. We investeren onze middelen om gebruiksvriendelijke software en applicaties van wereldklasse te creƫren met de allerbeste, geavanceerde technologie-expertise.
', - 'slider-path' => 'Schuifpad', - 'category-logo' => 'Category logo', + 'slider-path' => 'Slider link', + 'category-logo' => 'Categorie logo', 'product-policy' => 'Product Policy', 'update-meta-data' => 'Update Meta Data', 'product-view-image' => 'Product View Image', @@ -109,18 +109,18 @@ return [ 'footer-middle-content' => 'Footer Middle Content', 'advertisement-four' => 'Advertisement Four Images', 'advertisement-three' => 'Advertisement Three Images', - 'images' => 'Images', - 'general' => 'General', - 'add-image-btn-title' => 'Add Image', + 'images' => 'Afbeeldingen', + 'general' => 'Algemeen', + 'add-image-btn-title' => 'Afbeelding toevoegen', 'footer-middle' => [ - 'about-us' => 'About Us', - 'customer-service' => 'Customer Service', - 'whats-new' => 'What\'s New', - 'contact-us' => 'Contact Us', - 'order-and-returns' => 'Order and Returns', - 'payment-policy' => 'Payment Policy', - 'shipping-policy' => 'Shipping Policy', - 'privacy-and-cookies-policy' => 'Privacy and Cookies Policy' + 'about-us' => 'Over ons', + 'customer-service' => 'Klantendienst', + 'whats-new' => 'Laatste nieuws', + 'contact-us' => 'Contacteer ons ', + 'order-and-returns' => 'Bestellingen en retourneren', + 'payment-policy' => 'Betalen ', + 'shipping-policy' => 'Verzenden', + 'privacy-and-cookies-policy' => 'Privacy- en cookiebeleid' ] ], 'category' => [ @@ -203,16 +203,16 @@ return [ 'customer' => [ 'compare' => [ - 'text' => 'Compare', - 'compare_similar_items' => 'Compare Similar Items', - 'add-tooltip' => 'Voeg product toe aan vergelijkingslijst', - 'added' => 'Item successfully added to compare list', - 'already_added' => 'Item already added to compare list', - 'removed' => 'Item successfully removed from compare list', + 'text' => 'Vergelijken', + 'compare_similar_items' => 'Vergelijk vergelijkbare items ', + 'add-tooltip' => 'Voeg product toe aan de vergelijkingslijst', + 'added' => 'Artikel succesvol toegevoegd aan de vergelijkingslijst ', + 'already_added' => 'Dit artikel is al toegevoegd aan de vergelijkingslijst ', + 'removed' => 'Item succesvol verwijderd uit vergelijkingslijst ', 'removed-all' => 'Alle items zijn met succes verwijderd uit de vergelijkingslijst', - 'empty-text' => "You don't have any items in your compare list", - 'product_image' => 'Product Image', - 'actions' => 'Actions', + 'empty-text' => 'U heeft geen artikelen in uw vergelijkingslijst ', + 'product_image' => 'Artikel afbeelding', + 'actions' => 'Acties', ], 'login-form' => [ 'sign-up' => 'Registreren', @@ -251,7 +251,7 @@ return [ 'details' => 'Details', 'reviews-title' => 'Reviews', 'reviewed' => 'Reviewed', - 'review-by' => 'Review by', + 'review-by' => 'Review door', 'quick-view' => 'Quick View', 'not-available' => 'Niet beschikbaar', 'submit-review' => 'Review versturen', @@ -264,7 +264,7 @@ return [ 'short-description' => 'Korte omschrijving', 'recently-viewed' => 'Recent bekeken producten', 'be-first-review' => 'Wees de eerste om een review te schrijven.', - 'tax-inclusive' => 'Inclusive of all taxes', + 'tax-inclusive' => 'Inclusief BTW', ], 'shop' => [ diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/layouts/top-nav/locale-currency.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/layouts/top-nav/locale-currency.blade.php index fd7ebd6d7..1c7654347 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/layouts/top-nav/locale-currency.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/layouts/top-nav/locale-currency.blade.php @@ -27,23 +27,9 @@ {!! view_render_event('bagisto.shop.layout.header.locale.before') !!}