1

I'm here

enter image description here

I need to create a link to three languages. for example

<div class="link">
  <div class="1_link">
    <a href="/en/link/1"> Link 1 </a>  
  </div>
  <div class="2_link">
    <a href="/en/link/1"> Link 2 </a>    
  </div>
  <div class="3_link">
    <a href="/en/link/1"> Link 3</a>  
  </div>
</div>

other in Spanish

<div class="link">
  <div class="1_link">
    <a href="/pt-br/link/1"> Link 1 </a>  
  </div>
  <div class="2_link">
    <a href="/pt-br/link/1"> Link 2 </a>    
  </div>
  <div class="3_link">
    <a href="/pt-br/link/1"> Link 3</a>  
  </div>
</div>

In Portuguez

<div class="link">
      <div class="1_link">
        <a href="/pt-br/link/1"> Link 1 </a>  
      </div>
      <div class="2_link">
        <a href="/pt-br/link/1"> Link 2 </a>    
      </div>
      <div class="3_link">
        <a href="/pt-br/link/1"> Link 3</a>  
      </div>
    </div>

When I go to the block to see its links, by default it always appears / link / 1 no matter what language I am in.

It does not take in language: it ES or EN o PT-BR

Link 1 --> hover url = http://url_site/link/1 in any language.

should be

Link 1 --> hover url = http://url_site/en/link/1 OR Link 1 --> hover url = http://url_site/es/link/1 Link 1 --> hover url = http://url_site/pt-br/link/1

enter image description here

configuration of my block.

1 Answer 1

1

To do this for custom blocks, you will need to enable translations for blocks and custom blocks in the settings. Then you will need to create translations (with the correct links) for each language.

Details:

  • Go to /admin/config/regional/content-language
  • Make sure custom blocks is selected at the top.
  • Save
  • Scroll down to Custom Block section
  • Make sure the basic block and at least the title and body fields are translatable.

To Edit the block.

  • Go to the Custom Block library
  • The Edit drop down should have a translate option
  • Select this and in the translate screen, create a translation.
  • Edit for the needed language.

Result is that if you are looking at a page for lang X and there is a lang X block translation. You will see this block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.