BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 37 forks source link

Cutting locale string from thumbnail urls #85

Closed evertalbers closed 7 years ago

evertalbers commented 8 years ago

Images created by a Bolt image/thumbnail in a translated page get urls like e.g. /thumbs/250x100c/stock_images_490px/onshore_wind_turbines2.jpg?_locale=en

If I see it correctly, the ?_locale=en triggers browsers to reload them when you switch locales, while the image is the same - and is already in the cache.

Is there a trick to omit the ?_locale=en?

SvanteRichter commented 8 years ago

Hmm, I think we need to do some check here: https://github.com/AnimalDesign/bolt-translate/blob/master/src/Routing/LocalizedUrlGenerator.php#L38-L40 to ensure that we only add the _locale param to content routes, not to thumb routes...

evertalbers commented 8 years ago

Hope that I'm not supposed to be part of the 'we' here :-)

SvanteRichter commented 8 years ago

@evertalbers haha, no, I'll have a closer look at it soon :)

madc commented 7 years ago

I've been having a quick look and can not reproduce this issue. @evertalbers Can you provide additional information? Where do you see this link, what twig functions/filters are you using?

evertalbers commented 7 years ago

An example: on http://greendev.profin.nl/nl/pagina/insurance-due-diligence the image has url http://greendev.profin.nl/thumbs/970x332c/stock_images_490px/onshore_wind_turbines2.jpg?_locale=nl

The twig code is

<img src="{{ record.image1|image(970,332, "c") }}" alt="{{record.title}}">

Bolt 3.1.4 - Translate dev-master (cc99e0) (client takes forever to decide to go live :-/ )

madc commented 7 years ago

You're right. There it is. I've only tested it on the current bolt-stable (3.2.x), where it does not show this behaviour.

SvanteRichter commented 7 years ago

Closing this as it only happens on an unsupported version of bolt (bolt 3.1 stopped receiving updates/support as soon as 3.2 was released). Please reopen if you see it on a currently supported bolt version!