Skip to content

Add localization support for layouts#13832

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
raelga:feature/add-localization-support-for-layouts
Apr 17, 2019
Merged

Add localization support for layouts#13832
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
raelga:feature/add-localization-support-for-layouts

Conversation

@raelga
Copy link
Copy Markdown
Member

@raelga raelga commented Apr 15, 2019

This PR adds support to localized templates by extracting all hardcoded string to i18n strings.

Also sets the html lang attribute to the current page language using {{ .Language }} as suggested by @remyleone in #13799 > layouts/docs/baseof.html.

cc @kubernetes/sig-docs-l10n-admins @zacharysarah @remyleone

@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 15, 2019
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2019

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

Built with commit 6f3a9f7

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

@tengqm
Copy link
Copy Markdown
Contributor

tengqm commented Apr 16, 2019

looks great.
/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 16, 2019
@zacharysarah
Copy link
Copy Markdown
Contributor

@raelga Looking at the preview page in Spanish, I still see "Tell Your Story" and not "Cuéntanos tu historia".

@raelga
Copy link
Copy Markdown
Member Author

raelga commented Apr 16, 2019

@tengqm and @zacharysarah, thanks for the review!

About the "Tell your story", at this point is an image:

https://github.com/kubernetes/website/blob/master/static/images/case_studies/story.png

So the translation affects only to the alternative text:

<img src="https://d33wubrfki0l68.cloudfront.net/1f25fd3bb7209410ad60613770321deb5959c2e6/e2c98/images/case_studies/story.png"
alt="Cuéntanos tu historia">

Any suggestion on how to tackle localized versions of images with Hugo?

@zacharysarah
Copy link
Copy Markdown
Contributor

@raelga

About the "Tell your story", at this point is an image:

Oh, interesting. That's a great question.

@alexcontini 👋 Does "Tell your story" need to be an image? Is there a way to populate with text instead?

remyleone added a commit to remyleone/website that referenced this pull request Apr 16, 2019
k8s-ci-robot pushed a commit that referenced this pull request Apr 16, 2019
* Add description meta tag to improve SEO results

* Fixes

* Remove those files from my PR and have those changes in #13832
i18n/es.toml Outdated
# layouts > docs > search

[layouts_docs_search_fetching]
other = "Fetching results.."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is still in English. Maybe "Obtención de resultados"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks! Yes, my bad. Commited before saving the file, fixed in the new squashed commit.

@zacharysarah
Copy link
Copy Markdown
Contributor

zacharysarah commented Apr 16, 2019

@raelga Once you address @bene2k1's comment, I think we can proceed with merging this PR. We can handle images iteratively. 👍

EDIT: Also please squash your commits. 😅

TechinMama pushed a commit to TechinMama/website that referenced this pull request Apr 16, 2019
* Add description meta tag to improve SEO results

* Fixes

* Remove those files from my PR and have those changes in kubernetes#13832
Add layouts/docs/glossary en i18n strings
Add layouts/docs/glossary es i18n strings
Use i18n strings in layouts/docs/glossary
Add layouts/blog/pager en i18n strings
Add layouts/blog/pager es i18n strings
Use i18n strings in layouts/blog/pager
Add layouts/blog/list en  i18n strings
Add layouts/blog/list es  i18n strings
Use i18n strings in layouts/case-studies/list
Add layouts/docs/search en i18n strings
Add layouts/docs/search es i18n strings
Use i18n strings in layouts/docs/search
Add layouts/partials/feedback en i18n strings
Add layouts/partials/feedback es i18n strings
Use i18n strings in layouts/partials/feedback
Set html lang using "{{ .Language }}"
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2019
@raelga
Copy link
Copy Markdown
Member Author

raelga commented Apr 16, 2019

@bene2k1 comment fixed, thanks for spotting it. I probably commited before saving the localized version.

@zacharysarah Reviews fixed and commits squashed!

@zacharysarah
Copy link
Copy Markdown
Contributor

@kubernetes/sig-docs-l10n-admins

Summary

This PR includes upstream changes to the contents of i18n/en.toml and layouts/.

Impact for localization teams

These changes are non-breaking.

These changes enable localization of content that was previously hard-coded in English.

@zacharysarah
Copy link
Copy Markdown
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 Apr 17, 2019
@k8s-ci-robot
Copy link
Copy Markdown
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

Details 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 17, 2019
@k8s-ci-robot k8s-ci-robot merged commit 20842e0 into kubernetes:master Apr 17, 2019
nowjean pushed a commit to nowjean/website that referenced this pull request Jun 13, 2019
* Add description meta tag to improve SEO results

* Fixes

* Remove those files from my PR and have those changes in kubernetes#13832
nowjean pushed a commit to nowjean/website that referenced this pull request Jun 13, 2019
Add layouts/docs/glossary en i18n strings
Add layouts/docs/glossary es i18n strings
Use i18n strings in layouts/docs/glossary
Add layouts/blog/pager en i18n strings
Add layouts/blog/pager es i18n strings
Use i18n strings in layouts/blog/pager
Add layouts/blog/list en  i18n strings
Add layouts/blog/list es  i18n strings
Use i18n strings in layouts/case-studies/list
Add layouts/docs/search en i18n strings
Add layouts/docs/search es i18n strings
Use i18n strings in layouts/docs/search
Add layouts/partials/feedback en i18n strings
Add layouts/partials/feedback es i18n strings
Use i18n strings in layouts/partials/feedback
Set html lang using "{{ .Language }}"
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants