blogo 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e9414f33926d6a0f9b0194feb91d3d91508fa89
4
- data.tar.gz: 38963344d8ec1ef5a21e50a26620c0d7e4f18d80
3
+ metadata.gz: db848f7682345fd76f34c90d5ed1184fc72045fb
4
+ data.tar.gz: c4d0905aa90ee12b1c3ba2f878c93e91590650e3
5
5
  SHA512:
6
- metadata.gz: b2ee7af561e6a9b021e54f7b804dd67b2c10aec38154ae2ad7d2bfc8244ea91681e0e8281c8c4006b033d37697bafcfb89395ba1d8adbf185061658dc82bcd93
7
- data.tar.gz: c0b8f7d1d2ea751a7af7a2d6a0178ae0a1a1ef7798fe6b3a2161098819f32edc8ce8ba70661803af7d7c8cc1b6779d986a7bc13ca16b63c6926cd5ee11731e55
6
+ metadata.gz: 9a746ee3d6a05df89e43f129f0772afc28ba07496c57334c84f8eab985ae88c02c7c71aa219d9ac7e1bd594b0f773beeed6dee39a571f01d3b72d4265af0a4c4
7
+ data.tar.gz: 3783b7bc6c741984e0451d77b27626e4c77fb3838394643c07fd34d6f785a0a4da40d27ee657e4ca0fb713ad95379761661b1f49394d702875f1b004f6fba6c7
data/README.markdown CHANGED
@@ -64,6 +64,7 @@ Go to http://localhost::3000/blog to take a look at your posts.
64
64
  * SEO optimized: generates meta description, keywords, meta tags for facebook([OpenGraph](http://ogp.me/)) and twitter
65
65
  * Can be customized for your own needs.
66
66
  * Very few external dependencies
67
+ * Localization support
67
68
 
68
69
 
69
70
  ## Markup Formats
@@ -81,6 +82,7 @@ add necessary dependencies to your Gemfile manually.
81
82
  ## Credits
82
83
 
83
84
  * [Sergey Potapov](https://github.com/greyblake) - creator and maintainer
85
+ * [Diego Souza](https://github.com/diegosouza) - I18n support
84
86
 
85
87
  ## License
86
88
 
@@ -18,7 +18,7 @@ module Blogo::Admin
18
18
  file_path = Rails.root.join('public', image_directory, image_name)
19
19
 
20
20
  if File.exists?(file_path)
21
- @error = "Image with name \"#{image_name}\" already exists"
21
+ @error = I18n.translate('blogo.admin.image_already_exists', image_name: image_name)
22
22
  else
23
23
  dir = File.dirname(file_path)
24
24
  FileUtils.mkdir_p(dir) unless File.exists?(dir)
@@ -21,7 +21,7 @@ module Blogo::Admin
21
21
 
22
22
  if service.create!
23
23
  @post = service.post
24
- flash[:notice] = "The post is created"
24
+ flash[:notice] = I18n.translate('blogo.admin.post_created')
25
25
  redirect_to blogo_admin_posts_path
26
26
  else
27
27
  @post = service.post
@@ -42,7 +42,7 @@ module Blogo::Admin
42
42
  service = Blogo::UpdatePostService.new(@post, post_params)
43
43
 
44
44
  if service.update!
45
- flash[:notice] = "The post is updated"
45
+ flash[:notice] = I18n.translate('blogo.admin.post_updated')
46
46
  redirect_to blogo_admin_posts_path
47
47
  else
48
48
  render 'edit'
@@ -55,7 +55,7 @@ module Blogo::Admin
55
55
  post = Blogo::Post.find(params[:id])
56
56
  Blogo::DestroyPostService.new(post).destroy!
57
57
 
58
- flash[:notice] = "The post is removed"
58
+ flash[:notice] = I18n.translate('blogo.admin.post_removed')
59
59
  redirect_to blogo_admin_posts_path
60
60
  end
61
61
 
@@ -17,9 +17,9 @@ module Blogo::Admin
17
17
  user = Blogo::User.find_by_email(params[:email])
18
18
  if user && user.authenticate(params[:password])
19
19
  session[:blogo_user_id] = user.id
20
- redirect_to blogo_admin_url, notice: "You have logged in"
20
+ redirect_to blogo_admin_url, notice: I18n.translate('blogo.admin.logged_in')
21
21
  else
22
- flash.now.alert = "Incorrect email or password"
22
+ flash.now.alert = I18n.translate('blogo.admin.login_fail')
23
23
  render "new"
24
24
  end
25
25
  end
@@ -29,7 +29,7 @@ module Blogo::Admin
29
29
  #
30
30
  def destroy
31
31
  session[:blogo_user_id] = nil
32
- redirect_to blogo_admin_url, notice: "You have logged out"
32
+ redirect_to blogo_admin_url, notice: I18n.translate('blogo.admin.logged_out')
33
33
  end
34
34
  end
35
35
  end
@@ -1,5 +1,5 @@
1
1
  <div id="recent-comments">
2
- <h1 class="admin-header">Recent comments</h1>
2
+ <h1 class="admin-header"><%= t('blogo.admin.recent_comments') %></h1>
3
3
  <script type="text/javascript" src="//<%= Blogo.config.disqus_shortname%>.disqus.com/recent_comments_widget.js?num_items=20&avatar_size=48&excerpt_length=500"></script>
4
4
  </div>
5
5
 
@@ -3,41 +3,41 @@
3
3
  <div class="pure-g-r form-new-post">
4
4
  <div class="pure-u-17-24">
5
5
  <div class="left-fields"^>
6
- <%= f.text_field :title, required: true, id: 'post-title', placeholder: 'Post Title' %>
6
+ <%= f.text_field :title, required: true, id: 'post-title', placeholder: t('blogo.admin.post_title') %>
7
7
 
8
8
  <%= f.text_area :raw_content, class: 'ckeditor', required: true %>
9
9
 
10
- <%= f.text_field :tags_string, placeholder: 'Tags separated with commas' %>
10
+ <%= f.text_field :tags_string, placeholder: t('blogo.admin.tags_separated_with_commas') %>
11
11
  </div>
12
12
  </div>
13
13
 
14
14
  <div class="pure-u-7-24">
15
- <%= f.text_field :permalink, class: 'pure-input-1', required: true, id: 'permalink', placeholder: 'unique-permalink' %>
15
+ <%= f.text_field :permalink, class: 'pure-input-1', required: true, id: 'permalink', placeholder: t('blogo.admin.unique_permalink') %>
16
16
 
17
- <%= f.label :published_at, 'Published on' %>
18
- <%= f.text_field :published_at, class: 'pure-input-1', id: 'input-datepicker', placeholder: 'Today' %>
17
+ <%= f.label :published_at, t('blogo.admin.published_on') %>
18
+ <%= f.text_field :published_at, class: 'pure-input-1', id: 'input-datepicker', placeholder: t('blogo.admin.today') %>
19
19
 
20
20
  <%= f.label :published, class: 'pure-checkbox' do %>
21
21
  <%= f.check_box :published %>
22
- Publish
22
+ <%= t('blogo.admin.publish') %>
23
23
  <% end %>
24
24
 
25
25
  </div>
26
26
  </div>
27
27
 
28
28
  <br />
29
- <%= f.button "Save" , class: 'pure-button button-success', id: 'button-save' %>
30
- <%= f.button "Preview" , class: 'pure-button button-secondary', id: 'button-preview' %>
29
+ <%= f.button t('blogo.admin.save_post_button') , class: 'pure-button button-success', id: 'button-save' %>
30
+ <%= f.button t('blogo.admin.preview_post_button') , class: 'pure-button button-secondary', id: 'button-preview' %>
31
31
 
32
32
 
33
33
  <section class="semantic-content" id="modal-preview" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
34
34
  <div class="modal-inner">
35
35
  <header id="modal-label">
36
- <h1>Preview. Press ESC to back.</h1>
36
+ <h1><%= t('blogo.admin.preview_press_esc') %></h1>
37
37
  </header>
38
38
  <div class="modal-content"><iframe></iframe></div>
39
39
  </div>
40
- <a href="#!" class="modal-close" title="Close preview" data-close="Close" data-dismiss="modal">×</a>
40
+ <a href="#!" class="modal-close" title="<%= t('blogo.admin.modal_title_close_preview') %>" data-close="Close" data-dismiss="modal">×</a>
41
41
  </section>
42
42
 
43
43
 
@@ -1,14 +1,14 @@
1
1
  <%
2
- confirm_message = %Q'Are you sure you want to delete "#{post.title}"?'
2
+ confirm_message = t('blogo.admin.modal_confirm_delete_post', post_title: post.title)
3
3
  %>
4
4
 
5
5
  <tr>
6
6
  <td><%= link_to post.title, edit_blogo_admin_post_path(post) %></td>
7
- <td><%= post.status %></td>
7
+ <td><%= t("blogo.admin.post_status_#{post.status}") %></td>
8
8
  <td><%= post.user.name %></td>
9
- <td><%= post.published_at.to_date %></td>
9
+ <td><%= l(post.published_at.to_date) %></td>
10
10
  <td>
11
- <%= link_to 'edit', edit_blogo_admin_post_path(post), class: "pure-button button-secondary" %>
12
- <%= link_to 'delete', blogo_admin_post_path(post), method: :delete, data: {confirm: confirm_message}, class: "pure-button button-warning" %>
11
+ <%= link_to t('blogo.admin.edit_post_button'), edit_blogo_admin_post_path(post), class: "pure-button button-secondary" %>
12
+ <%= link_to t('blogo.admin.delete_post_button'), blogo_admin_post_path(post), method: :delete, data: {confirm: confirm_message}, class: "pure-button button-warning" %>
13
13
  </td>
14
14
  </tr>
@@ -1,4 +1,4 @@
1
- <h1 class="admin-header">Edit post</h1>
1
+ <h1 class="admin-header"><%= t('blogo.admin.edit_post') %></h1>
2
2
 
3
3
  <%= blogo_form_for [:blogo, :admin, @post], method: :patch, html: {id: 'post-form', class: 'pure-form pure-form-stacked'} do |f| %>
4
4
  <%= render partial: 'form', locals: {f: f} %>
@@ -1,12 +1,12 @@
1
- <h1 class="admin-header">Posts</h1>
1
+ <h1 class="admin-header"><%= t('blogo.admin.posts') %></h1>
2
2
 
3
3
  <table class="pure-table pure-table-striped">
4
4
  <thead>
5
5
  <tr>
6
- <th><%= 'Title' %></th>
7
- <th><%= 'Status' %></th>
8
- <th><%= 'Author' %></th>
9
- <th><%= 'Published on' %></th>
6
+ <th><%= t('blogo.admin.title') %></th>
7
+ <th><%= t('blogo.admin.status') %></th>
8
+ <th><%= t('blogo.admin.author') %></th>
9
+ <th><%= t('blogo.admin.published_on') %></th>
10
10
  <th></th>
11
11
  </tr>
12
12
  </thead>
@@ -1,4 +1,4 @@
1
- <h1 class="admin-header">Add a new post</h1>
1
+ <h1 class="admin-header"><%= t('blogo.admin.add_new_post') %></h1>
2
2
 
3
3
  <%= blogo_form_for @post, :url => blogo_admin_posts_path, html: {id: 'post-form', class: 'pure-form pure-form-stacked'} do |f| %>
4
4
  <%= render partial: 'form', locals: {f: f} %>
@@ -1,14 +1,14 @@
1
1
  <%= form_tag blogo_admin_sessions_path, class: 'pure-form pure-form-stacked' do %>
2
2
  <fieldset>
3
3
 
4
- <legend>Login</legend>
4
+ <legend><%= t('blogo.admin.login') %></legend>
5
5
 
6
- <%= label_tag :email %>
6
+ <%= label_tag :email, t('blogo.admin.email') %>
7
7
  <%= text_field_tag :email, params[:email] %>
8
8
 
9
- <%= label_tag :password %>
9
+ <%= label_tag :password, t('blogo.admin.password') %>
10
10
  <%= password_field_tag :password %>
11
11
 
12
- <%= submit_tag "Login", class: 'pure-button' %>
12
+ <%= submit_tag t('blogo.admin.login_button'), class: 'pure-button' %>
13
13
  <fieldset>
14
14
  <% end %>
@@ -1,10 +1,10 @@
1
1
  <div class="pure-menu pure-menu-open pure-menu-horizontal nav">
2
2
  <ul>
3
- <li><%= link_to "Blogo" , blogo_admin_path %> </li>
4
- <li><%= link_to "New Post", new_blogo_admin_post_path %></li>
5
- <li><%= link_to "Comments", blogo_admin_comments_path %></li>
3
+ <li><%= link_to "Blogo" , blogo_admin_path %> </li>
4
+ <li><%= link_to t('blogo.admin.new_post'), new_blogo_admin_post_path %></li>
5
+ <li><%= link_to t('blogo.admin.comments'), blogo_admin_comments_path %></li>
6
6
  </ul>
7
7
  <ul class="pull-right">
8
- <li><%= link_to "Sign out", blogo_admin_logout_path %></li>
8
+ <li><%= link_to t('blogo.admin.sign_out'), blogo_admin_logout_path %></li>
9
9
  </ul>
10
10
  </div>
@@ -1,8 +1,8 @@
1
1
  <% if Blogo.config.disqus_shortname %>
2
2
  <section id='disqus-comments'>
3
- <h1> Comments </h1>
3
+ <h1><%= t('blogo.user.comments') %></h1>
4
4
  <div id="disqus_thread" aria-live="polite"></div>
5
- <noscript>Please enable JavaScript to view the comments.</noscript>
5
+ <noscript><%= t('blogo.user.please_enable_javascript') %></noscript>
6
6
  </section>
7
7
 
8
8
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="posted">
5
5
  <span>
6
- By <%= post.user.name %>
6
+ <%= t('blogo.user.post_by') %> <%= post.user.name %>
7
7
  </span> |
8
8
  <span>
9
9
  <time datetime="<%= post.published_at %>">
@@ -5,5 +5,5 @@
5
5
  <%= raw post_overview(post) %>
6
6
  </div>
7
7
 
8
- <%= link_to "Read ➞", blogo_post_path(post), class: 'pure-button button-secondary' %>
8
+ <%= link_to t('blogo.user.read_post'), blogo_post_path(post), class: 'pure-button button-secondary' %>
9
9
  </section>
@@ -1,7 +1,7 @@
1
1
  <aside>
2
2
  <% if @recent_posts %>
3
3
  <header>
4
- <h1>Recent posts</h1>
4
+ <h1><%= t('blogo.user.recent_posts') %></h1>
5
5
  </header>
6
6
  <ul class="blogo-recent-posts">
7
7
  <% @recent_posts.each do |post| %>
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
  <header>
17
- <h1>Tags</h1>
17
+ <h1><%= t('blogo.user.tags') %></h1>
18
18
  </header>
19
19
  <div class="tags">
20
20
  <% @tags.each do |tag| %>
@@ -0,0 +1,47 @@
1
+ en:
2
+ blogo:
3
+ user:
4
+ comments: 'Comments'
5
+ please_enable_javascript: 'Please enable JavaScript to view the comments.'
6
+ post_by: 'By'
7
+ read_post: 'Read ➞'
8
+ recent_posts: 'Recent posts'
9
+ tags: 'Tags'
10
+
11
+ admin:
12
+ add_new_post: 'Add a new post'
13
+ author: 'Author'
14
+ comments: 'Comments'
15
+ delete_post_button: 'delete'
16
+ edit_post: 'Edit post'
17
+ edit_post_button: 'edit'
18
+ email: 'Email'
19
+ image_already_exists: 'Image with name "%{image_name}" already exists'
20
+ logged_in: 'You have logged in'
21
+ logged_out: 'You have logged out'
22
+ login: 'Login'
23
+ login_button: 'Login'
24
+ login_fail: 'Incorrect email or password'
25
+ modal_confirm_delete_post: 'Are you sure you want to delete "%{post_title}"?'
26
+ modal_title_close_preview: 'Close preview'
27
+ new_post: 'New Post'
28
+ password: 'Password'
29
+ post_created: 'The post is created'
30
+ post_removed: 'The post is removed'
31
+ post_status_draft: 'draft'
32
+ post_status_published: 'published'
33
+ post_title: 'Post Title'
34
+ post_updated: 'The post is updated'
35
+ posts: 'Posts'
36
+ preview_post_button: 'Preview'
37
+ preview_press_esc: 'Preview. Press ESC to back.'
38
+ publish: 'Publish'
39
+ published_on: 'Published on'
40
+ save_post_button: 'Save'
41
+ sign_out: 'Sign out'
42
+ status: 'Status'
43
+ tags_separated_with_commas: 'Tags separated with commas'
44
+ title: 'Title'
45
+ today: 'Today'
46
+ unique_permalink: 'unique-permalink'
47
+ recent_comments: 'Recent comments'
@@ -0,0 +1,47 @@
1
+ pt-BR:
2
+ blogo:
3
+ user:
4
+ comments: 'Comentários'
5
+ please_enable_javascript: 'Por favor, habilite o JavaScript para visualizar os comentários.'
6
+ post_by: 'Postado por'
7
+ read_post: 'Ler ➞'
8
+ recent_posts: 'Postagens recentes'
9
+ tags: 'Tags'
10
+
11
+ admin:
12
+ add_new_post: 'Criar uma nova postagem'
13
+ author: 'Autor'
14
+ comments: 'Comentários'
15
+ delete_post_button: 'apagar'
16
+ edit_post: 'Editar postagem'
17
+ edit_post_button: 'editar'
18
+ email: 'Email'
19
+ image_already_exists: 'Já existe uma imagem com o nome "%{image_name}"'
20
+ logged_in: 'Você está logado'
21
+ logged_out: 'A sessão foi encerrada'
22
+ login: 'Login'
23
+ login_button: 'Entrar'
24
+ login_fail: 'Email ou senha incorreta'
25
+ modal_confirm_delete_post: 'Tem certeza que deseja apagar "%{post_title}"?'
26
+ modal_title_close_preview: 'Fechar a pré-visualização'
27
+ new_post: 'Nova Postagem'
28
+ password: 'Senha'
29
+ post_created: 'A postagem foi salva'
30
+ post_removed: 'A postagem foi removida'
31
+ post_status_draft: 'rascunho'
32
+ post_status_published: 'publicado'
33
+ post_title: 'Título da Postagem'
34
+ post_updated: 'A postagem foi atualizada'
35
+ posts: 'Postagens'
36
+ preview_post_button: 'Pré-visualizar'
37
+ preview_press_esc: 'Pré-visualização. Pressione ESC para voltar.'
38
+ publish: 'Publicar'
39
+ published_on: 'Publicado em'
40
+ save_post_button: 'Salvar'
41
+ sign_out: 'Sair'
42
+ status: 'Estado'
43
+ tags_separated_with_commas: 'Tags separadas por vírgula'
44
+ title: 'Título'
45
+ today: 'Hoje'
46
+ unique_permalink: 'link-permanente-unico'
47
+ recent_comments: 'Comentários recentes'
data/lib/blogo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Blogo
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blogo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Potapov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -150,6 +150,8 @@ files:
150
150
  - app/views/layouts/blogo/admin.html.erb
151
151
  - app/views/layouts/blogo/blog.html.erb
152
152
  - config/environment.rb
153
+ - config/locales/en.yml
154
+ - config/locales/pt-BR.yml
153
155
  - db/migrate/20140218134508_create_blogo_users.rb
154
156
  - db/migrate/20140218134512_create_blogo_tags.rb
155
157
  - db/migrate/20140218134550_create_blogo_posts.rb