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

Merge missing translations #10355

Merged
merged 2 commits into from
Oct 1, 2018
Merged

Merge missing translations #10355

merged 2 commits into from
Oct 1, 2018

Conversation

bep
Copy link
Contributor

@bep bep commented Sep 20, 2018

This is the last batch of "language related changes" from me for now.

Note that before this gets merged, the dummy Norwegian translation needs to be disabled in config.toml.

It's easier to get a grasp of this PR by looking at the content tree for the Norwegian translation:

content/no
├── _common-resources
│   └── index.md
├── _index.html
├── blog
│   ├── _index.md
│   └── _posts
│       └── 2018-09-06-2018-steering-committee-election-cycle-kicks-off.md
├── case-studies
│   ├── _index.md
│   └── adform
│       └── index.html
└── docs
    ├── _index.md
    ├── contribute
    │   └── _index.md
    ├── home
    │   └── _index.md
    ├── reference
    │   ├── _index.md
    │   └── glossary
    │       ├── container.md
    │       └── index.md
    ├── setup
    │   ├── _index.md
    │   └── pick-right-solution.md
    └── tutorials
        └── kubernetes-basics
            └── _index.md

In summary, this is what's needed for a new language:

  • The section content files (see "_index*", esp. note the home page) with its menu definitions.
  • A translation of the language bundle in /i18n
  • A language configuration in config.toml

In that language configuration, you can specify an ordered list of one or more languages to fill inn missing translations from. In this PR, no has this set to language_alternatives = ["en"].

This language merging has an effect in

  • Blog. The last blog entry from language_alternatives will be shown on front page if not translated. Also, the archive is merged.
  • Docs browser
  • Docs left tree nav
  • Glossary page, glossary tooltip
  • Case studies

Links to "foreign language" is marked with its language and opens up in a new window.

There is certainly more to be done in this area (the glossary page contains some untranslated text, and the user journey is only available in English, to mention some examples. But think now at least it makes sense to let other languages in.)

This PR updates Hugo to 0.48. That is built with Go 1.11, which makes the relevant template constructs much simpler.

/cc @zacharysarah @chenopis

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 20, 2018
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 20, 2018
@k8sio-netlify-preview-bot
Copy link
Collaborator

Deploy preview for kubernetes-io-master-staging ready!

Built with commit a4c91db

https://deploy-preview-10355--kubernetes-io-master-staging.netlify.com

@k8sio-netlify-preview-bot
Copy link
Collaborator

Deploy preview for kubernetes-io-master-staging ready!

Built with commit 4d23e05

https://deploy-preview-10355--kubernetes-io-master-staging.netlify.com

@bep
Copy link
Contributor Author

bep commented Sep 20, 2018

There seems to be a logical flaw in the blog archive ... I will fix that tomorrow.

@bep
Copy link
Contributor Author

bep commented Sep 21, 2018

Re. my comment above: I found a bug in Hugo that needs to be resolved for this PR to work 100%. I will get that into a planned released for Monday.

@k8sio-netlify-preview-bot
Copy link
Collaborator

Deploy preview for kubernetes-io-master-staging ready!

Built with commit 02f0ba3

https://deploy-preview-10355--kubernetes-io-master-staging.netlify.com

@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented Sep 24, 2018

Deploy preview for kubernetes-io-master-staging ready!

Built with commit 699be41

https://deploy-preview-10355--kubernetes-io-master-staging.netlify.com

@bep
Copy link
Contributor Author

bep commented Sep 24, 2018

I have bumped the Hugo versions to 0.49 in this PR, which has fixed the "language merge" issue on the blog archive.

/cc @zacharysarah

@zacharysarah
Copy link
Contributor

@bep 👋 Thanks for your work here. Some questions:

Note that before this gets merged, the dummy Norwegian translation needs to be disabled in config.toml

To disable the dummy translation, is it sufficient to remove this block from config.toml:

[languages.no]
title = "Kubernetes"
description = "Production-Grade Container Orchestration"
languageName ="Norsk"
weight = 3
contentDir = "content/no"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]

...or must we also remove file content: i18n/no.toml, content/no/?

I can't think of a good reason to keep the dummy files ☝️ after this PR merges, but am curious as to whether they must be removed entirely for Hugo to be happy or can simply be disabled in config.toml.

@bep
Copy link
Contributor Author

bep commented Sep 25, 2018

@zacharysarah No, it's easier than that, see my comment in config.toml:

# This is currently used for testing.
# disableLanguages = ["no"]

The above can also be set as an OS environment variable (I will dig up the syntax if you need it), and its main motivation is to use when you're in the process of translating a new language.

@zacharysarah
Copy link
Contributor

@bep

No, it's easier than that, see my comment in config.toml:

Cool! ✨ From the OP:

Note that before this gets merged, the dummy Norwegian translation needs to be disabled in config.toml.

I disabled the dummy translation in a separate commit. It works in the preview, so let's go ahead and merge.

/cc @lucperkins 👋 You may have to resolve merge conflicts in #10373 and #10381 due to changes in Makefile.

@zacharysarah
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 1, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zacharysarah

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 1, 2018
@k8s-ci-robot k8s-ci-robot merged commit 32014f9 into kubernetes:master Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants