Skip to content

Commit

Permalink
#156 #157 added aragones language, set spa-cat default selection
Browse files Browse the repository at this point in the history
  • Loading branch information
paugnu committed Mar 22, 2016
1 parent e7a3ecd commit c63d662
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 11 additions & 9 deletions static/js/traductor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ var traductor_json_url = "http://www.softcatala.org/apertium/json/translate";
(function($) {
//Set the initial default pairs on document ready
jQuery(document).ready(function(){
jQuery('#origin_language').val('cat');
jQuery('#target_language').val('spa');
jQuery('#origin_language').val('spa');
jQuery('#target_language').val('cat');

//Left
jQuery('#origin-cat').addClass('select');
jQuery('#origin-spa').removeClass('select');
jQuery('#origin-spa').addClass('select');
jQuery('#origin-cat').removeClass('select');
jQuery('[data-id="origin-select"]').removeClass('select');

//Right
jQuery('#target-cat').attr('disabled', 'disabled');
jQuery('#target-spa').removeAttr('disabled');
jQuery('#target-spa').attr('disabled', 'disabled');
jQuery('#target-spa').removeClass('select');
jQuery('[data-id="target-select"]').removeClass('select');
jQuery('[data-id="target-select"]').removeAttr('disabled');
jQuery('[data-id="target-select"]').attr('disabled', 'disabled');
jQuery('#target-cat').removeAttr('disabled');
jQuery('#target-cat').addClass('select');

//Mobile (left-right)
jQuery('#origin-select-mobil').val('cat');
jQuery('#target-select-mobil').val('spa');
jQuery('#origin-select-mobil').val('spa');
jQuery('#target-select-mobil').val('cat');
jQuery('#origin-select-mobil').selectpicker('render');
jQuery('#target-select-mobil').selectpicker('render');
jQuery('.selectpicker').selectpicker('refresh');
Expand Down
4 changes: 4 additions & 0 deletions templates/traductor.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<option value="oc">Occità/Aranès</option>
<option value="fr">Francès</option>
<option value="pt">Portuguès</option>
<option value="arg">Aragonès</option>
</select>
</div><!--/dropdown llengues -->

Expand All @@ -41,6 +42,7 @@
<option value="cat">Català</option>
<option value="spa">Castellà</option>
<option value="oc">Occità/Aranès</option>
<option value="arg">Aragonès</option>
<option value="fr">Francès</option>
<option value="pt">Portuguès</option>
</select>
Expand All @@ -63,6 +65,7 @@
<option value="oc">Occità/Aranès</option>
<option value="fr">Francès</option>
<option value="pt">Portuguès</option>
<option value="arg">Aragonès</option>
</select>
</div><!--/dropdown llengues -->

Expand All @@ -73,6 +76,7 @@
<option value="cat">Català</option>
<option value="spa" selected="selected">Castellà</option>
<option value="oc">Occità/Aranès</option>
<option value="arg">Aragonès</option>
<option value="fr">Francès</option>
<option value="pt">Portuguès</option>
</select>
Expand Down

0 comments on commit c63d662

Please sign in to comment.