-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Add Locki to API documentation #8798
Comments
That is pretty good. we are discussing about how to localize our API documentations. nodejs/docs#11 (comment) CC: @nodejs/nodejs-ja |
Thank you @mikeal for posting this issue and thanks @yosuke-furukawa for your support! Locki is a service that allows your website's visitor to translate your content right on your website by inserting a few lines of JS. Now you can also form your translation team like github to enable only your team to edit the translations so I believe this is really beneficial for OSS community like Node.js to translate its documentations. Please try Locki by registering the API doc website to it and inserting the JS into your HTML. If you have any questions, feel free to ask me anything. We have just launched so it might not have enough features but we are willing to build the features that the community want so give us any feedbacks! |
This looks like what we wanted! In our use case of translation for the API docs, I guess we need to create a project on the locki for every single page of the docs since the segment has only the words which are used in the page we set, right? @chikathreesix |
Thanks for trying this out @watilde! |
Key question is where the translations live. Are they hosted i Locki's content store? If so, what are the service guarantees so that those things don't disappear suddenly (not expecting that, of course, but just to be safe...) |
Hi @jasnell, currently we are hosting the data on the Postgres db on Heroku and fetching them from the API but will be switching to S3 in few weeks to directly host JSON files for the translations so that the translations will never disappear unless S3 is gone. In this case, you guys can also download the JSON files directly from S3 anytime as you like. |
@chikathreesix ... first off, great to meet you in person last night! Thank you for the clarification. What I'm mostly wanting to make sure is that the translations are backed up so this is great. I appreciate it. The other question I have is whether or not the translations could be version controlled in any way. Specifically, when a section of the documentation is modified, how are the changes those those individual sections handled? Would it continue to show the old translation or would there be some indication that something has changed and that an updated translation is required? |
As long as there is an export API we can pull down that export every day "just in case." |
Oh James, I am sorry I didn't recognize you from your comment. I am also really glad to meet you in person last night! When we fetch a HTML, we parse them into something called "segments" which is basically equivalent to TextNode and translations belong to each segments. Whenever Locki finds a pages is updated, it creates a new segment for a updated TextNode which doesn't have any translations yet so translations will never be outdated, however, you need to translate every time it gets modified. In terms of a version control, we also save all the translation activities (like commits) to see who did what and also eventually to implement a feature to rollback to a specific point. |
Hi all, I have integrated Locki here as an experiment. Try it there and give me feedbacks. Also let me know if you want to add more languages. In order to edit, you need to create an account either from the module on the website or our platform https://locki.io Although Locki automatically adds a page when getting accessed, it might take a few seconds to parse it so you might want to refresh the page if it doesn't show the boxes to edit. |
Will this affect only the API documentation (i.e. the |
@ChALkeR yup, you can do that so and I think that should the way in this case. |
@chikathreesix, is https://locki-nodejs-test.herokuapp.com/api/index.html the same as what it is actually going to look now? Some feedback then:
Those are all rather minor issues, but they will constantly get in the way of users who want to interact with that new feature. Note: I did not take a look at the actual translation tool yet, mostly because GitHub/Facebook auth does not work atm. |
One more issue just noticed: editor on https://locki.io/ (which doesn't actually allow to edit anything, but that's probably because I can't log in) sometimes just redirects to https://locki.io/undefined, which probably means that logic is broken somewhere. To reproduce:
|
Another blocker from me (and a separate reason for -1 apart from the usability issues above) would be the fact that this is hosted on the same domain — that can have security implications for the whole website in case if Locki becomes compromised (which could happen). Can we please move the documentation (and everything what we are going to apply this to) to a subdomain (e.g. https://api.nodejs.org/) and place a redirect on https://nodejs.org/api? |
@ChALkeR Thank you so much for your detailed feedback! 1. 2. Sign up with github/facebook
3. Language setting over pages 4. Animation 5. Weird box definition 6. /undefined redirect issue 7. Selection doesn't work |
@chikathreesix I was able to login with GitHub. Now I have two questions:
|
Chromium 53, Arch Linux current. A popup has opened, I successfully authorized the application both on GitHub and of Facebook, but both of those give the same error:
Well, it has an event listener which looks like this: function(e) {
var t = e.currentTarget;
"_blank" == t.target ? window.open(t.href) : window.location.href = t.href
} Given that it's not a link and doesn't have a Upd: t.tagName.match(/a/i) && t.addEventListener("dblclick", e._onDblClickLink) > 'span'.match(/a/i)
[ 'a', index: 2, input: 'span' ]
No, nothing is printed to the console. I just clicked several links, and I can't find the exact pattern. It happens pretty often, though. |
Hi @targos,
|
Thanks, I got the issue. It tries to use your github username as our username too but doesn't match with our validation. Let me fix this. |
@chikathreesix And what about Facebook? It shows the same error, but it's lowercased. |
I see that it uses things like |
@ChALkeR As mentioned in the previous comment, since it takes a original copy as a key, translations are applied to everywhere that has a same copy so the position doesn't matter, the translations won't be lost. This XPath is stored for a reference not for a key. |
@ChALkeR Your github login should work now. I am not sure about facebook login but if it fails I can track the details now so please try that again. |
@chikathreesix I can confirm that GitHub auth works now, but Facebook auth still fails with the same error. |
@mikeal, is the proposal here to have the documentation world-editable or limited to the nodejs org members only? |
@ChALkeR I think the proposal is to allow the localization be editable by the community and the access controls maintained by whatever system Locki has. For most localizations that is probably preferred, most of the localization communities we have in our GitHub org are a subset of a much larger community in that locale. |
@ChALkeR I got the issue with your facebook account and now it should be fixed. @ChALkeR and @mikeal |
@ChALkeR oh, since you are using a same email address as github, you can't create a new account with facebook. Let us think what would be the best way to solve this. |
@targos This is an expected behavior since you might need to change positions of anchor, span, strong tags and so on which appears in a paragraph. So it groups inline elements into a segment. |
I don't think that this is very important (logging in from two accounts), the good thing is that everyone could log in through their preferred way. |
This bug is kind of moving into a bug report for locki. My impression reading this is that it doesn't seem mature enough to provide a consistent experience for the animation/popup (which for me is a tradeoff). Going to agree with @ChALkeR in that in its current state its a Also, if we're doing this I'd like to see a similar solution to what we discussed in the analytics issue -- add a flag/env var so its turned off by default should documentation be built/read locally. |
@jbergstroem Thanks for your feedback. What do you mean by a consistent experience for the animation/popup? @ChALkeR Issue 3 and 6 was already fixed. For issue 5. weird box definition, I found that that the height of the element is defined 0px in its CSS so we can't fix this from our-end. |
I think we need to collect more opinions about this. |
Oops, I have not read nodejs.org issue guideline. according to that, API docs problem should be discussed on nodejs/node repo. I would like to progress this issue. Someone has downvote, but someone has upvote, we need to gather more opinions to judge how to handle i18n API docs. |
Ah, I see, thanks. Then, it should be fixed on our end. #toc h2 {
margin-top: 0;
font-size: 1em;
line-height: 0;
margin: 1.5em 0;
} Not sure why that combination of margins and zero line-height was introduced… It's since #297. |
This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that. |
We do no currently have localizations for API documentation.
The system we use for the regular website is pretty heavy, doesn't port very well, and isn't very tolerant of regular changes.
Locki is a new service for creating a localization community and managing the translations.
Here is their URL: https://locki.io
/cc @chikathreesix who runs the service and can answer any questions or concerns people have.
The text was updated successfully, but these errors were encountered: