KWGT Forecast weather condition text wf(cond, 0) is capitalising every word (YR.no)

When forecast weather condition wf(cond, 0) contains more than one word, the second word is capitalised. I’d expect the function to only capitalise the first word (using tc(cap,)) if I wanted to capitalise each word (which I don’t).

I use the app in Norwegian, where this is the expected grammar. I believe the same applies for English. :blush:

If this is expected behavior or due to the weather provider (YR.no) it would be great if you can:

  1. fix that or
  2. add a text function that let’s us only capitalise the first word of the string (as long the string doesn’t start with a number).

Thank you for a great app. Love spending my tile kustomising!

Regards

Hi there,

Try this code snippet to make every sentence capitalized, only its first word.

$
lv(text, "this is only text, a sample text.")
$$
tc(up, tc(reg, #text, "([A-Za-z])(.*)(\.+)", "$1"))+
tc(low, tc(reg, #text, "([A-Za-z])(.*)(\.+)", "$2$3"))
$

I hope this would help.
:smiling_face::+1: