Wrong localization for date

I am getting these errors in my templates after changing the language key. I am trying to debug them in the meantime. (This code throws that error for example when ByTitle is replaced ByDate)

execute of template failed at <$p.ByDate>: can’t evaluate field ByDate in type []interface {}

(I can confirm hat code is the one failing the build @jmooring with en changed to en-KE and sw to sw-KE )

Question: Do I have to rename all my files (I have thousands) to match the language key? They are in format abc.md and abc.sw.md. I cannot debug where this error is coming from (a colleague used the multilingual code extensively in our site, so the code you shared in the link fails in every instance where .ByDate is used.).