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/localization of a vocab #79
Comments
I would actually prefer the latter, but in terms of usability, it would also be nice to have an option to switch languages. |
so we figured out how to get it all in german ^^ |
It indeed has! Currently we simply use the first language found, which is why your approach above works, all other languages are currently ignored. I was thinking about building all languages in the future and then using Apache MultiViews to negotiate the language to be delivered. |
Regarding a functional review of #102: It looks very good all around but I am not sure whether this requirement is met:
When I test this locally using the HCRT vocab as test data, start the development server and load something like http://localhost:8000/w3id.org/kim/hcrt/assessment in my browser I won't be redirected to http://localhost:8000/w3id.org/kim/hcrt/assessment.de.html or http://localhost:8000/w3id.org/kim/hcrt/assessment.en.html. |
As described in #79 (comment), the build relies on Apache MultiViews to negotiate the language to be delivered. |
It just came to my mind that this might not play well with GitHub pages. Could you check, @sroertgen? |
Thanks, @literarymachine, for working on this. I now have tested it a bit. There is one problem with the language links:
Otherwise it looks good and works well if you have all strings covered with multilingual labels but it does not look good as soon as you don't have all the strings covered.
|
Fixed in 2584e9b
I would argue that it is simply best practice to fully cover any languages you wish to support. From experience e.g. with OER World Map I can say it tends to quickly get confusing if you automagically fall back to other languages.
I can't reproduce this, can you try building that version of the vocab locally? |
I can't reproduce it as well. The reason for not building must have been something else. Sorry. |
@dr0i, can you please redeploy this (PR) to test with the fix @literarymachine provided (2584e9b)? |
@acka47 redeployed with the fix. |
There seems to be something broken now. Redelivering the payload of the last webhook request, I now get an error (although it did build on 2020-11-04: https://test.skohub.io/build/?id=e5f8472a-ceda-44d8-945c-65383f0ef4e9 |
Looks good now, there is only one minor thing: Clicking on "SkoHub-Vocabs" one should get back to the vocabulary overviewand the link behind actually points at https://test.skohub.io/acka47/hcrt/heads/master/ which works when resolving it from scratch. But when clicking "SkoHub-Vocabs" it gives an error message: |
This is fixed in adb1928. When using the Gatsby link component, it has to point at the actual file. Speaking of Apache and Multiviews, these are currently a requirement for the i18n to work! @sroertgen might want to look into this from the GitHub pages perspective. |
Hey @literarymachine, // gatsby-node.js
createPage({
path: `/index.html`,
component: path.resolve(`./src/components/indexRedirect.js`),
context: {
languages: Array.from(languages)
}
})
} and create a // indexRedirect.js
import React from "react"
const IndexRedirect = ({pageContext: {languages}}) => (
<div>
<meta http-equiv="refresh" content={`0; url=/public/index.${languages[0]}.html`} />
</div>
)
export default IndexRedirect This way a I don't know if this is too hacky for you or would somehow interfer with Multiviews. If so, I would just add it to the docker branch, which should also be fine. Otherwise I could add it if wanted. |
Not to hacky for me, this is the type of client-side redirect I would also consider. But we would need it for every single concept URL, right? This would should result in something like the following file structure:
I just figured out that this will indeed mess with |
@sroertgen asked for this via Slack:
We should think about how to adress this. There are different options:
@sroertgen, what do you have in mind?
The text was updated successfully, but these errors were encountered: