Skip to content

Conversation

jverce
Copy link
Contributor

@jverce jverce commented Jan 10, 2025

Changelog

  • Add uk entry to the config file
  • Add 404 Not Found page and redirect all /uk/** URLs to it
  • Make the build/serve commands output i18n warnings

Context

  1. Slack thread: https://kubernetes.slack.com/archives/C3HD8ARJ5/p1736261563922009
  2. GH Issue: Support multilingual docs #945
  3. More recent Slack thread, were we discuss picking this up again, and the idea of using a translation management platform for the long-term: https://kubernetes.slack.com/archives/C3HD8ARJ5/p1755650169034809

@k8s-ci-robot
Copy link

Hi @jverce. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Andygol
Copy link

Andygol commented Jan 10, 2025

@jverce Thank you a lot to make things going.

Have you thought about extracting language specific settings into separate files, one per language. I hope this will help to make it easier to manage multiple languages simultaneously.

UPD RE https://gohugo.io/getting-started/configuration/#configuration-directory

@Andygol
Copy link

Andygol commented Jan 10, 2025

Yes, localization is a complicated thing. How to present languages in the language selector is also a question that can be a bit confusing 🙃. Here's a good resource that explains in detail why country flags are not identical to the languages people use. I hope you find it useful. https://www.flagsarenotlanguages.com/blog/

{{- $lang := .Lang -}}
{{- if ne $lang "en" -}}

/{{ $lang }}/** /{{ $lang }}/404.html 404
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to follow netlify's recommendations locally, but without success
https://docs.netlify.com/routing/redirects/redirect-options/#custom-404-page-handling

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And netlify build action failed here also

6:07:05 PM: ========================================================================
6:07:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
6:07:21 PM: uk/404.html
6:07:21 PM:   target does not exist --- uk/404.html --> /uk/docs/latest/
6:07:21 PM:   target does not exist --- uk/404.html --> /uk/docs/latest/install/
6:07:21 PM:   target does not exist --- uk/404.html --> /uk/docs/v3.5/
6:07:21 PM: uk/index.html
6:07:21 PM:   target does not exist --- uk/index.html --> /uk/docs/latest/
6:07:21 PM:   target does not exist --- uk/index.html --> /uk/docs/latest/install/
6:07:21 PM:   target does not exist --- uk/index.html --> /uk/docs/v3.5/
6:07:21 PM: ========================================================================
6:07:21 PM: ✘✘✘ failed in 15.853956324s

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the error is also due to the absence of the files content/uk/_index.html, content/uk/docs/_index.md, and content/uk/docs/v3.5/_index.md. What if you create empty stub files instead of them now?

@Andygol
Copy link

Andygol commented Jan 10, 2025

@jverce Thank you a lot to make things going.

Have you thought about extracting language specific settings into separate files, one per language. I hope this will help to make it easier to manage multiple languages simultaneously.

UPD RE https://gohugo.io/getting-started/configuration/#configuration-directory

@jverce It looks like I managed to split config.yaml into separate parts. This should make it much easier to add new languages and implement CAT-tools in the future. (See config.yaml.diff.zip, PR jverce#1)

It looks like this

➜ tree config 
config
└── _default
    ├── config.yaml
    ├── language.en.yaml
    ├── language.uk.yaml
    └── navigation
        ├── menus.en.yaml
        └── menus.uk.yaml

It would be good if you could integrate these changes into this PR.

UPD main...Andygol:etcd-io-website:config-dir
See PR jverce#1

@Andygol
Copy link

Andygol commented Jan 15, 2025

@jverce could you please review and merge the PR jverce#1 where the most recent changes are located, comparable to the *.diff file attached here in the discussion, which takes into account many of the nuances of setting up multiple languages. The language.en.yaml and menu.en.yaml files are the basis for adding translations in other languages in the future.

@jverce jverce marked this pull request as ready for review January 15, 2025 16:53
Copy link

@Andygol Andygol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Andygol, jverce
Once this PR has been reviewed and has the lgtm label, please assign jberkus for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

* Add `uk` entry to the languages config (disabled for now)
* Add the Ukrainian translation of the homepage
* Add `404 Not Found` page and redirect all `/uk/*` URLs to it
* Make the build/serve commands output i18n warnings
* Add configuration files for English and Ukrainian languages,
  including site parameters and navigation menus
* Move global repository configuration URLs to config files
* Add `latest_stable_version` parameter to the `config.yaml` file
* Add NPM command to serve with debug logs

Signed-off-by: Jay Vercellone <[email protected]>
Co-authored-by: Andrii Holovin <[email protected]>
@jverce jverce force-pushed the chore/i18n-support branch from b9d26db to 2b74076 Compare January 17, 2025 01:14
<h2><a href="https://github.com/zalando/patroni">Patroni</a></h2>
</div>
<br />
<p>A template for PostgreSQL HA with ZooKeeper, etcd, or Consul</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>A template for PostgreSQL HA with ZooKeeper, etcd, or Consul</p>
<p>Шаблон для PostgreSQL HA з ZooKeeper, etcd або Consul</p>

<h2><a href="https://github.com/google/trillian/">Trillian</a></h2>
</div>
<br />
<p>A transparent, highly scalable and cryptographically verifiable data store, created by Google</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>A transparent, highly scalable and cryptographically verifiable data store, created by Google</p>
<p>Прозоре, легко масштабоване та криптографічно перевірене сховище даних, створене компанією Google.</p>

</div>
<hr />
<div>
<p>In addition, <a href="https://github.com/search?utf8=%E2%9C%93&q=etcd/">thousands of projects on GitHub</a> are affiliated with etcd, including projects built on etcd, client bindings, and more.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>In addition, <a href="https://github.com/search?utf8=%E2%9C%93&q=etcd/">thousands of projects on GitHub</a> are affiliated with etcd, including projects built on etcd, client bindings, and more.</p>
<p>На додачу, <a href="https://github.com/search?utf8=%E2%9C%93&q=etcd/">тисячі проєктів на GitHub</a> повʼязані з etcd, включаючи проєкти, побудовані на etcd, клієнтські привʼязки та інше.</p>

@wendy-ha18
Copy link
Contributor

wendy-ha18 commented Aug 27, 2025

Hi @jverce could you help me include the recent Slack thread discussion for Ukrainian translation in the description: https://kubernetes.slack.com/archives/C3HD8ARJ5/p1755650169034809 then we don't forget about how we can make the content being translate every new version release/or considering translation management platform for long term.

@wendy-ha18
Copy link
Contributor

From the Netlify review: https://deploy-preview-942--etcd.netlify.app/ , it seems like the navigation bar hasn't shown the Languague drop out selection yet? (or how user can review different translation?).

I think in the navigation, it should display language like this right?

image

@jverce
Copy link
Contributor Author

jverce commented Aug 27, 2025

Thanks for the suggestion @wendy-ha18, I just updated the description!

@jverce
Copy link
Contributor Author

jverce commented Aug 27, 2025

From the Netlify review: deploy-preview-942--etcd.netlify.app , it seems like the navigation bar hasn't shown the Languague drop out selection yet? (or how user can review different translation?).

I think in the navigation, it should display language like this right?

image

Yes, the dropdown should show all the languages, but IIRC this is intentionally hidden and will be added in a separate PR where we'll ship the whole translation.

@wendy-ha18
Copy link
Contributor

wendy-ha18 commented Aug 28, 2025

Hi @nate-double-u @chalin could you please help me have a look on this PR for the setup for 1st etcd localisation - Ukrainian language? I just need some experts eye from CNCF Docs team on this setup, as this is the first PR, after that @jverce properly will add language switcher navigation as he mentioned above I belive.

If you have any suggestion on direction, feel free to input for our contributor as well.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants