But that's content as presentation. Sanity focuses on content as data. And if you're still doing WordPress, I don't know, they're all blocks or something now but it's not right. So let's look at this website again. This is made up of disparate pieces of content that are connected, but we don't have to focus on the presentation of it as a website. It just happens to be in a website. This is content. This is course data, presenter data, label data, lesson data, and most importantly of all for today's topic, this is language data. And language data is really important because that can be internationalized differently based on that content.
So let's consider our presenter model. I've got a name, a title, and a photo. Now, only two of those things are going to change if I need to internationalize this document. My name is always going to be the same. My photo is going to be the same. So if I have multiple language versions in that document, I'm going to make multiple language versions of that field. And so if I'm looking at a lesson, well, all of these are text, so it wouldn't make sense to have all of these be localized versions in this document, we might as well just make localized versions of that document, and this is the sort of flexibility that Sanity gives you, is that you get to internationalize things, how it makes sense to the content, not how it makes sense to us. We don't tell you how to do language internationalization, because to us, everything's data. Language is the data. This is how you set up languages in Sanity, because everything's JavaScript, so it makes sense to a developer, right? You just map over fields, or map over documents, and create language-specific versions of those. And then this one config file can spread to your Sanity schema, to your plugins, off to translations APIs and services, off to your Next.js, or Remix routes, and it all just comes from this single source of truth that you check into GitHub, you deploy into the Studio. And that's localization in the real world.
So as a solution engineer, a lot of my job is presenting Sanity to customers that we have, but the great thing about how flexible Sanity is as a content platform is that our customers tell us how they're doing things. And so a lot of the rest of the talk here is showing how our customers are showing how they have done internationalization in our software. The problem is, I can't tell you any of their names, so I have to just talk in weasel words, kind of. So this internet connected speaker company that uses Sanity, they do key value pairs. So if you've done localization, sanity, you've probably done this sort of thing already. This is looking at a Google Translate plugin that we have so you can type content in one language and have that automatically be translated into multiple other languages. And you can set up key value pairs. So usually you'd store that in JSON. You can give your content teams a content editable version of that.
Comments