Read the statement by Michael Teeuw here.
es language to uppercase
-
I went through the locales.js and everything was lowercase.
https://momentjs.com/downloads/moment-with-locales.js
The only thing that I can think of doing was setting the config.js back to en.json and in the clock/calendar.js create a translation string and put that into es.json and leave the month starting on Domingo and not Lunes (like in the English en.json ). It’s confusing anyway to look at the english calendar with the week starting on Sunday and then you look at the Spanish calendar and it starts on Monday and visually things are off by one.
Cheers
-
@scumbelly said in es language to uppercase:
Is it possible to translate the es lowercase data to uppercase in translations es.json? I didn’t think I could because I thought the translated spanish data, plus calendar month starting on Domingo (oops - dom.), was data supplied from the OpenWeather app. It sure would be easier to do the translation in en.json. I did try “marzo”: “Marzo”, in the es.json file to no success.
Translations from the translations file only work when they are explicitely called in the source code using the
translate
function.
Hence, a user cannot decide to translate anything by adding the translation. -
@scumbelly APIs like openweather usually supply timestamps that get interpeted by moment(). So moment is the one putting out lowercase days/months instead of uppercase, not openweather.
Go through the moment docs, and try to find out if you can somhow manipulate the case. -
Hi,
I went through moment.js looking at ways to capitalize ‘domingo’ etc. I could create a function with ‘var str =’ and ‘var res =’, or do a moment.locale (“es”) define a var for months and days with uppercase and do a moment.UpdateLocale but all involving modifying the .js file.
There was a solution editing the /MagicMirror/vendor/node_modules/moment/min/moment-with-locales.js which would change every module.
However, this morning I tripped over just adding text-transform: capitalize to the .css for the module. I updated .clock and calendar_monthly. It worked. It’s simple and no messing with moment.locale and the .js
I learned some things poking around in moment.js but the .css solution was way easier.
Thank you for your insight and suggestions.
Cheers!
-
@scumbelly great solution! css is really powerful!