Oneboxes text not translated

AI-generated summary

A user, vulkanino, reported an issue with Onebox text not being translated on their Discourse installation. They shared screenshots showing that the “Reading time” string at the bottom of the Onebox is in English, even though the translation is available. codinghorror suggested reaching out to techAPJ, who built the Onebox feature.

techAPJ replied that the translation should be working and asked vulkanino to check their instance’s translation settings. vulkanino confirmed that their instance is fully translated, but techAPJ suggested that the “Set locale from accept language header” setting might be the cause. vulkanino disabled the setting, but the issue persisted.

techAPJ advised vulkanino to onebox the topic again by adding ?1 to the URL to see the translated Onebox in action.

Hey all,

when I paste a link from the same Discourse installation domain, I get a nice (onebox?) summary.

At the bottom a line reports the reading time, but the string is not translated into my installation language.

In Transifex the string is translated:

Also there’s an [image] text tag at the beginning of the box.

Why :question:

Perhaps @techapj can assist as he built this feature. The translation would be in the onebox project though.

Hi @vulkanino,

String “Reading time” should be getting localized.

I looked at your Discourse instance:

http://rasando.it/t/le-pere-lucien/124

and noticed that translation is not working at all. Notice the Sign Up / Login button text, footer notice. Everything is in English. Why is that? Once we figure that out the original issue you reported should be fixed.

It is fully translated! Maybe Discourse finds your browser or system language and adapts to it?

Do you have this setting enabled: set locale from accept language header

If yes, then that must be why “Reading time” is not getting translated, because the onebox makes anonymous request.

I had the option enabled but I don’t think that’s the problem. Now I have disabled it and the onebox still shows the text in English.

This is the topic, please check:

http://rasando.it/t/maggio-2016/639/3

You will need to onebox the topic again (add ?1 at the end of the URL). See translated onebox in action here:

http://rasando.it/t/le-pere-lucien/124