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

Refactor navigation menu to use i18n plugin #1208

Closed
wants to merge 2 commits into from

Conversation

erciccione
Copy link
Contributor

This continues the work of refactoring parts of the website that weren't adapted when introducing the i18n plugin, resulting in a lot of duplicate files, impossibility to scale and hard maintainability. This PRs fixes only the navigation menu, but we should also make the footers use the i18n plugin, so we can remove the _data/lang folder altogether. I will take care of that soon.

For clarity, the sections which still need to be refactored are:

  • footer-1
  • footer-2
  • User guides
  • Moneropedia entries

The last two are particularly difficult to refactor because a lot of user guides and Moneropedia entries where translated since the implemenation of the i18n plugin for the other half of the website. Adapting all the translated entries to the new system will be changelling and time consuming (see logs of the last community meeting for details).

Changes:

  • Refactored navigation menu (in _includes/header.html) to make it use the i18n plugin. The navigation menu was previously not added in the i18n system and was unscalable and hard to maintain in that structure.
  • Removed all duplicated navigation files of each language. This structure required to edit all of them (13 files) when a change was needed.
  • This fixes missed entries and make possible to translate the navigation menu on Weblate
  • Added the translations for all menu entries in all languages to their relative i18n/LANG.yml file
  • Most of the menu entries in navigation.yml were duplicates of the 'titles' entries of the i18n/LANG.yml files. I copied the non-duplicated menu entries to a dedicate navigation section of the language fields. We use the entries in the titles section for the already existing menu entries.

@netlify
Copy link

netlify bot commented Sep 24, 2020

Deploy preview for barolo-time-757cf9 ready!

Built with commit 01c8346

https://deploy-preview-1208--barolo-time-757cf9.netlify.app

_i18n/nb_NO.yml Outdated
merchants: Forhandlere
resources: Ressurser
about: Om
mrl: Forskningslab
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a trailing newline here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@erciccione
Copy link
Contributor Author

These commits were merged with #1217 (that PR was based on this one)

@erciccione erciccione closed this Oct 22, 2020
@erciccione erciccione deleted the refactor-nav branch November 11, 2020 10:41
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.

None yet

2 participants