Git Product home page Git Product logo

Comments (10)

aimeos avatar aimeos commented on May 18, 2024 1

The problem why "price:default" is shown is simply because there's no translation in Chinese available. It should be something like %1$s %2$s or %2$s %1$s depending on where the currency symbol should be shown (%1 is the price and %2 is the currency symbol).

You can change the translation locally (https://aimeos.org/docs/Laravel/Overwrite_translations) but should translate the missing strings for Chinese in Transifex: https://www.transifex.com/aimeos/public/

from aimeos-laravel.

aimeos avatar aimeos commented on May 18, 2024 1

Did you enter the /myaccount URL by hand? If you add the prefix to its route, your URL must then be /zh_CN/CNY/myaccount (including the language and currency codes). Otherwise, the Laravel router won't be able to match the route any more.

from aimeos-laravel.

aimeos avatar aimeos commented on May 18, 2024

OK, step by step:

By default the first active site/language/currency combination listed in the "Locale" -> "List" tab of the expert mode admin interface will be shown in the frontend. If you haven't disabled the caching for development (https://github.com/aimeos/aimeos-laravel#hints), you will need to clear the cache using "./artisan aimeos:cache".

Afterwards, you should see the first configured language/currency in the frontend. Is this the case?

from aimeos-laravel.

dadaycm avatar dadaycm commented on May 18, 2024

Thank you so much for your quickly reply.

Yes, I have disabled the caching for development already. Exactly following doc to append that section in the end of config file.

  • Following your suggestion, I adjusted the value of position to make sure that combination Chinese/CNY is the first active. Now from the list page, Product name is shown as Chinese, exactly as expected, perfect!
  • But, price is displayed as plain text instead of a number which is set at admin panel.
  • After setting language/currency back to English/Euro from admin, then visiting front end, product price are displayed normally ( as number) once again.
  • Prefix bug keeps the same. Once the routes/page 'prefix' => '{locale}/{currency}', is assigned to the page, it can not be visited. please see attached config file: shop.php.txt

Attached screenshot may be helpful if my description is not clear.

  1. Price setting from admin
    price
  2. Set Local to make CNY first
    local-cn-first
  3. List page : unexpected price display
    list-cny
  4. Set Local back to English/Euro first
    local-eng-euro-first
  5. List page: normal price display
    list-english-euro
  6. Prefix bug -- myaccount page
    myaccount-prefix-route-bug

from aimeos-laravel.

dadaycm avatar dadaycm commented on May 18, 2024

One more discovery about locale select component:
Three points have not been synchronized in:

  • URL
  • locale/select component
  • product name/price

Steps:

  1. Comment out the prefix line'prefix' => '{locale}/{currency}' in config file.
  2. Add locale/select comment to page catelog/list in both config file and page template.
  3. visit catelog/list page and the locale/select component is shown and can be operated.
  4. Change value by operate catelog/select component to select English/Euro and observe three things:
  5. URL
  6. locale/select component
  7. product name/price

Expecation:

when selection from locate/select component changes, the URL line and product item name/price will be changed accordingly.

  • URL English/Euro
  • locale/select component English/Euro
  • product name/price English/Euro

Result:

Three parts are not synchronized as expected.
Most unexpected is that, the component itself is shown to other value which is very different from what is intented.
Please see attached screen shot.

list-local3-no-sync

from aimeos-laravel.

aimeos avatar aimeos commented on May 18, 2024

/list?locale=zh_CN&currency=CNY is not accepted in your setup because only route parameters are currently evaluated, so only /zh_CN/CNY/list works.
We changed the code to use the query parameters in the future as well: 585a697

from aimeos-laravel.

dadaycm avatar dadaycm commented on May 18, 2024

Thanks for your response.

Unfortunately, the url format what you suggested as below does NOT work.
/zh_CN/CNY/myaccount
/en/EUR/myaccount
Neither of the above works. Error was reported as:

Sorry, the page you are looking for could not be found.
1/1 NotFoundHttpException in RouteCollection.php line 161:

Let me answer your question below:

Did you enter the /myaccount URL by hand?

No. The url /myaccount?locale=en&currency=EUR was not entered by hand, but genereated by browser after locale/select comonent is operated. When new language/currency combination is selected, the url from browser is changed automatically.
Thanks.

from aimeos-laravel.

aimeos avatar aimeos commented on May 18, 2024

Do you still have the 'prefix' => '{locale}/{currency}' configuration in your "routes/account" section of your config/shop.php?

from aimeos-laravel.

dadaycm avatar dadaycm commented on May 18, 2024

Do you still have the 'prefix' => '{locale}/{currency}' configuration in your "routes/account" section of your config/shop.php?

Of course no. If they were there, it would have failed to visit the page/myaccount.
Let me make it more clear:
the following two URLs, pages FAIL to be loaded:

/zh_CN/CNY/myaccount
/en/EUR/myaccount

while the following two URLs, pages CAN be displayed although logic is unexpected:

/myaccount?locale=en&currency=EUR
/myaccount

Thanks.

from aimeos-laravel.

aimeos avatar aimeos commented on May 18, 2024

For /zh_CN/CNY/myaccount you have to add the prefix. Otherwise, it won't work at all.

from aimeos-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.