Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the translation #2

Merged
merged 3 commits into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions LICENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 9 additions & 8 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ class Plugin extends PluginBase
public function pluginDetails()
{
return [
'name' => 'Blog Views',
'description' => 'The plugin enables blog posts views tracking and displaying popular articles.',
'name' => 'vdomah.blogviews::lang.plugin.name',
'description' => 'vdomah.blogviews::lang.plugin.description',
'author' => 'Art Gek',
'icon' => 'icon-signal'
'icon' => 'icon-signal',
'homepage' => 'https://github.com/vdomah/blogviews'
];
}

Expand All @@ -44,16 +45,17 @@ public function pluginDetails()
public function registerComponents()
{
return [
'Vdomah\BlogViews\Components\Views' => 'views',
'Vdomah\BlogViews\Components\Popular' => 'popularPosts',
'Vdomah\BlogViews\Components\Views' => 'views',
'Vdomah\BlogViews\Components\Popular' => 'popularPosts'
];
}

public function boot()
{
PostComponent::extend(function($component) {
if ($this->app->runningInBackend())
if ($this->app->runningInBackend()) {
return;
}

if (!Session::has('postsviewed')) {
Session::put('postsviewed', []);
Expand Down Expand Up @@ -101,9 +103,8 @@ public function setViews($post, $views = null)
}
Db::table($this->table_views)->insert([
'post_id' => $post->getKey(),
'views' => $views,
'views' => $views
]);
}
}

}
9 changes: 4 additions & 5 deletions components/Popular.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Popular extends ComponentBase
public function componentDetails()
{
return [
'name' => 'Popular Posts',
'description' => 'Most viewed posts list'
'name' => 'vdomah.blogviews::lang.component.popular_name',
'description' => 'vdomah.blogviews::lang.component.popular_description'
];
}

Expand All @@ -60,7 +60,7 @@ public function defineProperties()
'type' => 'dropdown',
'default' => 'blog/post',
'group' => 'Links',
],
]
];
}

Expand Down Expand Up @@ -104,5 +104,4 @@ public function getPostPageOptions()
{
return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName');
}

}
}
9 changes: 4 additions & 5 deletions components/Views.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Views extends ComponentBase
public function componentDetails()
{
return [
'name' => 'Post Views',
'description' => 'Show post views'
'name' => 'vdomah.blogviews::lang.component.views_name',
'description' => 'vdomah.blogviews::lang.component.views_description'
];
}

Expand All @@ -27,7 +27,7 @@ public function defineProperties()
'description' => 'rainlab.blog::lang.settings.post_slug_description',
'default' => '{{ :slug }}',
'type' => 'string'
],
]
];
}

Expand Down Expand Up @@ -58,5 +58,4 @@ protected function getViews()

return $out;
}

}
}
14 changes: 12 additions & 2 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php

return [
'plugin' => [
'name' => 'Blog Views',
'description' => 'The plugin enables blog posts views tracking and displaying popular articles.'
],
'settings' => [
'posts_limit' => 'Limit',
'posts_limit_validation' => 'Invalid format of the limit value',
Expand All @@ -10,6 +14,12 @@
'posts_post_description' => 'Name of the blog post page file for the "Learn more" links. This property is used by the default component partial.'
],
'post' => [
'tab_views' => 'Views',
'tab_views' => 'Views'
],
];
'component' => [
'popular_name' => 'Popular Posts',
'popular_description' => 'Most viewed posts list',
'views_name' => 'Post Views',
'views_description' => 'Show post views'
]
];
2 changes: 0 additions & 2 deletions updates/create_post_views_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

class CreatePostViewsTable extends Migration
{

public function up()
{
Schema::create('vdomah_blogviews_views', function($table)
Expand All @@ -21,5 +20,4 @@ public function down()
{
Schema::dropIfExists('vdomah_blogviews_views');
}

}