Thursday 21 August 2014

#FinalReport



Joining all the bits and pieces of work done in the last few months , here is the final implementation of the work done in diaspora.

Whenever a new user tries to sign up for the website additional to all the options he could choose till date now he can choose the posts of his known languages. He is given an option to choose all the languages he is aware of at first.
Language selection for new user
ISO codes of the selected languages are loaded into a dynamically sized array and stored along with the user preferences. 

Right after this the user is directed towards the stream. Whenever he posts a status message he is given an option of either choosing auto detection of language of the post or he can manually select the language of the post from the dropdown. And then he is ready to post.
Language selection while posting

Support for more languages can be added. For more details or helping the support for other languages see this gem. Currently this is the ones used for auto detection. To avoid any sort of ambiguity I have provided manual tagging option for these languages only.

Finally this is how a post looks. Whenever we post something the language is right where the mouse is pointing. Fixed the UI to display the language not as a part of post.
Post View

I have also added the ISO code as a part of post for transparency, has edited it while committing.
P.S:- This post is auto tagged and hence some problem with tagging.

Also tried filtering with a crude button, works fine as of now. Will add filtering as per languages in some time.

Tuesday 12 August 2014

Stage#2 Commit#1



It has been really long since my last blog post and I was terribly ill for a long long time. I have shared my problems and concerns with the community people and my mentors. Thanks a lot for being so supportive and helping me get back on track when I had minimal hope left.

I feel somewhat better now and tried my level best to reflect changes. I started with adding languages to user preferences for the filtration purpose. After some discussion with mentors and Diaspora people the following tasks are completed :-

1)  Added the User interface for selecting or deselecting multiple languages in the getting started page        for new users using standard rails tag and conventions. I then linked the interface to a new model          for preferred languages via the getting_started controller.

Getting Started New UI

2)  The languages are stored in this model along with the ISO codes as specified in the                              locale_settings.yml

3)  Rails association table is used to link them to user model . Followed all the rails conventions and          had to use some additional validations to carry it out.

4)  A new controller for the preferred languages has been written so as to handle creation, editing,            deletion or any such related requests in the forthcoming part.

I am currently cleaning up the code part till Mid evaluation (storing the languages as ISO codes, writing separate functions in models for auto detection etc). Can create the filter as soon as that's done.

Friday 20 June 2014

#include "week5"



This week was continuous commits and fixing the issues. Most of the part can be found here . It's the pull request which I gave and Diaspora people aided me a lot with the issues. They wanted me to change the methodology because it would create a lot of complication and confusion in the tags following path. We even came to final conclusion that adding a filter on top of it may disturb the existing tags functionality. However the code written for Language selection and detection was considered useful and they want me to build everything on top of it. Fetching any variables from publisher page to status message controllers is still ongoing and seems pretty tough. Adding a normal select dropdown list makes the css look like

Dropdown
List
It messes up the front end even after trying to fix the CSS and doesn't get the work done. I am finally trying to get it by adding some javascript. They even asked me to do the Language selection while signing up totally client side. I worked on it and managed to get it but we're still deciding on how to store it in back-end as the plan of storing it as followed tags has been crossed off. 

Monday 16 June 2014

#include "week4"



This week was mostly about the backbone.js part for the implementation of translation and a dropdown list for the modification of language after posting a post.

Mainly a couple of changes have to be made to this file. Still the backbone part is new to me and the I need to study it for some time to implement. Besides this I am finalizing the UI for this and authorization about who can change the language. Also I am in discussion about how to implement the translation part.  Although the UI for this part will be very trivial, back-end storage will be somewhat complicated and take much time.

I am also working on the css part for language display. I had some discussion with diaspora people regarding the review of what I have done so far. They asked me to send a pull request for a detailed discussion base. Currently , they're reviewing the code and said they will get back to me with a solution. 

Thursday 5 June 2014

#include "week2 && week3"



Last week  I had some work progress but most of them were left  incomplete and I had to solve the bugs to bring them to this stag.

Testing WhatLanguage Gem :

As I mentioned earlier it turned out that I had to use language field in status method so I planned on going ahead and adding another line in status message itself to see if this gem works.
After including the gem in Gemfile and using it for detection it works juts fine. Mostly the detection goes wrong for normal English sentences. However we have option for manual tagging to control it.


Tag while post feature : 

I have changed the view for the main stream .



I have added another field called Language and selected "Auto Tag" by default so that if without changing it if a user posts, it uses the gem to autodetect language. I tried using some standard haml dropdowns but they din't work on this view so I had to use their standards to not make the view go berserk. Currently I am working on fetching the selected field to status_messages_controller.rb. 


Sign_up page modifications : 

As mentioned in the proposal I was about to make changes to the sign_up page to add preferred languages.


I added the field to do so. Due to some errors in Javascript the autocomplete feature is not working for it . Currently I am having discussions about it in Diaspora-dev and with my mentor. Will come up with an update soon .


PS: I have updated my git repo . You can have a look at the commit history or pull the latest one and try to have a look at the added features. :) 

Saturday 24 May 2014

#include "week1"



This week was mostly about getting acquainted with codebase and reflecting small changes while working on it.

Initially I wanted to add a column "language" to the existing posts model. I tried it many ways but failed initially. By declaring it as "xml_attr" worked but then I failed to assign value like "english" etc. due to validations . Then skipped validations by using .update_attribute and then it worked. Turns out that only existing attribute types from existing model can be declared.

This might work now but will certainly create issues in future as we don't need language as a xml attribute, so I didn't reflect any changes and searching for alternatives.

I decided to proceed similarly as the existing "/tags" field. Will add relevant js files and controllers in coming weeks.

I finally found out the template being used to display stream and comments. It's a format I am not very used to so still exploring how to exactly reflect changes.

I have created a new branch language_filter. I have added the model, spec and migration for language. One can either add model and use rake db:migrate or the existing application and run "rake db:seed" (this part should be done in both the cases) to add all the entries to the language table. Changes can be seen by opening the branch.

Sunday 18 May 2014

#Begin





I have been selected for the project Language Filter for Diaspora by SMC . I am super excited about this and have been exploring the codebase and their formats.

Hopefully GSOC with Swathanthra Malayam Computing is going to be fun. I am mentored by Ershad K. and Praveen. Short description about my project can be found here .

To start with there were many views and it was really hard to find relevant ones so I'll be using RailsPanel to find relevant controllers and views and use them accordingly.

I have already implemented emoticons support for diaspora so I am slightly aware of their coding standards and will try my level best to keep up with it.