If we wanted to manage localization through GraphCMS, we'd likely want to create that in some other kind of way. For instance, products here, we don't have that managed in GraphCMS, that's being managed inside of the code right now. We also want to keep in mind that we can only add this localization for GraphCMS for things that are managed inside GraphCMS. Maybe it makes sense to show these in that particular language. For instance, again with categories, maybe you do want to localize the title. Again, we want to make sure that we're localizing the fields wherever we want. I'm going to do the same exact thing and localize both my hero title and my hero text to make sure that both of them can provide language specific versions. We probably want to localize the hero title and the hero text. Let's click page and we can see that we have our name, our hero title, our hero text. Looking at our other schema models, we probably don't need to do anything with category because each of them just simply have a title, no kind of description. I'm going to hit that check box and I'm going to click update. If I go to my description and click edit field, I can scroll to the bottom and we're going to see the option for localized field. Inside of my product schema, we can skip the name. We definitely want to localize the description. ![]() We want that to be the actual title no matter what language you're looking at. If we look at this product for instance, maybe we don't want to localize the title because it's the title. Looking at our product, we can choose what fields we want to localize. What we need to do is, we need to set up localization for every field that we want localized. Once that's saved, I'm going to head over to my schema's section. ![]() We can see that it automatically fills in the default API ID, where we're going to use ES, which is the code for that language. You can set up whatever language you want as part of this, but I'm going to work through Spanish. Specifically, we're going to work on setting up Spanish. If we open up this drop down, we can see that we have a lot of available options. We see that we have, by default, our English locale. Where inside, we're going to find the locales page. To get started with our localization, we're going to head into our GraphCMS dashboard, where we're going to head to the settings page. On top of that, Next.js provides internationalized routing, which allows us to easily support that. How can I help them out by providing translations? The great thing is, GraphCMS provides localization right inside of the content editor. ![]() The problem is, I know that all my customers don't speak English. Or if we even go to one of our products, we can see that we have a description for each one. Where on our home page, we have this prepare for liftoff. Instructor: We have our store up and running, and we have copy dispersed throughout the store.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |