How to Add Localization to Bucket Object Types
Below is a step-by-step tour of how to add the power of Localization to your Cosmic Object Types.
1. Localization happens on the Object Types. To set up localization in your Bucket go to Your Bucket Dashboard > Object Type > Settings (Cog icon)
2. Then turn localization for this Object Type “On”
3. Select your locales
4. Select your priority local (this will be the display title in the Objects Table)
5. Then on your Object Pages, you will see the Locale option
6. When you want to add the same Object (but in a different language / locale) simply create a new Object, *make sure the slug is the same* and add the different locale
7. Save this Object, then you will see that the Object now appears in the Table with 2 different locales linked
8. Now that you have the 2 versions, you can get the different versions from the API endpoint using the `locale` query param
This `locale` parameter is available on all endpoints, so if you need to get all Objects with `locale=es`:
I hope you found this article helpful. Let me know if you have any further questions. Reach out to me on Slack, and follow Cosmic on Twitter.
Search and filter products using React Hooks and a headless CMS
August 05, 2022
Building React Components from headless CMS markdown
August 24, 2022