Jump to content
thirty bees forum

Translations missing over and over again


Recommended Posts

Posted

Hi,

Do you know if is there any bug in TB translations? I have translate to my language some texts several times but suddenly I find them in English once again.

I translate texts in TB menu Location/Translations. Do you think is better to do it in the files through FTP?

Thanks in advance!

Posted

It is hard to do it in the files as they don't contain the original text but only some hash.

For me and most people translations work ok. The only annoying thing is that you need translate a word like "order" dozens of times  - once for each place where it is present in the code. I have been considering writing something for it in Prestools but it has low priority.

If you have a problem that when you translate some text at some location and that translation is later reverted it would help if you could provide a concrete example. Only with such reports people can try to reproduce your problem.

 

 

  • Like 1
Posted

Problem is that currently just 4 languages are nearly full translated (German, Italian, Slovenian and Russian), followed by Dutch, Hebrew, Portuguese and Spanish. What is your language, and which items did you translate and were afterwards displayed in English again? You should know that custom translations for mails and modules are stored to the theme directory, not to the original files.

Posted
4 hours ago, Occam said:

What is your language, and which items did you translate and were afterwards displayed in English again?

My language is Spanish.

The attached picture is a category. I've maked in red colour the texts that I've translated several times.

Captura de pantalla 2019-11-28 a las 23.51.07.png

Posted
6 hours ago, musicmaster said:

If you have a problem that when you translate some text at some location and that translation is later reverted it would help if you could provide a concrete example. Only with such reports people can try to reproduce your problem.

It's difficult to know when the translations are reverted, I always realize it days after I've translated it and checked that it works, but I'll observe it.

Posted (edited)
1 hour ago, wakabayashi said:

Are you talking about the BO? In the version I use, there is a bug for BO translations.

Yes, I make the translations in BO.

I'm using TB 1.1.0

Edited by lixotuka
Posted (edited)

I checked it. Currently 88% of thirty bees is translated into Spanish, which means that a few thousand of items are still displayed in English. But this does not apply to the examples you gave. The sort order is completely translated. Labels like Sale or New may have to be translated in the module's section, too.

The translation for the availability label, however, has to be translated for each product separately in the products section of the BO, tab Quantity. If you have many products the only way to simplify this would be a change via SQL command or the use of @musicmaster's Prestools for a global change.

Currently the handling of 3rd party themes like yours is buggy. So I'd suggest to automatically import the Spanish language in 

locations --> translations

into all themes. And to avoid the behavior you described, you should always make a backup copy of the folder

themes --> <your theme> --> lang,

or at least the es.php file you find there, after your own translations. Until the bugs are fixed, it is recommended to always upload this updated version to the themes default-bootstrap and Niara.

Edited by Occam
Posted

Your problem may be caused by Template Compilation setting in Performance.

When you reopen your translations page you see an old copy with the old strings, when you click save they are written down together with your new changes.
 

You should keep this at "Recompile if changed" setting to avoid this issue. The "Recompile always" will give large performance penalty and thus is not for 'production' and only for editing and fixing period.

Hope this makes sense!

  • Like 1
Posted

I would give it another try since I see it as Rampage suggested. I had his problem often in the last 8 years and always it was related to caching problems.

(These are not only the settings you set in your BO but also those used by your '
host'. In my case I I had issues some times in the past with php additions like APC and OPcache. Also with activated mod_pagespeed  I had issues. But all this is not my domain but if you know those terms and know where to de-/activate them you could give it a try.)

Make also sure that in your performance settings cache (APC etc.) and full page caching (both more at the bottom part of performance settings) are disabled for testing your problem. I had excactly the same problems as said and sometimes a translations appeared correctly literally the next day on front/back.

  • 1 year later...
Posted

This tutorial from 2017 most likely will work for you.

But its not a recommended way of doing it, because it requires modifying core files.

I suggest (until proper fix will be implanted in core) doing some hack with javascript.

Posted
7 hours ago, yaniv14 said:

This tutorial from 2017 most likely will work for you.

I suggest (until proper fix will be implanted in core) doing some hack with javascript.

That's why I suggest this (or some other solution) to be in next release. With javascript I have 0 experience. So I think I will do this to my shop and try to remember do it again after update.

Posted (edited)

if you only need it in product page, so you can try adding this code to the bottom of "themes/niara/js/product.js"

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('per meeter', 'for meter');
    } else if (lang === 'tk') {
		document.querySelector('.unit-price').innerHTML = document.querySelector('.unit-price').innerHTML.replace('per meeter', 'for meter in tk');
    }
});

 

Edited by yaniv14
Posted

So the original is in my language and replacement will happen when language is set to en-us ?

And if there is need for another replacement (tk  -> pc for example)  then I need to add only last row which begin with  document.querySelector...

Posted

Ok. Will try it.

tk is not language, it is another unit what is needed to translate. In english it is piece. Anyway thank You very much for Your time.

Posted

@led24ee in case you don't have this in every product page you should protect the code a bit.

you should wrap it inside a condition.

like:

window.addEventListener('DOMContentLoaded', (event) => {
    if (document.querySelector('.unit-price')) {
	.... rest of code ...
    }
});

 

Posted (edited)

Why is this necessary ? I mean if there isn't this then what will go wrong or what is not happening ?

Edited by led24ee
typo
Posted

@led24ee It is necessary because you might get a javascript error.

document.querySelector('.unit-price').innerHTML -> "innerHTML" is a property of an object, and if the object does not exists then the property cannot be called.

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...