Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate the studio UI #1603

Closed
djhi opened this issue Nov 16, 2019 · 66 comments
Closed

Translate the studio UI #1603

djhi opened this issue Nov 16, 2019 · 66 comments

Comments

@djhi
Copy link

djhi commented Nov 16, 2019

Is your feature request related to a problem? Please describe.
I build websites for people who needs to manage its content themselves but many of them don't understand English.

Describe the solution you'd like
It would be great if the studio UI itself was localized.

Describe alternatives you've considered
Forking the default layout and other packages using parts to translate it myself. It would be a pain to maintain though.

Have you considered internationalizing the studio app ? If yes, can I help ? If no, are you open to the idea and would you accept PR for it ?

@evenwestvang
Copy link
Member

evenwestvang commented Nov 20, 2019

We're very much open to discussing it, but haven't had the time to think about it properly yet – and do not know if we're quite ready to do it yet. I think we could consider having English as the supported language and have community maintenance of others for the time being. We don't have that many strings.

Is there a localisation framework for JavaScript that's uncontroversially better than the others so it's a trivial choice?

@djhi
Copy link
Author

djhi commented Nov 20, 2019

Is there a localisation framework for JavaScript that's uncontroversially better than the others so it's a trivial choice?

This is a dangerous question to ask 😆

I had good experiences with react-intl and react-i18n-next

@jsardev
Copy link

jsardev commented Nov 20, 2019

I just came here planning to create the same issue. I'd love to see this feature in Sanity Studio 😄

@evenwestvang
Copy link
Member

Thank you for chiming in @sarneeh and the suggestions @djhi. We have a lot going on right now and definitely want to get this right – especially before involving someone else's time. So we need some time to consider the best APIs and see when this fits into our schedules.

@jsardev
Copy link

jsardev commented Nov 21, 2019

Thank you for chiming in @sarneeh and the suggestions @djhi. We have a lot going on right now and definitely want to get this right – especially before involving someone else's time. So we need some time to consider the best APIs and see when this fits into our schedules.

Sure thing! As you already mentioned: you don't have that many strings in the app, so I could definitely provide translations to my language (Polish). Unfortunately won't have time to create the whole solution.

Btw. I very much appreciate your interest in providing a good and readable API, for now, it's a great experience using Sanity 😃

@evenwestvang
Copy link
Member

Thank you! We also want to extend our localisation to plugins so we need to be careful about the API design for localisation as well. 🙇

@debitan
Copy link

debitan commented Dec 28, 2019

I've been looking into this as well. I'm creating studios for Japanese speakers and can localise the name of fields and descriptions. However, it would be best if I could also show 'Publish', 'Duplicate' etc in Japanese too. I'd be more than happy to provide the translation but would appreciate the help on how to implement it.

@debitan
Copy link

debitan commented Dec 28, 2019

It would also be nice if the slug generator was able to provide Roman characters based on Japanese fields. Currently it doesn't work and I have to manually type out a Roman character based string.

@evenwestvang
Copy link
Member

We will not be prioritising an API for this in the current quarter, but will be tracking this issue. Comments like the above on slug generation are very much appreciated!

@paolodina
Copy link

paolodina commented Feb 6, 2020

I'd be available to provide/maintain italian strings.

@evenwestvang
Copy link
Member

Thank you @paolodina – we so want to make this happen! 😃 && 🙇

@billymoon
Copy link

@evenwestvang do you think this feature might be considered for the next quarter?

@clementoriol
Copy link

I'd be happy to provide french translations when the feature is ready. Looking forward to this 👍

@gabros20
Copy link

I would be happy to contribute with Hungarian translation later on.

@cinza
Copy link

cinza commented Sep 11, 2020

I would be happy to help with Spanish translation

@thedevdavid
Copy link

Hey @evenwestvang . What do you think, what's the state of this? I think it should be a great idea for Hacktoberfest

@RonaldDijks
Copy link

I could help with a Dutch translation if this is still on the roadmap. Do we have an ETA?

@arggh
Copy link

arggh commented Nov 18, 2020

Depending on the amount of strings to translate (seems not too many), I'd be up for helping with the Finnish translation.

Currently, it feels a bit confusing to have Finnish titles and descriptions for fields while the UI is in English (I can manage and tolerate, but for the people who actually update content and use the studio...)

@Ragura
Copy link

Ragura commented Dec 7, 2020

This is also the one issue preventing me from using sanity as my CMS of choice for commercial projects (just using it for hobby projects now), because my clients will not accept an English ui. I hope you’ll consider prioritizing this feature in the near future, considering it’s been in limbo for so long.

@danielmoessner
Copy link

Sanity has the best UI of all the headless CMS options I've tested so far. However I can't use it for client projects, because there is no simple method of translating everything to German.

@JonathanDoelan
Copy link

Any progress?

@snorrees
Copy link
Contributor

snorrees commented Feb 26, 2021

A workaround we are using, that works if you are self hosting Content Studio. Search-replace strings in app.bundle.js 🙈 after building. Has to be done with care, to not breaking code-related strings, but we have managed to translate about 95% of the studio to norwegian now.

This is not a recommendation though, just a tip if you are desperate.

We do the same to replace dataset name, studio title & theme color for different environments runtime as well.

@JonathanDoelan
Copy link

@snorrees nice workaround!
@evenwestvang right?

🤣

@valse
Copy link

valse commented Mar 9, 2021

I'd be available to provide/maintain italian strings.

Me too

@cno-dev
Copy link

cno-dev commented Apr 5, 2021

Any updates on this? @evenwestvang
Would you look into PRs if i would try to implement this or would that be a waste of my time?

@alexbchr
Copy link

alexbchr commented Apr 7, 2021

Any update on this would be very appreciated! As a first step, it would be great if there is an official and not hacky way to translate the Studio UI.

Maybe later on the Sanity Studio could come with officially supported languages, but seeing how strong the Sanity Community is, I easily see the Translations being provided through Community maintained plugins.

We have a lot of French-speaking clients and from looking at this issue, it seems to be quite a pain to translate the Studio UI. Having a confirmation that this is on the Sanity Roadmap would make it a whole lot easier to recommend Sanity to our clients, as some of them don't speak English at all.

@s-rd
Copy link

s-rd commented Apr 16, 2021

I'm also using the Studio for a project where quite non-technical Norwegian volunteers will use it, so a translation would be awesome.

Would be happy to contribute the Norwegian translation :)

@aaadotpm
Copy link

This would be amazing. I would also be able to help with Norwegian bokmål and nynorsk translations. For now I will use the semi-localized approach with just field names and descriptions in Norwegian, but I already know the client will cringe when they see "publish" and "duplicate" instead of their translations.

@DaveKeehl
Copy link

I would also love to have the Studio UI localized ❤️

@pointout
Copy link

I can contribute to German translation. Would really love to see translation support.

@milovangudelj
Copy link

I think this could be a feature that significantly expands the adoption of Sanity. Many people avoid it just because their clients don't know English that well and would have a hard time using it. It's definitely a pain point.

I had to use CMSes with English UIs a couple of times, and I had to spend a good chunk of my and my client's time teaching them how to use a tool in a language they didn't know.

I'd be more than happy to help with Italian translations when and if the feature get's introduced. 😊

@linkurzweg
Copy link

I also would love this feature. We're currently looking for a headless CMS in my company for our next project and Sanity looks great! But being unable to translate the studio UI prevents us from using it. I'd be happy to help with translations to German when/if this feature becomes available.

@nimser
Copy link

nimser commented May 2, 2022

Has work started on this front? I don't see a single feature at this point that is more worthy of attention than this one.
Key for true adoption of Sanity in a multilingual world.
An english-only localized official version with community translations sounds like a good starting point.

@johannesmutter
Copy link

johannesmutter commented Oct 14, 2022

Since this issue is open for 3 years now, can we safely say Sanity is not getting translated? Or is there a plan for Q4 2022 or Q1 2023?

I'm asking because as a developer I love Sanity. But some of my clients, especially in Germany and Korea really struggle with the non translated UI (e.g. "add item", "publish", "review changes", "duplicate", "click to activate", "generate", etc.).

There’re only a few dozen texts in studio that are crucial for daily activities. So I imagine it would be quite easy to search & replace all those strings with a translation function:

The most basic implementation could look like this:

// original string
`Referenced by ${x} items`
// replaced by:
$t("Referenced by $x items",[$x: x])

The translate function $t would import a JSON from the studio folder (e.g. "lang/de-DE.json" for German) with the english key "Referenced by $x items", if there’s no translation it falls back to English. Plugins could also import the $t function and get easily translated. The community seems to be more than happy to provide some default translations, but I think it makes most sense to let developers override them all as well in studio (so there could be a default "de-DE.json" and a "de-DE-overrides.json").

I’m happy to help with translations in German and Korean. 🙌


Lastly what's a "recommended" way to hack the UI, a chrome extension? replace strings in app.bundle.js as a post build step?

@choutkamartin
Copy link

choutkamartin commented Nov 16, 2022

Because I have seen exactly zero motion regarding this issue, which is sort of a deal breaker to me, I will try to code a working example in the upcoming days or weeks. I will do it via "set the language as a context" in React (because even theme is set that way, no cookies - which kinda sucks when I do F5) and "developer can set the initial language of CMS in configuration" way. If you wish to stop me, because somebody started on this issue already, please do it before it's too late and before I'm deep into a rabbit hole, thanks 🙂

@choutkamartin
Copy link

I had a while to spare, so I did this:
chrome_7qcK7in5jc

chrome_coYEuRtukn.mp4

I used i18next/react-i18next. The default language can be chosen by the developer, so the editor shouldn't be terrified seeing a new language after logging in. The language can be changed via the select. The language is persisted between page refreshes because it's saved to LocalStorage.

/// sanity.json
"project": {
  "name": "Test studio"
},
"language": "fr", // Default language

I only used the useTranslation() hook, but some "components" need little changes to make the translation work, such as the dashboard tool which exports an object like this:

export default {
  title: 'Dashboard',
  name: 'dashboard',
  icon: DashboardIcon,
  component: Dashboard,
}

Because it 's not a "function component", it can't use hooks. That's why I export key of the translation as follows:

export default {
  title: 'dashboard',
  name: 'dashboard',
  icon: DashboardIcon,
  component: Dashboard,
}

And then, when mapping these navbar tools I use the useTranslation hook as the Navbar/ToolMenu is a component:

const {t} = useTranslation()
...
{tools.map((tool) => {
          const title = t(tool.title) || tool.name

Let me know what you think of this 🙂

@choutkamartin
Copy link

I have also been wondering. Developer can setup own structure of the CMS, meaning he can setup for example own Desk structure. The structure takes title as an input, so there's no to little way of providing translations for that. But that doesn't matter too much, right? I'm guessing, as a developer building the CMS for a French client would set title as "Contenu" instead of "Content" and would be okay with it. Or does somebody have any ideas how to provide translations for "user/developer" defined content?

S.list()
    .id('root')
    .title('Content')

@FR073N
Copy link

FR073N commented Mar 2, 2023

This is exactly what we need on our side too. I'll be more happy to propose a PR if someone guide me on how to do it.

@Karytonn
Copy link

Congrats on finding a solution! 👏🏻👏🏻👏🏻

Could you offer us a working example via github repository?

Thanks! 🚀

@choutkamartin
Copy link

@Karytonn Your message was meant to be for me, right? I can share an example, on the other hand I never finished the "example" fully, because I struggled with making the localization component accessible for plugins etc.

@Karytonn
Copy link

@Karytonn Your message was meant to be for me, right? I can share an example, on the other hand I never finished the "example" fully, because I struggled with making the localization component accessible for plugins etc.

I needed a solution to at least change the name of the publish button, nothing more.

@jimmysafe
Copy link

any news on this? i really need to change just the buttons translations such as Publish, New Item, etc...

@thewinger
Copy link

Any news?

@haroldao
Copy link

haroldao commented Jun 6, 2023

I'd be happy to contribute to the French translations 👀

@petter-svard
Copy link

This feature would be greatly appreciated 🙏

@ksundmyhr
Copy link

Any news on this? I do think quite a lot want this functionality 😊

@jyyyeung
Copy link

Studio translation would be very helpful. My client is not great at English and it makes him difficult to update content. I will also be willing to contribute translations.

@yonaodesign
Copy link

Any updates? I guess that localization might bring issues like budget, and having to hire target language speaking support staff etc., yet I would love really to Sanity it in production for my Japanese client.

@martinval
Copy link

Just adding a comment to not let this die. Also considering Sanity for intl. client projects, but lack of UI localization is a deal breaker. :(

@hhdreamer13
Copy link

I really appreciate all the hard work you've put into making Sanity this much lovely. I understand that translating the Studio UI into multiple languages might be challenging from a development perspective. However, if you could create a system where users can provide their own translations for UI texts, that could be a game-changer for non-English speaking customers.

Sanity is a great product and I believe it should be easily accessible to clients from different regions. Making the UI customizable in terms of language could be great.

Looking forward to any updates on this issue!

@jimmysafe
Copy link

+1

@rexxars
Copy link
Member

rexxars commented Dec 19, 2023

A big thanks to every single one of you who took the time to tell us about your interest in this feature and offered your help with various locales!

We are thrilled to announce that we have now released support for Studio UI Localization! This feature, highly requested by our community, enhances the user experience by allowing the use of Studio in various local languages.

For more information and access to documentation, check out the announcement post.

As part of this exciting release, we've created sanity-io/locales, a monorepo containing over 20 locale plugins. We invite you to test these plugins, submit improvements, and if you're interested, join us as a maintainer of a specific locale. Maintainers play a crucial role in reviewing pull requests from AI and other contributors and are recognized with a token of appreciation from Sanity.

Can't find your preferred locale in the monorepo? You can easily request its addition! Simply use the issue template linked from the README and we'll get it started with AI, seeking your assistance in reviewing and optionally maintaining it.

Thank you again to everyone who contributed to making this feature a reality. Your patience, feedback, and contributions have been invaluable.

@rexxars rexxars closed this as completed Dec 19, 2023
@haroldao
Copy link

A big thanks to every single one of you who took the time to tell us about your interest in this feature and offered your help with various locales!

We are thrilled to announce that we have now released support for Studio UI Localization! This feature, highly requested by our community, enhances the user experience by allowing the use of Studio in various local languages.

For more information and access to documentation, check out the announcement post.

As part of this exciting release, we've created sanity-io/locales, a monorepo containing over 20 locale plugins. We invite you to test these plugins, submit improvements, and if you're interested, join us as a maintainer of a specific locale. Maintainers play a crucial role in reviewing pull requests from AI and other contributors and are recognized with a token of appreciation from Sanity.

Can't find your preferred locale in the monorepo? You can easily request its addition! Simply use the issue template linked from the README and we'll get it started with AI, seeking your assistance in reviewing and optionally maintaining it.

Thank you again to everyone who contributed to making this feature a reality. Your patience, feedback, and contributions have been invaluable.

Let's goo🎉🎉

@ksundmyhr
Copy link

🎉

@patrulea
Copy link

What a time to be alive hop onto the Sanity ecosystem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests