Build A i18n Filter Using Vue.js & Native Web Specs - Vue.js Developers

I'm still learning Vue and one of the things I was a bit slow to discover were filters. (To be fair, they are towards the end of the docs!) Filters, as you can probably guess, allow you to define simple textual transformations to values. So for example, the docs demonstrate a Capitalization filter that will convert the first letter in a string to uppercase. Vue doesn't ship with any filters baked in, but it's incredibly easy to write them. A great use case for this is in internationalization and globalization, broadly defined as formatting values in the user's preferred language.


This is a companion discussion topic for the original entry at https://vuejsdevelopers.com/2018/03/12/vue-js-filters-internationalization/