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

Footer should link to Rosetta pages when available #52

Closed
5 tasks
iandunn opened this issue Jan 1, 2022 · 2 comments
Closed
5 tasks

Footer should link to Rosetta pages when available #52

iandunn opened this issue Jan 1, 2022 · 2 comments
Labels
[Type] Enhancement New feature or request
Milestone

Comments

@iandunn
Copy link
Member

iandunn commented Jan 1, 2022

Similar to #49, the footer links need to go to Rosetta-specific pages, when they're available. When they're not, they should fallback to the main site.

e.g., https://nl.wordpress.org/about/ exists, so the current footer uses that. There isn't a translated Hosting page, though, so it just links to https://wordpress.org/hosting/

The simplest way might be to copy the old footer, which just manually makes specific links use $localised_domain.

If that won't work well, then another approach might be to:

  • rename get_global_menu_items() to get_global_header_menu_items()
  • create a similar function called get_global_footer_menu_items(), populate it w/ the current/English links
  • convert footer.php to loop through the items programattically, and generate wp:navigation-link comments, just like header.php does. Maybe create a helper function to make it DRY across both files.
  • create a function called something link inject_rosetta_urls(). it could be passed the global items, and loop through them. when the rosetta site has a localized page, it could replace the url/title. then it'd return all the items (some of which are now localized, and some of which are still the original English version)
  • in render_global_footer(), do something like:
     $menu_items = get_global_footer_menu_items();
     
     if ( is_rosetta_site() ) {
     	$menu_items = inject_rosetta_urls();
     }
@ryelle
Copy link
Contributor

ryelle commented Jan 20, 2022

Now that #106 is merged, is there anything else to do here?

@iandunn
Copy link
Member Author

iandunn commented Jan 20, 2022

Nope 👍🏻

@iandunn iandunn closed this as completed Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants