-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Feat/multi content authoring #3366
Conversation
4a1dc92
to
fa18ab6
Compare
@barthc This is a very good step forward. Will have more time to review it tomorrow. |
Thanks for taking this up! A few comments on the design: Data model: Seeing the data model here of storing multiple translations of each record ( Config naming: I would rename the setting Scrollbar: I'm seeing a scrollbar in the middle. This poses a UX issue: I wouldn't like to have to scroll twice each time I scroll to somewhere. Keep in mind people will most often want to see the same items at the same height with the least hassle. That's probably a logistical constraint that got you there, though. Is there a way to have the same scroll for both panes? (Not inside of textareas, just overall with the form) |
Both scrolls work in sync, it's using
If we are doing multiple files, the date value, for example, is supposed to be present in all the locale files, or just in a single locale file? |
Had a chance to play with it a little bit.
Will add comments on the code as well and do some more testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@barthc, only managed to go through part of the backend code (didn't do the editor code yet).
Will finish reviewing next week.
Not sure if we should have a |
That's right! I might not even want localizations for a particular entry. There are a lot of different use cases in I18n, so I'd propose we need to keep as much flexibility as realistically possible. Data model
These are excellent questions and I feel like we'll have to balance between incremental first step and defining a data model that will be backwards-compatible for future UX improvements. Entries have non-localizable fields/data, and localizable fields/localized data. What's tricky with the conceptual model is that it is two-dimensional. It makes sense to enumerate the fields an entry has, and ask whether each is localizable, required, etc. It also makes sense to enumerate localizations, and ask whether each is blank, complete, dirty, etc. Entries can be compiled into localized representations by concatenating non-localizable fields with localized ones. (which are in different locations) In the abstract, we might call How does this fit in with our data model: One file per Entry (
|
I think we should go with the first option and allow users to configure default locale per collection.. |
@barthc thanks so much for all of your work on this, and to @joallard for providing such solid product guidance! This PR provides a great place to do some POC (proof-of-concept) work while discussing potential solutions. I'd like to set expectations here, so we're all on the same page, and of course, open these expectations up to be challenged:
So glad to see all of this moving forward - thanks again to everyone making it happen. We need a whole lot of commenting, responding, and understanding to make this feature a success for the community - let's keep the conversation alive! |
This is what we currently have. A
And then for
|
@barthc @joallard, I just want to say, amazing work so far! We are using netlify-cms for our content edits but are in the progress starting to add translations, so this will add so much value. I am more than glad to try and help out here to get this to a mergable state. What are the current blockers except from merge conflicts? How can I help? |
@erquhart @erezrokah This PR is long overdue. I suggest we move this forward(beta as usual). We can still add more formats and handle bugs fixes as users start experimenting with it. And speaking about betas some of our betas should be graduating out 😀 |
Sorry for taking so long to respond. We have a PR #3716 that refactors the backends code and will make it much easier to handle multiple data files per entry. |
I really appreciate the initiative here for i18n! I just would like to give an input on the naming. I think the concept of i18n or multilingual is too narrow. I would suggest to call it dimension. ExplanationI live in Switzerland. We have four official languages
Our biggest trading partner is Germany (Language German). In Germany we have the currency EUR in Switzerland CHF. I don't ask to solve this complex situation here. I just ask to name it not i18n, multilingual or locales. I ask to call it dimensions. I stole that term from NEOS CMS |
23744e5
to
bc9dcab
Compare
Interesting thought from @signalwerk, I also think it’s important when differentiating (for the lack of a better term) locales. — Side note: I could research this further, but ‘locale’ seems an appropriate term for ‘fr-CH’ here, as eg. French is a language, but Swiss French would be a locale. Speaking from my experience as a Quebec French speaker, it sure does annoy me when some content localized for French uses some France/Europe French regionalisms. To some’s dismay, France French is not the ‘correct’ or even canonical way to speak the language. It is merely a regional version, as valid as the others. At best, all localizations would be international and neutral, alas that’s not always possible. From my understanding, that’s the case for other languages and locales as well, off the top of my head Spanish (contrast es-MX vocabulary with es-ES, es-CO, es-AR, and so on) and Portuguese (pt-PT/pt-BR) show these patterns. My main point being: it is important to integrate into the conceputal model of locales that there is no one canonical form of a language, and space must be available at some point for regional variants. Those regional variants should be able to make exceptions/extend the base locale/language rather than completely copy it over. As to currencies, I think i18n has been used that way in other systems, but this seems out of scope as far as i18n is concerned. As a software matter, currency seems completely orthogonal to me. It’s interesting Stefan talks about dimensions here, because currency and locale indeed seem independent ‘dimensions’, but not in the way you mean 😅 It might still be good to think about eg supporting multiple currencies on a site would mean for the conceptual model. Probably that we could generalize I18n into ‘dimensions’ indeed. I think it’s a bit premature to integrate that into the code at this point, but good to keep in mind. |
@joallard as explained before. I don't ask for
I just ask for an independent naming and not tight it to a language, region or something arbitrary. The code can stay the same. It's a general problem that people wanna have different «variations» (dimensions). No matter if it is currencies, languages, regions, target groups, countries, … |
Hi, I'm using the Hugo static site generator and I believe the if we take a look https://gohugo.io/content-management/multilingual/#translation-of-strings
And the i18n_test.go file of Hugo at commit 23ba779, you will see
which is not a Unicode CLDR (like en, fr, cn, gb, etc.) I'm not sure about other static site generator but it's better to avoid the hardcode and user may need es-ES, es-CO, es-AR for specific locales. |
40ada3a
to
d5816d7
Compare
@blackb1rd the files will be inferred based on locales value, for this initial release, I suggest we constraint the locale values, we will allow more flexibility on further updates. @erezrokah I have rebased this PR and made the necessary changes. |
Thanks @barthc, I'll review it tomorrow |
@barthc just to understand it (no judgement): A – you say to restrict people to locales you defined in a hardcoded list is code-wise simpler than give the people the option to define themselves? Don't get me wrong. I'm really appreciate your work and I think it's really great someone is taking care of it! Love it! |
c92be7c
to
0f230d4
Compare
A long overdue update on this PR. I've created a new branch off this PR (so I won't need to force push to this one), with various fixes to issues I encounter during my testing and review process. Once I get my branch to a stable state we can sync this one with the changes. Since the current configuration approach involves several different configurations ( Thanks @barthc, @joallard and everyone for the amazing work. |
@erezrokah Sounds good! (As a matter of project management, I've been reading Shape Up lately, I've been obsessed with it ever since! — At this point in the duration, sounds like a good idea to break it into bits you can be sure to integrate and get done.) Keep it up! |
I've been trying the current solution but it still needs some polish here and there.
|
Closes #716
Introduced two new config options, a top-level locales option
and a collection level config
multi_content
i18n_structure
option with three possible values:single_file
value with save all translated content inside a single file with a format like so:same_folder
locale_file_extensions
value with save the content in mutilple filespost.en.md
andpost.fr.md
diff_folder
locale_folders
value with save the content in mutilple filesen/post.md
andfr/post.md
Editor UI for multiple content currently looks like so: