-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
internationalization needed on description #553
Comments
I see three parts in this enhancement
{
"props": {
"color": {
"master": "the color for the button",
"i18n": "la couleur du bouton"
}
}
}
|
I would host the locales files near the component files. |
I'd ask to leave the option to have all the translations in a separate file, in a "locales" folder (and not based in components). The reason is that many components may share the same translation keys. |
Hello @Jesus82, This is an interesting suggestion. How would you organize the file in this case? Keep in mind that, in order to keep context, and jsdoc response active, the main idea is to keep the English doc in the components themselves. Thank you |
I have it organized a little bit different, with the locales folder at the same level with the components folder, and then a file for each language. That's also how I'm planning to use my components later, if fx I want to place it in a nuxt app (with a separate file, one for each language). |
This folder structure this is what I understand from your description.
Did I get your scaffolding right? Did you have other suggestions? |
if think it's something like this yeah but not locale, use locales. Why readme in locales ? @elevatebart |
Since the readme contains the documentation that will occupy the bottom of the component sheet, it could be useful to translate it as well. It might be a challenge to know when the file is obsolete. My first reaction would be to use markdown comments at the end of the file. This would serve as the key for the last updated original file. [//]: # <automatically generated code> docgen.hash = fr5tfdc3efg765hbvt When asked to check translations, we could provide the diff of the original |
I was thinking more in something like this (as it mimics how I would set the translations IRL). While in CSS it can make sense to have separate CSS's for each component, and then have some common styles, in translations I prefer to have just a file and then have subobjects for each part of the web, so I can scan all terms at the same time and see if there is something that is already translated. It is also how nuxt structure works.
|
We need to translate the documentation file (Readme.md). This file is rich text using markdown syntax. It contains examples of code but mostly the explanations of what the component should be used for. This last part is very important in a design system.
Since this markdown would have to be translated would you put it inside the JSON file? How would it look?
|
Yep, I would do it that way (assigning a translation key to each of the markdown texts). |
@Jesus82 since JSON does not accept multi-line text how would you go about this translation? As of now it very much seems an awful lot of work just for not repeating code. |
Hi, any update here? I saw the PR, and it stuck the deps? |
No update for now as I have had very little time to work on open source recently. If you feel like taking it on, I can be available for support. If not, It might take a few more months before I get back to it. Sorry. |
Never mind and thanks for your work. I want the internationalization function of the vue-styleguidist and found this PR. It is a long time and I spent little time to figure out why but lots of detail I did not know, so I ask here. Thanks for your quick reply. I wound do something I can for it :D. |
The problem
actually as the doc is never in one lang you should be able to I18n components easily
Proposed solution
Create subfolder for i18n. and parse description and create as many files as you have trads
Alternative solutions
none
Additional context
The text was updated successfully, but these errors were encountered: