diff --git a/app/views/artist/_fail.html.haml b/app/views/artist/_fail.html.haml
index 7513463..2ae9f47 100644
--- a/app/views/artist/_fail.html.haml
+++ b/app/views/artist/_fail.html.haml
@@ -1,2 +1,2 @@
.alert-message.error
- %p Something very bad happened, sorry :(
\ No newline at end of file
+ %p= I18n.t 'search.fail'
\ No newline at end of file
diff --git a/app/views/artist/_page.html.haml b/app/views/artist/_page.html.haml
index 822c4fc..8c28076 100644
--- a/app/views/artist/_page.html.haml
+++ b/app/views/artist/_page.html.haml
@@ -1,6 +1,6 @@
- if @loading
.alert-message.warning
- %p Artist info is loading for the first time. Please, be patient! :)
+ %p= I18n.t 'search.loading'
.row.artist-info
.span4.columns.pic
= image_tag @artist[:artist][:pic] unless @artist[:artist][:pic].nil?
@@ -14,7 +14,7 @@
.span4.columns.art
%img{ :src => album[:pic] }
.button-container
- %a.btn Add to playlist
+ %a.btn= I18n.t 'player.add'
.span7.columns.tracks
%h3= album[:name] + " (" + album[:year].to_s + ")"
%table.zebra-striped.tracklist
diff --git a/app/views/artist/_suggestions.html.haml b/app/views/artist/_suggestions.html.haml
index 4f421ec..56c4095 100644
--- a/app/views/artist/_suggestions.html.haml
+++ b/app/views/artist/_suggestions.html.haml
@@ -1,5 +1,5 @@
.alert-message.warning
- %p Made a typo?
+ %p= I18n.t 'search.typo'
%ul.suggestions
- @suggestions.each do |artist|
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index dba23ec..10f133e 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -18,11 +18,11 @@
%a{ :href => "#/" } BeatHaven
%ul.nav
%li
- %a{ :href => "http://blog.beathaven.org/", :"data-ls" => "NEWS" } Blog
+ %a{ :href => "http://blog.beathaven.org/" }= I18n.t 'global.news'
%li
- %a.about{ :href => "#/about/" } About
+ %a.about{ :href => "#/about/" }= I18n.t 'global.about'
%form#search-form{ :action => "" }
- %input#search{ :type => "text", :placeholder => "Search" }
+ %input#search{ :type => "text", :placeholder => I18n.t('global.search') }
#artist-load-spinner
= image_tag "artist_loader.gif"
%ul.nav.secondary-nav
@@ -30,10 +30,10 @@
%a.dropdown-toggle#username{ :href => "#" } %username%
%ul.dropdown-menu
%li
- %a#preferences{ :href => "#" } Preferences
+ %a#preferences{ :href => "#" }= I18n.t 'global.settings'
%li.divider
%li
- %a#logout{ :href => "#" } Logout
+ %a#logout{ :href => "#" }= I18n.t 'global.logout'
.popover-wrapper
.popover.below#autocomplete-container
diff --git a/app/views/user/_settings.html.haml b/app/views/user/_settings.html.haml
index f589a9f..13c10cc 100644
--- a/app/views/user/_settings.html.haml
+++ b/app/views/user/_settings.html.haml
@@ -1,63 +1,63 @@
%h1 Settings
%ul.tabs#settings-tabs
%li.active
- %a{ :href => "#", :'data-tab' => 'account' } Account
+ %a{ :href => "#", :'data-tab' => 'account' }= I18n.t 'settings.tab.account'
%li
- %a{ :href => "#", :'data-tab' => 'site' } Site
+ %a{ :href => "#", :'data-tab' => 'site' }= I18n.t 'settings.tab.site'
%li
- %a{ :href => "#", :'data-tab' => 'music' } Music
+ %a{ :href => "#", :'data-tab' => 'music' }= I18n.t 'settings.tab.music'
%li
- %a{ :href => "#", :'data-tab' => 'lastfm' } Last.fm
+ %a{ :href => "#", :'data-tab' => 'lastfm' }= I18n.t 'settings.tab.lastfm'
.forms#settings-forms
.form.account
%form
%fieldset
.clearfix
- %label{ :for => "name" } Username
+ %label{ :for => "name" }= I18n.t 'settings.username'
.input
%input.xlarge#name{ :name => "name", :size => 30, :type => "text", :value => @user.name }
.clearfix
- %label{ :for => "email" } Email
+ %label{ :for => "email" }= I18n.t 'settings.email'
.input
%input.xlarge#email{ :name => "email", :size => 30, :type => "text", :value => @user.email }
.form.site
%form
%fieldset
.clearfix
- %label{ :for => "lang" } Language
+ %label{ :for => "lang" }= I18n.t 'settings.lang.title'
.input
%select.medium#lang{ :name => "lang" }
- %option{ :value => "en", :selected => (@user.lang == 'en') } English
- %option{ :value => "ru", :selected => (@user.lang == 'ru') } Русский
+ %option{ :value => "en", :selected => (@user.lang == 'en') }= I18n.t 'settings.lang.en'
+ %option{ :value => "ru", :selected => (@user.lang == 'ru') }= I18n.t 'settings.lang.ru'
.form.music
%form
%fieldset
.clearfix
- %label{ :for => "album_types" } Show
+ %label{ :for => "album_types" }= I18n.t 'settings.show'
.input
%ul.inputs-list
%li
%label.disabled
%input{ :name => "show_album", :type => "checkbox", :checked => "checked", :disabled => "disabled" }
- %span Albums
+ %span= I18n.t 'settings.music.albums'
%li
%label
%input{ :name => "show_single", :type => "checkbox", :disabled => "disabled" }
- %span Singles
+ %span= I18n.t 'settings.music.singles'
%li
%label
%input{ :name => "show_live", :type => "checkbox", :disabled => "disabled" }
- %span Live shows
+ %span= I18n.t 'settings.music.live'
%li
%label
%input{ :name => "show_bootleg", :type => "checkbox", :disabled => "disabled" }
- %span Bootlegs
+ %span= I18n.t 'settings.music.bootlegs'
.form.lastfm
%form
%fieldset
.clearfix
- %label{ :for => "lastfm_username" } Username
+ %label{ :for => "lastfm_username" }= I18n.t 'settings.username'
.input
.input-append
%input#lastfm_username{ :name => "lastfm_username", :type => "text", :disabled => "disabled", :value => @user.lastfm_username }
diff --git a/config/application.rb b/config/application.rb
index 744b756..f8948f9 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -31,7 +31,7 @@ module Beathaven
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
+ config.i18n.default_locale = :ru
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 179c14c..5f2cb16 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,5 +1,39 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
en:
- hello: "Hello world"
+ global:
+ search: "Search"
+ news: "News"
+ about: "About"
+ login: "Log in"
+ logout: "Log out"
+ do_add: "Add some music to playlist"
+ do_login: "Don't forget to log in, please. It's simple."
+ repeat: "Repeat"
+ shuffle: "Shuffle"
+ do_empty: "Empty playlist"
+ hello: "Hi there"
+ settings: "Settings"
+ search:
+ fail: "Something very bad happened while we tried out to load some info about this artist. How about some other one?"
+ loading: "Artist info is loading for the first time now. Usually it takes less than a minute, please wait a bit."
+ typo: "Misspelled?"
+ settings:
+ tab:
+ account: "Account"
+ site: "Site"
+ music: "Music"
+ lastfm: "Last.fm"
+ music:
+ albums: "Albums"
+
+ username: "Username"
+ email: "Email"
+ lang:
+ title: "Language"
+ en: "English"
+ ru: "Russian"
+ save: "Hello, my name is Useless Button"
+ not_connected: "Not connected"
+ connect: "Connect"
+ reload_alert: "To change application language it is needed to reload page. Your current playlist will be emptied and music will stop. Do you really wish to continue?"
+ player:
+ add: "Add to Now Playing"
\ No newline at end of file
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
new file mode 100644
index 0000000..9a2e653
--- /dev/null
+++ b/config/locales/ru.yml
@@ -0,0 +1,32 @@
+ru:
+ global:
+ search: "Поиск"
+ news: "Новости"
+ about: "О проекте"
+ login: "Войти"
+ logout: "Выйти"
+ do_add: "Добавьте музыку в плей-лист"
+ do_login: "Авторизуйтесь, пожалуйста. Это действительно просто."
+ repeat: "Повторять"
+ shuffle: "Перемешать"
+ do_empty: "Очистить"
+ hello: "Привет"
+ settings: "Настройки"
+
+ search:
+ fail: "Что-то ужасное произошло пока мы собирали информацию об этом исполнителе. Может пока поищем другого?"
+ loading: "Прямо сейчас мы собираем всю возможною информацию об этом исполнителе в первый раз. Обычно это занимает меньше минуты."
+ typo: "Опечатались?"
+
+ settings:
+ account: "Аккаунт"
+ lastfm: "Last.fm"
+ username: "Имя"
+ email: "Почта"
+ lang: "Язык"
+ not_connected: "Не подключен"
+ do_connect: "Подключить"
+ reload_alert: "Чтобы изменить язык приложения, необходимо перезагрузить страницу. Ваш текущий плей-лист будет очищен и музыка остановится. Вы действительно хотите продолжить?"
+
+ player:
+ do_add: "Добавить в плей-лист"
\ No newline at end of file