Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    About Translation and its variables

    Bug Report
    2
    3
    325
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • HombreGeek
      HombreGeek last edited by

      Right now I am translating Bagisto's front-end into Spanish language, and I found the word "Quantity" shown in the shopping cart, it was in hard code. The word is in the file:

      packages\Webkul\Shop\src\Resources\views\checkout\cart\mini-cart.blade.php
      

      In the following line 82 of code:

      <div class="item-qty">Quantity - {{ $item->quantity }}</div>
      

      To solve this, I replaced the word "Quantity" with the following:

      {{ __('shop::app.checkout.cart.quantity.quantity') }}
      

      Remaining line 82 of the code as follows:

      <div class="item-qty">{{ __('shop::app.checkout.cart.quantity.quantity') }} - {{ $item->quantity }}</div>
      

      In this way I have managed to take the translation corresponding to the Spanish language from "Quantity" to "Cantidad"

      Please change that line for future updates, if I find other lines of code the same I will report them here.

      Have a nice day!

      1 Reply Last reply Reply Quote 0
      • P
        prateek-webkul last edited by

        @HombreGeek Thanks for your suggestion and cooperation.

        1 Reply Last reply Reply Quote 0
        • HombreGeek
          HombreGeek last edited by HombreGeek

          @prateek-webkul Hello! I hope everythings is ok with you.

          Continuing the work with my spanish translation I've found another issue, that you should be considered.

          As an Admin trying to edit a customer, to change his o her status to active or inactive; This part shows a two a hard core words, "Actived" and "Blocked".

          This two words came from this file:

          packages\Webkul\Admin\src\DataGrids\CustomerDataGrid.php
          

          in the lines 82 and 85, as followings:

          'wrapper' => function ($row) {
             if ($row->status == 1) {
                  return 'Activated';  // line 82 inm CustomerDataGrid.php
             } else {
                  return 'Blocked';  // line 85 in CustomerDataGrid.php
             }
          }
          

          To be able to change this two word my spanish language, I did the following:

          'wrapper' => function ($row) {
             if ($row->status == 1) {
                  return trans('admin::app.datagrid.active');  // line 82 replaced
             } else {
                  return trans('admin::app.datagrid.inactive');  // line 85 in CustomerDataGrid.php
             }
          }
          

          Then I added these two properties - values pairs in the datagrid array, which is in my spanish translation file:

          packages\Webkul\Admin\src\Resources\lang\es\app.php
          
          'datagrid' => [
          .
          .
          .
          
          'active' => 'Activo',
          'inactive' => 'Inactivo',
          
          .
          .
          .
          ],
          

          Please consider it to future updates to make easier the translation to other language.

          Have nice day!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post