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

Translation #789

Open
derevandal opened this issue Nov 9, 2017 · 16 comments

Comments

Projects
None yet
8 participants
@derevandal
Copy link

commented Nov 9, 2017

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
the cms is only in english
- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
it might be possible to select the default language in Netlify and also be able to change it in CMS.
- Please mention your CMS, node.js, and operating system version.

@tech4him1

This comment has been minimized.

Copy link
Collaborator

commented Nov 9, 2017

We currently have a PR for supporting other languages: #403. It needs finished up, though (#403 (comment)) and if you are able to help, that would be great!

@tech4him1

This comment has been minimized.

Copy link
Collaborator

commented Mar 29, 2018

This will be closed by #974.

@nahueld

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2018

Given that #974 is closed, would you like me to work on this? I can start a new PR following the previous findings. Im interested in getting this in.

@derevandal

This comment has been minimized.

Copy link
Author

commented Aug 29, 2018

@nahueld if you need some help, you can count with me.
I think you can start a new branch with frozen features to work only with translatation feature... We can discuss the patterns before putting our hands dirty.

@nahueld

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2018

Based on what I have read so far the solution that I have in mind would be implemented in 2 phases:

1️⃣ Extract current texts from core

This phase would encompass the following (but not limited to) tasks:

  • Create a key/value file for all the texts in core module.
    • Key would be a meaningful label to identify the text.
    • The value would be the actual translation (or in this phase the English text)
  • Create a mechanism to read/use these values (probably using Polyglot, but open to other suggestions)

2️⃣ Provide a mechanism to provide a custom key/value file

  • In this 2nd phase we would allow users to pass a custom key/value file.
  • We would need to document the expected keys.
  • Under the hood we would merge both files (defaulting to English texts if some of the keys are not provided by the user).
  • Probably the file path would be provided as value in the config.yml.

Future improvements (not necessarily part of this).

  • Allow users to provide multiple translation files.
  • Read browser agent language and decide which one to use.
  • Include some good translations as part of the default build.

Let me know your thoughts.

@derevandal

This comment has been minimized.

Copy link
Author

commented Aug 30, 2018

@nahueld I agree with all your suggestions!
could you lead this with a new fork only for this feature?
if you start this, i can help you committing too.

we can use gatsby-plugin-i18n on cms

@tech4him1

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2018

@derevandal The CMS is not built on Gatsby -- only our docs site -- so I'm not sure that a Gatsby plugin would work. Thanks for both of your work on this!

@renestalder

This comment has been minimized.

Copy link
Contributor

commented Jan 17, 2019

Would love seeing this feature. I use the CMS mostly in German environments. So currently there is a mix between the content models having German labels, but the CMS itself showing everything in English.

At least some kind of translation functionality would be nice. Doesn't need to be switchable by the CMS user for a MVP in my opinion.

@joostdecock

This comment has been minimized.

Copy link

commented Jan 17, 2019

I have a need/use case for this too. I have a multilingual site, and I'd like to see Netlify CMS not sticking out like a sore thumb because it's not translated.

I'm new to Netlify CMS but I had a look at the source and I was wondering what would be the best way to implement this.

The hardest part seems to have already been implemented. That is, extract strings from the code and keep them somewhere in a key/value format. From glancing the code, I guess these are the strings.

Unfortunately, there doesn't seem to be a way to override them, as the language is hardcoded to en.

So, am I right in assuming we need two things:

  • This line should set the locale to whatever's in the config file, or default to en
  • We need a way to inject an object to replace the i18n key/values object or/and (my preference) make getPhrases() take a locale/language parameter as set in the config, so it can load one of the supported languages.

The latter would mean that translations ship with Netlify CMS, and thus language updates/fixes would be tied to releases. That doesn't seem like a problem to me, but what do I know.

Speaking of which, I might be way off here. But I think it's an important feature, and would be a nice feather in the Netlify CMS cap to support a bunch of languages out of the box. So can we do this?

@erquhart

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

Definitely doable! @nahueld, who implemented the hardest part as you mentioned, laid out the plan in his comment: #789 (comment)

(specifically phase two.)

@nahueld

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

All right lets get phase 2 working so people can contribute with more pretentious features

@erquhart

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

@nahueld clarifying - are you working on this yourself?

@nahueld

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2019

@erquhart

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

Sounds good. I'd like to provide built in translations that can be used based on browser locale, that would be worth some additional kbs.

@andipabst

This comment has been minimized.

Copy link

commented Mar 1, 2019

I would rather have that configurable, since I will know the language of the editors on my pages in advance. Plus this will only be one language. So having all translation for many different languages available but completely unused doesn't justify these additional kbs in my opinion. But ymmv, of course.

@embiem

This comment has been minimized.

Copy link

commented Mar 31, 2019

@nahueld Any updates on this or work being done? Would like to contribute if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.