What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello all, I have a problem with TransChoice This piece of code : ``` {% transchoice r

UM9F81RCP
UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello all,

I have a problem with TransChoice

This piece of code :


Is showing :

5 product_review.summary.star | product_review.summary.stars    

Instead of 5 Stars

Any idea what could be the reason?

Comments

  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet

    seems lke the glossary translations are missing. you probably have to trigger the storage export (again), given that translations haved already been created.

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    actually when I search for the glossary in Zed I find it πŸ˜•

  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet

    but most likely not in Redis ...

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    why only these two ?!

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I will try to put a translation that I am sure I see

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    πŸ˜„

  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2019

    either run vendor/bin/console sync:data or even vendor/bin/console event:trigger -r translation to force publish/sync again (don't forget to run the queue worker, if it is not already)

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am trying now

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks πŸ™‚

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    when I run this vendor/bin/console event:trigger translation

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    i get an error

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet
    Symfony\Component\Console\Exception\RuntimeException - Exception: Too many arguments, expected arguments "command".
    in /data/shop/development/current/vendor/symfony/console/Input/ArgvInput.php (188)
    
    Command: vendor/bin/console event:trigger translation
    
  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet

    sorry, it's actually vendor/bin/console event:trigger -r translation

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I see

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I dont think this will solve the problem

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    because just now I tried to use two different translations that I am sure they are loaded

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    and again I see the same result ```
    5 product_review.summary.title | product_review.summary.reviews

    ```

  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet

    πŸ€”

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    so solution was to use this instead:

    {{"product_review.summary.star|product_review.summary.stars"|transchoice(rating) }}

  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet

    πŸ‘

  • UKHQ50XFX
    UKHQ50XFX Posts: 31 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2019

    I actually never used transchoice before ...