QueryJane | Development update.

in #utopian-io8 years ago (edited)

QueryJane is a web application developed with Django that allows to connect with companies and experts in different sectors of the cannabis industry. Beta version is available here.


Screen Shot 2018-03-22 at 3.37.23 PM.png

In order to offer internationalization components to the applications users, I have implemented the translations of stored data in multiple languages. I have enabled the option to add company and profile description in English and Spanish. Also, some data like the industry categories must be stored in both languages. I have added the necessary logic to show users the information in the appropriate language depending on the browser language.

Also, I have added a local_settings.py file generator. Let me show you.

New Features

Translate data stored in multiple langauges.

Some data stored in the application database must be stored in multiple languages, like industry categories. Some data can be stored in multiple languages, like company description. In the first case, it is required that the data be stored in all available languages (Spanish and English now). In the case of company description, or profile description, users must add it in least one language.

If the user's browser language is Spanish, the data will be showed in Spanish, else, the data will be showed in English.

  • Translating industry categories according to the browser language: Translated industry categories for company form, company detail, company update, companies list, companies in dashboard view, job offer form, job offer detail, job offer update, job offers list, job offers in dashboard view, landing page, profile update, profile detail.

In templates, current browser language can be obtained by using the following template tag:


{% get_current_language as LANGUAGE_CODE %}

It allows us to store the current language in the LANGUAGE_CODE variable.

To display the industry categories labels in the correct way, we can use an if statement:


Screen Shot 2018-03-22 at 4.51.31 PM.png

Detailed code changes can be found in this commit.



  • Added validations to company form to required at least company description in one language. Available languages are English and Spanish, then, I'm validating that at least one of them must be introduced in the create company form. I ave added the following validation to the clean method in the create company form:


Screen Shot 2018-03-22 at 4.56.54 PM.png

If a user does not add company description at least in one language, the following message is displayed:


Screen Shot 2018-03-22 at 4.59.06 PM.png

Detailed code changes can be found in these commits: 3b1d90, 72393.


  • Created template tags to get company description and profile description in current browser language. Per now, if the user's browser language is Spanish, and the company has a Spanish description or the profile has a Spanish description, the returned value will be the Spanish description, else, will be the English description. At least one of these two fields is required. The created template tags are the following:


Screen Shot 2018-03-22 at 5.02.26 PM.png

Detailed code changes can be found in these commits: 6fb24, 3f5f9.


Changed user Dashboard distribution.

Changed user's dashboard elements distribution. The previous dashboard was a little desorganized. Previously all new messages and all new notifications was displayed on the Dashboard view. Now, If there are more than three new elements, a link to redirect users the the inbox or to the notifications page is showed. Also, the grid has been changed to display two column, and not three, in order to show the companies and job offers information in a clearer way.


Screen Shot 2018-03-22 at 5.07.04 PM.png

Detailed code changes can be found in these commits: 7fa40, 0fae4.


Generate local_settings.py file.

Some of the added variables to the settings.py file are sensitive, and can not be versioned for security standards. I have added a new step in the local deployment process of the project. It consists in generate a local_seettings.py file so developers interested to contribute with the application can set their own local settings in a secure way, in a file that was added to the .gitignore file. Now, when developers are running up the project, they must run the following command to generate their own local settings file:


test ! -e app/local_settings.py && cp app/test/local_settings.py.j2 app/local_settings.py

It generates a file called local_settings.py in app/, at the same level of settings.py, and, once generated, developers can set configuration variables like AWS bucket access (Media files are stored in a S3 bucket), email host, Facebook app keys and Twitter app keys.

This file is generated from app/test/local_settings.py.j2.

Detailed code changes can be found in this PR.



Screen Shot 2018-02-03 at 10.23.10 PM.png


How to contribute?

QueryJane has been developed using the Django framework. You can fork the project, and run it locally is very easy. Follow the steps described in the open source repository installation guide. The project has been configured using Docker. you only need to install Docker and follow these steps.

Future work.

Take a look to our public trello board. This is the easiest way to know our roadmap.

  • SEO optimization.
  • Javascript files translation.

If you want to contribute, please join my Discord.


Have happy days ✌



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.

[utopian-moderator]

Hey @kit.andres I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Its really a good explanation for tech devs.

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.083
BTC 62069.28
ETH 1614.34
USDT 1.00
SBD 0.45