led24ee Posted June 1 Posted June 1 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
the.rampage.rado Posted June 1 Posted June 1 @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.
led24ee Posted June 1 Posted June 1 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.
yaniv14 Posted June 1 Posted June 1 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.
yaniv14 Posted June 1 Posted June 1 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.'); } })
yaniv14 Posted June 1 Posted June 1 @led24ee it also looks like your matomo module has some broken code. try disabling matomo as well.
led24ee Posted June 1 Posted June 1 (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 June 1 by led24ee
yaniv14 Posted June 2 Posted June 2 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.'); } });
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now