cityofaustin / cityofaustin/techstack
Localized instances
- Dominant language
- No language data
- Stars
- 11
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
### Current issue
Once we have page instances implemented, we need to make sure they are correctly localized with:
* Localized urls
maybe something like
|id|url|lang|
|-|-|-|
|1|/es-url/|es|
|2|/en-url/|en|
* Localized contextual info
* Parent/sibling stuff, so maybe
|id|relation_type|link_text|url|
|-|-|-|-|
|1|parent_department|Salud Pública de Austin|/es-url/|
|2|parent_department|Austin Public Health|/en-url/|
or it could even be more rigid and not just have a generic relation_type, but in general however we relate instances to each other (for contextual nav stuff) we need to make sure everything is localized correctly
### Previous issue
### As a [Joplin] I want [all janis URLs for all pages in all languages to be stored in the DB] so that [we can use localized slugs in alpha and it doesn't take forever to generate our site structure object].
**Is your feature request related to a problem? Please describe.**
* localized slugs aren't being used in Janis
* the api call to get the janis site structure is heavy and slow and should be made more lightweight and quick
**Describe the solution you'd like**
* When a content author saves/updates content in Joplin:
* Save all valid Janis URLs for that page somewhere in the DB (@easherma any ideas on where best to store this?)
* When Janis hits the Joplin API to get URLs/ids (currently siteStructure)
* We just read the table and send it back (maybe we can do this in Graphene/GraphQL, ideally this will set us up for some smoother incremental build logic)
* There will probably be some Janis work in here to make sure we're handling the API changes effectively
**Describe alternatives you've considered**
* Just making spanish slugs work with our current setup in a quick and hacky way
## Original Bug
> ## Describe the bug
> If you add a Spanish slug, toggling from "English" to "Spanish" on Janis won't work, probably because Janis isn't looking for the Spanish slug URL.
>
> ## URL
>
> ## To Reproduce
>
>
> ## Current behavior
> 404 error, with the URLs in this format
> English: `https://alpha.austin.gov/es/austin-public-health/default-slug`
> Spanish: `https://alpha.austin.gov/es/austin-public-health/default-slug`
>
> ## Expected behavior
> The Spanish page works, with this URL format
> English: `https://alpha.austin.gov/es/austin-public-health/default-slug`
> Spanish: `https://alpha.austin.gov/es/austin-public-health/spanish-slug`
>
> Might want to think about this solution in conjunction with #3376 (localize internal links)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.