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

Locales #12

Open
ItayZiv opened this issue Jul 7, 2020 · 6 comments
Open

Locales #12

ItayZiv opened this issue Jul 7, 2020 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@ItayZiv
Copy link
Collaborator

ItayZiv commented Jul 7, 2020

Not sure if this is possible, but if it is, then adding support for and changing the og:locale based on the translated version of the documentation would be nice if possible. Additional adding support for og:locale and og:locale:alternate would be useful anyways for non-English documentation and documentation who has non-English translations.

@TheTripleV
Copy link
Member

app.config.language returns the language when it is explicitly defined (in conf.py or cli). It defaults to "".

I don't know if og:locale:alternate is that useful. From a quick google search, it seems that only Facebook uses it. Even then, Facebook makes extra requests to the server with the parameter fb_locale and expects a response that RTD does not support afaik.

It may be more useful to provide links to alternate languages in the form:

<link rel="alternate" hreflang="en" href="https://docs.wpilib.org/en/latest/" />
<link rel="alternate" hreflang="fr" href="https://docs.wpilib.org/fr/latest/" />

^ This is what Google Search uses to differentiate between languages: https://support.google.com/webmasters/answer/189077

@ItayZiv
Copy link
Collaborator Author

ItayZiv commented Jul 25, 2020

That's something that we might be able to insert in extra tags on the per lang build, but not something that should be done in the extension.
The language as configured by sphinx isn't the same format as defined by opengraph, it's be something you need to specify in conf.py per each lang build

@ItayZiv ItayZiv added the enhancement New feature or request label Jul 25, 2020
@Daltz333
Copy link
Member

We should be able to take advantage of READTHEDOCS_LANGUAGE for this

@ItayZiv
Copy link
Collaborator Author

ItayZiv commented Jul 26, 2020

It’s not the correct format that ogp expects, it wants language_TERRITORY.
Unless your talking about the link for google that was mentioned. Idk if that’s in scope for this being not very ogp? idk

@Daltz333
Copy link
Member

It does indeed what language territory. However are locale codes can be used to lookup language territory.

@Daltz333 Daltz333 added this to the 1.0.0 milestone Jan 30, 2021
@TheTripleV
Copy link
Member

I added support for this (the non-og meta version) directly into frc-docs a while ago. https://github.com/wpilibsuite/frc-docs/blob/main/source/_extensions/localization.py
It can be upstreamed to this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants