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

i18n/zh.toml file in Docsy was renamed, causing many warnings #33002

Closed
jihoon-seo opened this issue Apr 18, 2022 · 5 comments
Closed

i18n/zh.toml file in Docsy was renamed, causing many warnings #33002

jihoon-seo opened this issue Apr 18, 2022 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@jihoon-seo
Copy link
Member

This is a Bug Report

Problem:

I followed the section "Running the website using a container" in README of this repo, and I met too many warnings appearing.

With

  • Ubuntu 18.04 desktop amd64
  • the latest commit of this repo (0ea4666)
  • Docsy whose version is the same as of https://github.com/kubernetes/website/tree/main/themes (docsy @ 1c77bb2)
  • npm version: 6.14.15
  • node version: v14.18.1
  • go version go1.17.3 linux/amd64
  • hugo v0.96.0-2fd4a7d3d6845e75f8b8ae3a2a7bd91438967bbb+extended linux/amd64 BuildDate=2022-03-26T09:15:58Z VendorInfo=mage
  • Docker Client/Server: 20.10.11

[How to reproduce]

❯ git submodule update --init --recursive --depth 1
# OK with no output
❯ make container-image
Click to expand!
docker build . \
        --network=host \
        --tag gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c \
        --build-arg HUGO_VERSION=0.87.0
Sending build context to Docker daemon  4.096kB
Step 1/12 : FROM golang:1.16-alpine
 ---> bef5ede0cd8a
Step 2/12 : LABEL maintainer="Luc Perkins <lperkins@linuxfoundation.org>"
 ---> Using cache
 ---> ea1b9510c298
Step 3/12 : RUN apk add --no-cache     curl     gcc     g++     musl-dev     build-base     libc6-compat
 ---> Using cache
 ---> f05caa3e7415
Step 4/12 : ARG HUGO_VERSION
 ---> Using cache
 ---> 2fcb154e3840
Step 5/12 : RUN mkdir $HOME/src &&     cd $HOME/src &&     curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz &&     cd "hugo-${HUGO_VERSION}" &&     go install --tags extended
 ---> Using cache
 ---> d8dc47e67f27
Step 6/12 : FROM golang:1.16-alpine
 ---> bef5ede0cd8a
Step 7/12 : RUN apk add --no-cache     runuser     git     openssh-client     rsync     npm &&     npm install -D autoprefixer postcss-cli
 ---> Using cache
 ---> b967abdfd2c6
Step 8/12 : RUN mkdir -p /var/hugo &&     addgroup -Sg 1000 hugo &&     adduser -Sg hugo -u 1000 -h /var/hugo hugo &&     chown -R hugo: /var/hugo &&     runuser -u hugo -- git config --global --add safe.directory /src
 ---> Using cache
 ---> 7638babd1bb9
Step 9/12 : COPY --from=0 /go/bin/hugo /usr/local/bin/hugo
 ---> Using cache
 ---> 2d20fa31ea4f
Step 10/12 : WORKDIR /src
 ---> Using cache
 ---> de95bc5ea077
Step 11/12 : USER hugo:hugo
 ---> Using cache
 ---> 6419cabb97d9
Step 12/12 : EXPOSE 1313
 ---> Using cache
 ---> f639279f9d50
Successfully built f639279f9d50
Successfully tagged gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c
❯ make container-serve

(About 4,000 lines of warning)

Click to expand!
docker run --rm --interactive --tty --volume /home/jhseo/k8s-website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
Start building sites … 
hugo v0.87.0+extended linux/amd64 BuildDate=unknown
�[0;33mWARN�[0m 2022/04/18 06:51:57 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "ui_pager_prev": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "ui_pager_prev": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "ui_pager_next": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "ui_pager_next": %!s(<nil>)
...
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "post_last_mod": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "post_edit_this": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "post_create_child_page": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "post_create_issue": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "print_entire_section": %!s(<nil>)
...
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "ui_in": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:51:59 Failed to get translated string for language "zh" and ID "ui_read_more": %!s(<nil>)
...
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_entire_section": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_printable_section": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_click_to_print": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_show_regular": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_printable_section": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_click_to_print": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "print_show_regular": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:00 Failed to get translated string for language "zh" and ID "post_byline_by": %!s(<nil>)
...
�[?25h
�[K
                   |  EN  |  ZH  | KO  | JA  | FR  | IT  | DE  | ES  | PT-BR | ID  | RU  | VI  | PL  | UK   
-------------------+------+------+-----+-----+-----+-----+-----+-----+-------+-----+-----+-----+-----+------
  Pages            | 1438 | 1002 | 539 | 448 | 338 |  71 | 164 | 292 |   183 | 335 | 155 |  77 |  69 |  92  
  Paginator pages  |   42 |    8 |   0 |   0 |   0 |   0 |   0 |   0 |     0 |   0 |   0 |   0 |   0 |   0  
  Non-page files   |  507 |  367 | 200 | 266 |  73 |  20 |  17 |  33 |    30 | 105 |  24 |   8 |   6 |  20  
  Static files     |  834 |  834 | 834 | 834 | 834 | 834 | 834 | 834 |   834 | 834 | 834 | 834 | 834 | 834  
  Processed images |    1 |    1 |   0 |   0 |   0 |   0 |   0 |   0 |     0 |   0 |   0 |   0 |   0 |   0  
  Aliases          |    8 |    1 |   3 |   1 |   0 |   1 |   0 |   0 |     1 |   1 |   1 |   0 |   0 |   0  
  Sitemaps         |    2 |    1 |   1 |   1 |   1 |   1 |   1 |   1 |     1 |   1 |   1 |   1 |   1 |   1  
  Cleaned          |    0 |    0 |   0 |   0 |   0 |   0 |   0 |   0 |     0 |   0 |   0 |   0 |   0 |   0  

Built in 9651 ms
Watching for changes in /src/{archetypes,assets,content,data,i18n,layouts,package.json,postcss.config.js,static,themes}
Watching for config changes in /src/config.toml, /src/themes/docsy/config.toml, /src/go.mod
Environment: "development"
Serving pages from /tmp/hugo
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 0.0.0.0)
Press Ctrl+C to stop
�[0;33mWARN�[0m 2022/04/18 06:52:07 Failed to get translated string for language "zh" and ID "post_last_mod": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:07 Failed to get translated string for language "zh" and ID "post_edit_this": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:07 Failed to get translated string for language "zh" and ID "post_create_child_page": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:07 Failed to get translated string for language "zh" and ID "post_create_issue": %!s(<nil>)
�[0;33mWARN�[0m 2022/04/18 06:52:07 Failed to get translated string for language "zh" and ID "print_entire_section": %!s(<nil>)
^C

Proposed Solution:

@jihoon-seo jihoon-seo added the kind/bug Categorizes issue or PR as related to a bug. label Apr 18, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 18, 2022
@sftim
Copy link
Contributor

sftim commented Apr 19, 2022

These extra warnings are, I think, a side effect of switching to a new version of Docsy. We should look into ways to reduce the number of errors; ideally, by localizing more strings but other interim options could be good to.

I would not be a fan of hiding the warnings entirely; they are there for a reason.

@jihoon-seo
Copy link
Member Author

jihoon-seo commented Apr 20, 2022

Yes the Docsy version used by k/w was updated by you (@sftim) recently,
and I found that in Docsy, the i18n/zh.toml file was updated and renamed to i18n/zh-cn.toml.
(To see, go to here and click the "Files changed" tab,
since it is not possible to get the direct link to those changes.)

Suggested solution:
Update to read themes/docsy/i18n/zh-cn.toml instead of themes/docsy/i18n/zh.toml (which does not exist anymore)
when rendering Chinese pages of Kubernetes website.

@jihoon-seo jihoon-seo changed the title Too many warnings when running the website using a container i18n/zh.toml file in Docsy was renamed, causing many warnings Apr 20, 2022
@tengqm
Copy link
Contributor

tengqm commented May 26, 2022

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 26, 2022
@tengqm
Copy link
Contributor

tengqm commented May 26, 2022

Opening a new issue to track this transition.
Closing this one.
/close

@k8s-ci-robot
Copy link
Contributor

@tengqm: Closing this issue.

In response to this:

Opening a new issue to track this transition.
Closing this one.
/close

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants