Skip to content

Commit

Permalink
made it possible to translate setting options for displaying dots/lab…
Browse files Browse the repository at this point in the history
…els, colorizing by region/cognate #477 [1]
  • Loading branch information
Hans-Jörg Bibiko committed Jun 8, 2018
1 parent 06bbec3 commit d161845
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions site/js/templates/TopMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@
{{showDataAs}}
{{#ShowDataAs}}
<label class="radio">
<input type="radio" name="ShowDataAs" value="{{.}}">{{.}}
<input type="radio" name="ShowDataAs" value="{{val}}">{{display}}
</label>
{{/ShowDataAs}}
</li>
<li>
{{coloriseDataAs}}
{{#ColoriseDataAs}}
<label class="radio">
<input type="radio" name="ColoriseDataAs" value="{{.}}">{{.}}
<input type="radio" name="ColoriseDataAs" value="{{val}}">{{display}}
</label>
{{/ColoriseDataAs}}
</li>
Expand Down
18 changes: 16 additions & 2 deletions site/js/views/render/TopMenuView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ define(['backbone'], function(Backbone){
this.model = {
formats: ['mp3','ogg'],
IPATooltipFontSize: ['100%', '125%', '150%'],
ShowDataAs: ['dots', 'labels'],
ColoriseDataAs: ['region', 'cognate'],
ShowDataAs: [
{ val:'dots', display:'dots' },
{ val:'labels', display:'labels' }
],
ColoriseDataAs: [
{ val:'region', display:'region' },
{ val:'cognate', display:'cognate'}
],
};
// init IPATooltipFontSize from stored cookies if given
var nameFontSize = "IPATooltipFontSize=";
Expand Down Expand Up @@ -88,13 +94,21 @@ define(['backbone'], function(Backbone){
, format: 'topmenu_download_format'
, ipaTooltipFontSize: 'topmenu_settings_ipaFontSizeMap'
, showDataAs: 'topmenu_settings_showDataAs'
, showDataAsDots: 'topmenu_settings_showDataAsDots'
, showDataAsLabels: 'topmenu_settings_showDataAsLabels'
, coloriseDataAs: 'topmenu_settings_coloriseDataAs'
, coloriseDataAsRegion: 'topmenu_settings_coloriseDataAsRegion'
, coloriseDataAsCognate: 'topmenu_settings_coloriseDataAsCognate'
, soundClickTitle: 'topmenu_soundoptions_tooltip'
, soundHoverTitle: 'topmenu_soundoptions_hover'
, createShortLink: 'topmenu_createShortLink'
, viewContributors: 'topmenu_about_whoarewe'
});
this.setModel(staticT);
this.model.ShowDataAs[0].display = this.model.showDataAsDots;
this.model.ShowDataAs[1].display = this.model.showDataAsLabels;
this.model.ColoriseDataAs[0].display = this.model.coloriseDataAsRegion;
this.model.ColoriseDataAs[1].display = this.model.coloriseDataAsCognate;
}
/**
Generates the study part of the TopMenu.
Expand Down

0 comments on commit d161845

Please sign in to comment.