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

Add page to list all translations #56

Merged
merged 3 commits into from
Oct 19, 2018

Conversation

oriolbcn
Copy link
Contributor

@oriolbcn oriolbcn commented Oct 19, 2018

Closes #47 (only the list part)

Added a separate page that lists all translations found in the repository. Translations are handled in the front-end using Vue.

Why Vue?

Initially using Vue seems to be overkill, but I think it's the best alternative taking into account that we want to be able to search phrases and it should be fast.

These are the options I have considered:

  • Load all the translations from the back-end and search from the back-end: This would make the search slow as every time we would need to make a request and load all the translations (which is slow)
  • Render all translations from the back-end and then build the search in front-end: This would be tricky as we would need to iterate over all the elements in the DOM to know their key and value and then build a JS object with that to be able to search. Also it would be tricky to show / hide the elements in the DOM when searching. This, further, limits the possibility of doing front-end pagination since the page can get heavy when there are a lot of phrases (therefore a lot of elements in the DOM)
  • Do everything in front-end manually (without Vue): This is quite complex as we need to template each of the elements in the DOM and iterate / repaint them when the search changes.

In the end, Vue is a light-weight dependency (80Kb minified), it's similar to the size of JQuery and it allows to implement the front-end rendering in a very elegant and powerful way. So I think it's the best alternative.

Other thinngs

I have moved all the CSS into a separate file and changes the _translate_menu partial to reference that.

By using Vue we need to duplicate all repository partials to use the Vue syntax. The idea is to migrate also the sidebar menu to Vue, therefore eliminating the duplication.

@oriolbcn oriolbcn requested a review from artero October 19, 2018 10:02
@oriolbcn oriolbcn force-pushed the feature/list-translations-page branch from 935fb59 to 486b426 Compare October 19, 2018 10:51
@oriolbcn oriolbcn merged commit e6c32b1 into release/1.2.0 Oct 19, 2018
@oriolbcn oriolbcn deleted the feature/list-translations-page branch October 19, 2018 10:57
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