Add translations to all strings
This commit is contained in:
Родитель
692e3952d2
Коммит
b18d50119d
|
@ -22,6 +22,7 @@
|
|||
"Handlebars": true,
|
||||
"DS": true,
|
||||
"Promise": true,
|
||||
"I18n": true,
|
||||
"localforage": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ HighFidelity.SearchController = Ember.ObjectController.extend({
|
|||
resultCount: 0,
|
||||
results: null,
|
||||
|
||||
searchPlaceholder: I18n.t('search.placeholder'),
|
||||
|
||||
search: function(query) {
|
||||
var _this = this;
|
||||
|
||||
|
@ -33,9 +35,6 @@ HighFidelity.SearchController = Ember.ObjectController.extend({
|
|||
});
|
||||
});
|
||||
|
||||
console.info('Raw Search Results:', response);
|
||||
console.info('iTunes Search Results:', results);
|
||||
|
||||
_this.set('isSearching', false);
|
||||
_this.set('resultCount', response.resultCount);
|
||||
_this.set('results', response.results);
|
||||
|
@ -55,7 +54,8 @@ HighFidelity.SearchController = Ember.ObjectController.extend({
|
|||
},
|
||||
|
||||
subscribe: function(url, podcastName) {
|
||||
if (window.confirm('Subscribe to ' + podcastName + '?')) {
|
||||
if (window.confirm(I18n.t('search.subscribe',
|
||||
{podcast: podcastName}))) {
|
||||
HighFidelity.Podcast.createFromController(this, url);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*global I18n:true */
|
||||
Ember.Handlebars.registerHelper('t', function(property, options) {
|
||||
var params = options.hash;
|
||||
var _this = this;
|
||||
|
|
|
@ -1,32 +1,53 @@
|
|||
/*global I18n:true */
|
||||
I18n.defaultLocale = "en-US";
|
||||
I18n.locale = window.navigator.language || 'en-US';
|
||||
I18n.fallbacks = true;
|
||||
I18n.translations = {
|
||||
en: {
|
||||
app: {
|
||||
title: 'Podcasts'
|
||||
title: 'Podcasts',
|
||||
},
|
||||
episode: {
|
||||
episodes: 'Episodes'
|
||||
episodes: 'Episodes',
|
||||
new: 'New:',
|
||||
},
|
||||
podcast: {
|
||||
add: 'Add',
|
||||
addOne: 'Want to add one?',
|
||||
addRSSFeed: 'Add RSS Feed',
|
||||
newToPodcasts: 'New to Podcasts?',
|
||||
noneFound: 'No podcasts found.',
|
||||
recommendations: 'Check out our recommendations:',
|
||||
},
|
||||
search: {
|
||||
find: 'Find',
|
||||
noResults: 'No results.',
|
||||
placeholder: 'Podcast Name or Keywords',
|
||||
searchForAPodcast: 'Search for a Podcast',
|
||||
subscribe: 'Subscribe to {{podcast}}?',
|
||||
},
|
||||
tabs: {
|
||||
myPodcasts: 'My Podcasts',
|
||||
popular: 'Popular',
|
||||
search: 'Search'
|
||||
search: 'Search',
|
||||
},
|
||||
welcome: 'Welcome to Rec Room!'
|
||||
},
|
||||
|
||||
fr: {
|
||||
app: {
|
||||
title: 'Podcasts'
|
||||
title: 'Podcasts',
|
||||
},
|
||||
episode: {
|
||||
episodes: "Episodes"
|
||||
episodes: "Episodes",
|
||||
new: 'nouveau:',
|
||||
},
|
||||
search: {
|
||||
find: 'trouver',
|
||||
searchForAPodcast: 'Retrouver un podcast',
|
||||
},
|
||||
tabs: {
|
||||
myPodcasts: 'mon podcasts',
|
||||
popular: 'populaire',
|
||||
search: 'recherche'
|
||||
search: 'recherche',
|
||||
},
|
||||
welcome: 'Bievenue à Rec Room !'
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#search-input {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.results {
|
||||
box-sizing: border-box;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div {{action setEpisode this}} {{bind-attr class=":episode isNew"}}>
|
||||
<div class="name">
|
||||
{{#if isNew}}
|
||||
<strong>New:</strong>
|
||||
<strong>{{t episode.new}}</strong>
|
||||
{{/if}}
|
||||
{{name}}
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<h2>Add Podcast RSS</h2>
|
||||
<h2>{{t podcast.addRSSFeed}}</h2>
|
||||
|
||||
{{input type="url" value=rssURL placeholder="Podcast URL"}}
|
||||
<button {{action create}}>Add</button>
|
||||
<button {{action create}}>{{t podcast.add}}</button>
|
||||
|
||||
<h2>New to Podcasts?</h2>
|
||||
<h3>Check out our recommendations:</h3>
|
||||
<h2>{{t podcast.newToPodcasts}}</h2>
|
||||
<h3>{{t podcast.recommendations}}</h3>
|
||||
|
||||
<h4>The Cracked Podcast</h4>
|
||||
<img alt="The Cracked Podcast" class="cover cover-image"
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
</ul>
|
||||
{{else}}
|
||||
<div class="center">
|
||||
<h2>No podcasts found.</h2>
|
||||
<h2>{{t podcast.noneFound}}</h2>
|
||||
<p>
|
||||
Want to {{#link-to 'podcast.new'}}add one?{{/link-to}}
|
||||
{{#link-to 'podcast.new'}}{{t podcast.addOne}}{{/link-to}}
|
||||
</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<h2>Search for a Podcast</h2>
|
||||
<h2>{{t search.searchForAPodcast}}</h2>
|
||||
|
||||
{{input type="search" value=query placeholder="Podcast Name or Keywords"}}
|
||||
<button {{action search}}>Find</button>
|
||||
{{input type="search" value=query placeholder=searchPlaceholder id="search-input"}}
|
||||
<button {{action search}}>{{t search.find}}</button>
|
||||
|
||||
{{#if isSearching}}
|
||||
<div class="full-screen">
|
||||
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<p>No results found.</p>
|
||||
<p>{{t search.noResults}}</p>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче