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

Move portuguese content to pt-br to correct shortcode problems and add redirection #27413

Merged
merged 4 commits into from
Apr 20, 2021

Conversation

rikatz
Copy link
Contributor

@rikatz rikatz commented Apr 5, 2021

After Hugo 0.76 the i18n Go library has been migrated, breaking languages like portuguese in some parts (as it requires the full locale like pt-br instead of only pt).

This PR migrates the Portuguese translation to pt-br and adds a redirect in netlify to users that might have bookmarked the documentation in portuguese to be redirected to /pt-br/

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 5, 2021
@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 5, 2021
@rikatz rikatz force-pushed the move-pt-location branch from c0ffaa5 to 7214220 Compare April 5, 2021 17:23
@rikatz
Copy link
Contributor Author

rikatz commented Apr 5, 2021

/assign @sftim

As we spoke. I'm waiting for the preview to be generated so we can see if this works :D

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 5, 2021
@netlify
Copy link

netlify bot commented Apr 5, 2021

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

Built with commit 4f134c4

https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app

@netlify
Copy link

netlify bot commented Apr 5, 2021

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

Built with commit 4c42fa2

https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app

@jailton
Copy link
Member

jailton commented Apr 6, 2021

@rikatz thanks!

/lgtm

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

LGTM label has been added.

Git tree hash: 27c7f27bbad3d61a05f207abc6f62405c69144eb

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

A couple of minor things.

static/_redirects Outdated Show resolved Hide resolved
i18n/pt-br.toml Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 6, 2021
@rikatz
Copy link
Contributor Author

rikatz commented Apr 6, 2021

/label tide/merge-method-squash

@sftim everything corrected here :)

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 6, 2021
@kbhawkey
Copy link
Contributor

kbhawkey commented Apr 6, 2021

I am happy to see the site build warning errors removed. I will review the changes.
I suggest waiting to merge this PR until the 1.21 release is complete.
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 6, 2021
@kbhawkey
Copy link
Contributor

kbhawkey commented Apr 6, 2021

Hi @rikatz ,
Do you think the name of the language in the language dropdown list should change (Portuguese Brazil)?
Is the "print entire section" string translated in the docsy theme (pt-br)?

Page previews:
https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app/pt-br/

https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app/pt-br/blog/

Note: The image is missing from the community page?
https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app/pt-br/community/

Note: I saw a warning about the URL?
https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app/pt-br/partners/#kcsp

https://deploy-preview-27413--kubernetes-io-master-staging.netlify.app/pt-br/docs/concepts/containers/images/

@rikatz
Copy link
Contributor Author

rikatz commented Apr 7, 2021

Hey @kbhawkey thanks for the double checking and getting those problems.

Is the "print entire section" string translated in the docsy theme (pt-br)?

The string exists in docsy theme (themes/docsy/i18n/pt-br.toml) but it's not translated for any language.

Those are the new short codes, probably other localizations would want to translate them as well. I've added them to i18n/pt-br.toml just to make it work, but if you think it's better I can open the PR directly to docsy repo :)

[post_create_issue]
[print_click_to_print]
[print_entire_section]
[print_printable_section]
[print_show_regular]

Do you think the name of the language in the language dropdown list should change (Portuguese Brazil)?

I have no strong opinion on this. I guess as soon as no one wants to translate to Portuguese from Portugal, we can keep the dropdown item as is, and then it's only simple change in config.toml if we decide for something different later.

The image is missing from the community page?
Actually it seems the community page is a static html and not a markdown :D (_index.html). Anyway, I guess we can open a followup issue/PR and ask for someone to take a look (will do now in Slack) (@jailton @devlware @Jesus fyi)

EDIT: Issue opened: #27446

About the warnings - I've ran hugo serve -F --i18n-warnings and regarding portuguese I only saw:

i18n|MISSING_TRANSLATION|pt-BR|main_kubeweekly_past_link

Which seems to be a shortcode not translated yet in any other language :D Can do a followup as well (as @sftim asked me to keep this PR related to the location movement).

So:

  • I've added the missing print shortcodes (the last separated commit)
  • Moved the content to a location where we don't have a lot of warnings anymore and shortcodes get translated

I'm more than ok (and I think it's actually right!) to wait until the doc freeze ends and v1.21 gets released 🥳

@kbhawkey
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2021
@rikatz
Copy link
Contributor Author

rikatz commented Apr 15, 2021

Hey @kbhawkey @sftim can we move forward with this one?

Thanks!!

@rikatz
Copy link
Contributor Author

rikatz commented Apr 19, 2021

Adding some comments here about the safeness of this PR:

  • Hugo and docsy already look into pt-br location (instead of only pt). While the only translation variation existent in k/docs nowadays is Brazilian Portuguese, doing this will allow some future work if someone wants to other Portuguese variations
  • To help people that has already bookmarked docs/pt, we've added some redirections in this case.
  • The language menu list wasn't changed as we are already being the 'Portuguese' translation existent, but changing this in a future is a no impact

@kbhawkey
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kbhawkey

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 Apr 19, 2021
@jailton
Copy link
Member

jailton commented Apr 20, 2021

/lgtm

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

LGTM label has been added.

Git tree hash: 373291e94579270af4565dc5a4ec0400f09dce84

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. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants