Jump to content
thirty bees forum

Translations missing over and over again


lixotuka

Recommended Posts

This translation is not working. Or at least there is no visible change. There is also no error.  Is this related to TB version or PHP version ? Earlier was TB 1.1 and PHP 7.3 ow it is TB1.5.1 and PHP 8.3.19

Link to comment
Share on other sites

@led24ee could you describe the bug you experience with translations? You know that currently the save button only saves the section above it (due to large number of fields in this part of thirty bees this was introduced to get around the timeouts that were common). If you translate lets say 3 modules and only click the last button you will save the last module, same with all other types.

If you can describe your issue it will be easier to help.

Link to comment
Share on other sites

Well, this was never translatable (if this is correct word) but I need to show price for one item. And under products section "Price" there is place for this unit (piece, meter, pack, etc) but there isn't possibility to translate this. This is also reason why I asked this many year ago. But at the moment this isn't working anymore.

Link to comment
Share on other sites

It looks like google analytic module has some broken js code that prevent other js code to run.

try disabling the google analytic module, and see if the issue from this ticket is working.

Link to comment
Share on other sites

you js code is broken

window.addEventListener('DOMContentLoaded', (event) => {
    const lang = document.documentElement.getAttribute('lang');
    if (lang === 'en-us') {
        document.querySelector('.unit-price').innerHTML = document.querySelector('.unit-price').innerHTML.replace('/ meeter', 'per meter');
    } else if (lang === 'en-us') {
		    document.querySelector('.unit-price').innerHTML = document.querySelector('.unit-price').innerHTML.replace('tk', 'pc.');
    }
}

you are missing ) at the end, it should be like that

window.addEventListener('DOMContentLoaded', (event) => {
    const lang = document.documentElement.getAttribute('lang');
    if (lang === 'en-us') {
        document.querySelector('.unit-price').innerHTML = document.querySelector('.unit-price').innerHTML.replace('/ meeter', 'per meter');
    } else if (lang === 'en-us') {
		    document.querySelector('.unit-price').innerHTML = document.querySelector('.unit-price').innerHTML.replace('tk', 'pc.');
    }
})

 

Link to comment
Share on other sites

Posted (edited)

Code works until "else if." if I replace these lines what should be changed then first one works.

 

EDIT : It works so also with google analytics enabled. So for me it looks like there is something wrong with this code. Unfortunately my skills aren't enough to fix it.

Edited by led24ee
Link to comment
Share on other sites

if you only care about changing the text when you are in English than you dont need the else condition, assuming that your original text is always in the none English language.

you just need to place whatever you want to replace.

window.addEventListener('DOMContentLoaded', (event) => {
  const lang = document.documentElement.getAttribute('lang');
  if (lang === 'en-us') {
    const htmlEL = document.querySelector('.unit-price');
    const curHtml = htmlEL.innerHTML;
    htmlEL.innerHTML = curHtml.replace('/ meeter', 'per meter').replace('tk', 'pc.');
  }
});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...