Forecast language

Is it possible for me to edit something, so i can get the forecast days in Norwegian?

You need to enabled internationalisation of dates in the CMS settings, set the CMS default language to be Norwegian (both are covered in the CMS Post Installation Guide stickied on the front page of the site).

Then override the template for the Forecast media as described here:

I’m sorry. Maybe I’m doing this wrong, but when editing the CSS, the layout becomes totally wrong. It says EuropeOslo/Oslo instead of “days”

You should be editing the HTML in the template, not the CSS? You also need to ensure you’ve ticked the box to enable internationalised dates in the CMS settings, and that you have the php-intl module installed and loaded.

I have enabled " internationalised dates"

I can’t see that the php-intl module is installed and it’s not available to install. I only se the twitter module available to be installed. When I edit enter the template, choose “Appearance” then ticked the box to “Override the template” then edit HTML like instructed, I only get “EuropeOslo/Oslo”

php-intl is part of PHP and needs to be enabled on your PHP installation

Ok. This is where I might have a problem, because my Xibo installation is installed on a webserver host, not locally

In that case you can’t use internationalised dates and will need to turn the option off. You won’t be able to have localised names for the days of the week without that support.

Is there a way for me check if this is installed, or somewhere I can install this or activate it?

You can see if it’s installed on the Report Fault page. It would have also told you when you installed.

To enable it you need to change the configuration on the server to enable it.

If my web host can enable this for me, what should I ask for to be configured?

You need them to enable the php intl module. That’s all it’s called.

My CMS is hosted in a Webserver too, and they won’t solve the INTL problem. So I’m testing the following script:

<script>
function foo() {
    var str = document.getElementById("body").innerHTML; 
    
var mapObj = {
   Sunday:"Domingo",
   Monday:"Segunda",
   Tuesday:"Terça",
   Wednesday:"Quarta",
   Thursday:"Quinta",
   Friday:"Sexta",
   Saturday:"Sabado",
   Sun:"Dom",
   Mon:"Seg",
   Tue:"Ter",
   Wed:"Qua",
   Thu:"Qui",
   Fri:"Sex",
   Sat:"Sab"
};
str = str.replace(/Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat/g, function(matched){
  return mapObj[matched];
});

document.getElementById("body").innerHTML = str;
}
</script>

Basically, I replaced the weekdays by my Own. For the template with the circle, so far is working fine.

1 Like

@ilges that looks good - it would be hard for us to use that generically, but it is certainly worthwhile sharing it for people to use as a workaround.

I’ve just formatted the post a bit so its easier for people to see.

Thanks!

1 Like

Uma pergunta, como onde eu insiro esse script acima da tradução dos dias da semana?

Você coloca o código na hora em que for adicionar ou editar o Forecast, na
aba de “Aparência”.

Coloque as as Divs que correspondem ao forecast dentro de uma

,
ou algum outro elemento, e identifique-o com o id “body”. Coloque o script
logo em seguida do fechamento dessa nova Div ou Body que voce criou.

Muito obrigado! ajudou bastante!

This topic was automatically closed 0 minutes after the last reply. New replies are no longer allowed.