Hello
I need translate text for search block to spanish

what is the problem?

When you perform the translation, the icon disappears glyphicon-search

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

spyderp created an issue. See original summary.

jorgediazhav’s picture

I can confirm so, but not only when you switch to Spanish.

If you show the default language and then switch to the secondary, you will get the same issue. Clearing the caches inverts the appearance of the issue.

The variable

{{ icon }}

Is arriving in blank to the file /templates/input/input--button.html.twig

Hope this helps to debug.

jorgediazhav’s picture

OK, figured out. Thanks a lot to @vasi for assisting figuring it out as it was hard to debug.

The Theme Cache was storing the glyphicon matching array on the first cache load, so: First Language loaded, first language with glyphicons, the rest were out.

I made the Cache language dependent. It was:

$texts = $theme->getCache('glyphiconFromString');

and now it is:

$texts = $theme->getCache('glyphiconFromString' . $lang_code);

Review Appreciated!

jorgediazhav’s picture

Status: Active » Needs review
markhalliwell’s picture

Version: 8.x-3.0-beta3 » 8.x-3.x-dev
Component: Templates » Code
Status: Needs review » Needs work
Issue tags: -content translate

I'd rather language (and potentially other needed context) be built into the cache class itself rather than having to figure out/remember where language specifics are needed.

jorgediazhav’s picture

I don't get the idea... :(

I'm more than willing to work on it.

jorgediazhav’s picture

OK, it is moved now into the Theme Cache manager. I guess it is what you mean. Thanks @vasi again.

jorgediazhav’s picture

Status: Needs work » Needs review
markhalliwell’s picture

Status: Needs review » Needs work

Originally, yes... that is what I meant. However, upon reviewing what all is using this, it doesn't always make sense to append this for every StorageCacheItem. Perhaps a hybrid of the two. I'll submit a patch shortly.

markhalliwell’s picture

Status: Needs work » Needs review
FileSize
3.1 KB

Try this.

jorgediazhav’s picture

Works great! Tested!

jorgediazhav’s picture

Status: Needs review » Reviewed & tested by the community

  • markcarver committed b007bb2 on 8.x-3.x
    Issue #2687813 by jorgediazhav, markcarver, spyderp: Translate search...
markhalliwell’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sneo’s picture

Having the same issue on bootstrap 8.x-3.3 #3 solved it. :s