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

feat: add translations #52

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

feat: add translations #52

wants to merge 13 commits into from

Conversation

zeroedin
Copy link
Collaborator

@zeroedin zeroedin commented Jul 10, 2023

What I did

  • First pass at translations
  • Added netlify.toml to redirect if no language is specified to english default
  • Reduced rhb-nav-secondary static code and improved translation access

TODO

  • Identify which languages we absolutely need to go live
  • Identify areas which we can improve translation data by minimizing key,value pairs.
  • Identify areas where we can reduce repeating of patterns in templates through partial usage
  • Translate all pages to Spanish
    • home
    • foundations/history
    • foundations/personality
    • foundations/strategy
    • logos/certification-logos
    • logos/co-brand-logos
    • logos/dei-community-logos
    • logos/digital-badges
    • logos/endorsement-logos
    • logos/initiative-logos
    • logos/logo
    • logos/partner-logos
    • logos/product-logos
    • logos/red-hat-and-ibm-logos
    • logos/summit-logos
    • logos/the-hat
    • logos/universal-logos
    • expression/applications
    • expression/red-hat-marketplace
    • expression/templates
    • visual-system/color
    • visual-system/icons
    • visual-system/illustration
    • visual-system/photography
    • visual-system/product-icons
    • visual-system/standard-icons
    • visual-system/typography
    • visual-system/ui-icons

Testing Instructions

Notes for Reviewers

Only the homepage data has been translated (so far). Most of the copy for the Spanish translation I pulled over from the current sites translation.

What happens when the translated page isn't the same as the English page?

English:
https://www.redhat.com/en/about/brand/standards?brand-expression=funcional
Spanish:
https://www.redhat.com/es/about/brand/standards?brand-expression=funcional

The number of cards is different for English and Spanish for the What's new section. Do we want to do data driven templates?

What should be translated and what isn't? It doesn't seem like images have alt tags translated. Should they? What about page titles, some are, some aren't (homepage as example).

@changeset-bot
Copy link

changeset-bot bot commented Jul 10, 2023

⚠️ No Changeset found

Latest commit: 00f5824

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for prismatic-souffle-43beb6 ready!

Name Link
🔨 Latest commit 00f5824
🔍 Latest deploy log https://app.netlify.com/sites/prismatic-souffle-43beb6/deploys/64b15200b71b040008913b42
😎 Deploy Preview https://deploy-preview-52--prismatic-souffle-43beb6.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

Choose a reason for hiding this comment

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

how much work would it be to have

/website/expression/applications/en.webc
/website/expression/applications/es.webc

instead of

/website/en/expression/applications.webc
/website/es/expression/applications.webc

we can compute the permalink data key, remember.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The file structure in this PR is the prefered 11ty way of doing this

https://www.11ty.dev/docs/i18n/#how-to-organize-your-files

Copy link
Member

Choose a reason for hiding this comment

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

is there too much content structure in this template? wouldn't it be better to leave the main to pages to fill in, rather than sprinkling in keyed "slots" (not slot elements) for frontmatter content?

We should keep the number of keyed content-as-data areas to a minimum - 2 or 3 max. This way, design and layout changes would happen in content files, not in layouts

Copy link
Collaborator Author

@zeroedin zeroedin Jul 11, 2023

Choose a reason for hiding this comment

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

I think we could definitely look at where main is output in the layouts.

That said, I wouldn't classify the template you are linking against as a layout per say.

This way, design and layout changes would happen in content files, not in layouts

Right now the keyed content mimics the "block" sections of the page. If you are suggesting we create layouts (what i would call a partial) for things like grid-4-cards for reducing duplication then yeah I think we could look at where those patterns are repeated and slim those down.

I think we could also look at using the translation data to drive template decisions too such as the grid-4-cards example by using yml arrays to loop through. I need to first answer the question if we want to conflate translations with urls to images etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to first answer the question if we want to conflate translations with urls to images etc.

One benefit of doing so would be the ability to output a different image for different languages if desired.

@zeroedin
Copy link
Collaborator Author

Setting Spanish as preferred language in Chrome doesn't seem to forward you as I thought with the netlify.toml

image

@zeroedin
Copy link
Collaborator Author

Setting Spanish as preferred language in Chrome doesn't seem to forward you as I thought with the netlify.toml

Fixed by swapping the order of the redirects

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

Successfully merging this pull request may close these issues.

2 participants