Commit 85321b17ba6418a4e35dab27410496cef3a563de

Authored by Dylan Guedes
1 parent 869c8a00

Adds translations to elasticsearch plugin

Signed-off-by: DylanGuedes <djmgguedes@gmail.com>
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Signed-off-by: Arthur Jahn <stutrzbecher@gmail.com>
plugins/elasticsearch/helpers/elasticsearch_helper.rb
... ... @@ -2,7 +2,7 @@ module ElasticsearchHelper
2 2  
3 3 def searchable_types
4 4 {
5   - :all => _("All Results"),
  5 + :all => _("All results"),
6 6 :text_article => _("Articles"),
7 7 :uploaded_file => _("Files"),
8 8 :community => _("Communities"),
... ... @@ -15,7 +15,7 @@ module ElasticsearchHelper
15 15 sorts = {
16 16 :relevance => _("Relevance"),
17 17 :lexical => _("Alphabetical"),
18   - :more_recent => _("More Recent")
  18 + :more_recent => _("More recent")
19 19 }
20 20  
21 21 selected_type = (params[:selected_type] || nil)
... ...
plugins/elasticsearch/lib/elasticsearch_plugin.rb
... ... @@ -9,7 +9,7 @@ class ElasticsearchPlugin &lt; Noosfero::Plugin
9 9 end
10 10  
11 11 def self.plugin_description
12   - _("This plugin is used to communicate a elasticsearch to privide a search.")
  12 + _("This plugin is used to communicate with elasticsearch engine.")
13 13 end
14 14  
15 15 def stylesheet?
... ...
plugins/elasticsearch/lib/ext/community.rb
... ... @@ -25,8 +25,8 @@ class Community
25 25  
26 26 def self.specific_sort
27 27 {
28   - :more_active => _("More Active"),
29   - :more_popular => _("More Popular")
  28 + :more_active => _("More active"),
  29 + :more_popular => _("More popular")
30 30 }
31 31 end
32 32  
... ...
plugins/elasticsearch/lib/ext/person.rb
... ... @@ -26,8 +26,8 @@ class Person
26 26  
27 27 def self.specific_sort
28 28 {
29   - :more_active => _("More Active"),
30   - :more_popular => _("More Popular")
  29 + :more_active => _("More active"),
  30 + :more_popular => _("More popular")
31 31 }
32 32 end
33 33  
... ...
plugins/elasticsearch/lib/ext/text_article.rb
... ... @@ -36,8 +36,8 @@ class TextArticle
36 36  
37 37 def self.specific_sort
38 38 {
39   - :more_popular => _("More Viewed"),
40   - :more_comments => _("Most Commented")
  39 + :more_popular => _("More viewed"),
  40 + :more_comments => _("Most commented")
41 41 }
42 42 end
43 43  
... ...
plugins/elasticsearch/po/elasticsearch.pot
... ... @@ -6,9 +6,10 @@
6 6 #, fuzzy
7 7 msgid ""
8 8 msgstr ""
9   -"Project-Id-Version: 1.3~rc2-1-ga15645d\n"
10   -"POT-Creation-Date: 2015-10-30 16:35-0300\n"
11   -"PO-Revision-Date: 2015-08-06 17:21-0300\n"
  9 +"Project-Id-Version: PACKAGE VERSION\n"
  10 +"Report-Msgid-Bugs-To: \n"
  11 +"POT-Creation-Date: 2016-07-25 15:12+0000\n"
  12 +"PO-Revision-Date: 2016-07-25 15:12+0000\n"
12 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 14 "Language-Team: LANGUAGE <LL@li.org>\n"
14 15 "Language: \n"
... ... @@ -17,6 +18,86 @@ msgstr &quot;&quot;
17 18 "Content-Transfer-Encoding: 8bit\n"
18 19 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
19 20  
20   -#: plugins/template/lib/template_plugin.rb:10
21   -msgid "A plugin that does this and that."
  21 +#: ../helpers/elasticsearch_helper.rb:5
  22 +msgid "All results"
  23 +msgstr ""
  24 +
  25 +#: ../helpers/elasticsearch_helper.rb:6
  26 +msgid "Articles"
  27 +msgstr ""
  28 +
  29 +#: ../helpers/elasticsearch_helper.rb:7
  30 +msgid "Files"
  31 +msgstr ""
  32 +
  33 +#: ../helpers/elasticsearch_helper.rb:8
  34 +msgid "Communities"
  35 +msgstr ""
  36 +
  37 +#: ../helpers/elasticsearch_helper.rb:9
  38 +msgid "Events"
  39 +msgstr ""
  40 +
  41 +#: ../helpers/elasticsearch_helper.rb:10
  42 +msgid "People"
  43 +msgstr ""
  44 +
  45 +#: ../helpers/elasticsearch_helper.rb:16
  46 +msgid "Relevance"
  47 +msgstr ""
  48 +
  49 +#: ../helpers/elasticsearch_helper.rb:17
  50 +msgid "Alphabetical"
  51 +msgstr ""
  52 +
  53 +#: ../helpers/elasticsearch_helper.rb:18
  54 +msgid "More recent"
  55 +msgstr ""
  56 +
  57 +#: ../lib/elasticsearch_plugin.rb:12
  58 +msgid "This plugin is used to communicate with elasticsearch engine."
  59 +msgstr ""
  60 +
  61 +#: ../lib/ext/community.rb:28 ../lib/ext/person.rb:29
  62 +msgid "More active"
  63 +msgstr ""
  64 +
  65 +#: ../lib/ext/community.rb:29 ../lib/ext/person.rb:30
  66 +msgid "More popular"
  67 +msgstr ""
  68 +
  69 +#: ../lib/ext/text_article.rb:39
  70 +msgid "More viewed"
  71 +msgstr ""
  72 +
  73 +#: ../lib/ext/text_article.rb:40
  74 +msgid "Most commented"
  75 +msgstr ""
  76 +
  77 +#: ../views/elasticsearch_plugin/_results_count.html.erb:4
  78 +msgid " results for "
  79 +msgstr ""
  80 +
  81 +#: ../views/elasticsearch_plugin/_results_count.html.erb:6
  82 +msgid " total results"
  83 +msgstr ""
  84 +
  85 +#: ../views/elasticsearch_plugin/_search_field.html.erb:11
  86 +msgid "Send"
  87 +msgstr ""
  88 +
  89 +#: ../views/elasticsearch_plugin/_search_filter.html.erb:1
  90 +msgid "Sort by"
  91 +msgstr ""
  92 +
  93 +#: ../views/elasticsearch_plugin/_text_article_display.html.erb:6
  94 +msgid "Abstract"
  95 +msgstr ""
  96 +
  97 +#: ../views/elasticsearch_plugin/_uploaded_file_display.html.erb:6
  98 +msgid "Type of file"
  99 +msgstr ""
  100 +
  101 +#: ../views/elasticsearch_plugin/search.html.erb:23
  102 +msgid "Categories"
22 103 msgstr ""
... ...
plugins/elasticsearch/po/pt/elasticsearch.edit.po 0 → 100644
... ... @@ -0,0 +1,103 @@
  1 +# SOME DESCRIPTIVE TITLE.
  2 +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  3 +# This file is distributed under the same license as the PACKAGE package.
  4 +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  5 +#
  6 +#, fuzzy
  7 +msgid ""
  8 +msgstr ""
  9 +"Project-Id-Version: PACKAGE VERSION\n"
  10 +"Report-Msgid-Bugs-To: \n"
  11 +"POT-Creation-Date: 2016-07-25 15:12+0000\n"
  12 +"PO-Revision-Date: 2016-07-25 15:12+0000\n"
  13 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  14 +"Language-Team: LANGUAGE <LL@li.org>\n"
  15 +"Language: \n"
  16 +"MIME-Version: 1.0\n"
  17 +"Content-Type: text/plain; charset=UTF-8\n"
  18 +"Content-Transfer-Encoding: 8bit\n"
  19 +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
  20 +
  21 +#: ../helpers/elasticsearch_helper.rb:5
  22 +msgid "All results"
  23 +msgstr "Todos os resultados"
  24 +
  25 +#: ../helpers/elasticsearch_helper.rb:6
  26 +msgid "Articles"
  27 +msgstr "Artigos"
  28 +
  29 +#: ../helpers/elasticsearch_helper.rb:7
  30 +msgid "Files"
  31 +msgstr "Arquivos"
  32 +
  33 +#: ../helpers/elasticsearch_helper.rb:8
  34 +msgid "Communities"
  35 +msgstr "Comunidades"
  36 +
  37 +#: ../helpers/elasticsearch_helper.rb:9
  38 +msgid "Events"
  39 +msgstr "Eventos"
  40 +
  41 +#: ../helpers/elasticsearch_helper.rb:10
  42 +msgid "People"
  43 +msgstr "Pessoas"
  44 +
  45 +#: ../helpers/elasticsearch_helper.rb:16
  46 +msgid "Relevance"
  47 +msgstr "Relevância"
  48 +
  49 +#: ../helpers/elasticsearch_helper.rb:17
  50 +msgid "Alphabetical"
  51 +msgstr "Alfabético"
  52 +
  53 +#: ../helpers/elasticsearch_helper.rb:18
  54 +msgid "More recent"
  55 +msgstr "Mais recentes"
  56 +
  57 +#: ../lib/elasticsearch_plugin.rb:12
  58 +msgid "This plugin is used to communicate with elasticsearch engine."
  59 +msgstr "Este plugin é utilizado na comunicação com a engine elasticsearch."
  60 +
  61 +#: ../lib/ext/community.rb:28 ../lib/ext/person.rb:29
  62 +msgid "More active"
  63 +msgstr "Mais ativos"
  64 +
  65 +#: ../lib/ext/community.rb:29 ../lib/ext/person.rb:30
  66 +msgid "More popular"
  67 +msgstr "Mais populares"
  68 +
  69 +#: ../lib/ext/text_article.rb:39
  70 +msgid "More viewed"
  71 +msgstr "Mais vistos"
  72 +
  73 +#: ../lib/ext/text_article.rb:40
  74 +msgid "Most commented"
  75 +msgstr "Mais comentados"
  76 +
  77 +#: ../views/elasticsearch_plugin/_results_count.html.erb:4
  78 +msgid " results for "
  79 +msgstr " resultados para "
  80 +
  81 +#: ../views/elasticsearch_plugin/_results_count.html.erb:6
  82 +msgid " total results"
  83 +msgstr " resultados"
  84 +
  85 +#: ../views/elasticsearch_plugin/_search_field.html.erb:11
  86 +msgid "Send"
  87 +msgstr "Enviar"
  88 +
  89 +#: ../views/elasticsearch_plugin/_search_filter.html.erb:1
  90 +msgid "Sort by"
  91 +msgstr "Ordenar por"
  92 +
  93 +#: ../views/elasticsearch_plugin/_text_article_display.html.erb:6
  94 +msgid "Abstract"
  95 +msgstr "Resumo"
  96 +
  97 +#: ../views/elasticsearch_plugin/_uploaded_file_display.html.erb:6
  98 +msgid "Type of file"
  99 +msgstr "Tipo de arquivo"
  100 +
  101 +#: ../views/elasticsearch_plugin/search.html.erb:23
  102 +msgid "Categories"
  103 +msgstr "Categorias"
... ...
plugins/elasticsearch/po/pt/elasticsearch.po 0 → 100644
... ... @@ -0,0 +1,81 @@
  1 +# SOME DESCRIPTIVE TITLE.
  2 +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  3 +# This file is distributed under the same license as the PACKAGE package.
  4 +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  5 +#
  6 +#, fuzzy
  7 +msgid ""
  8 +msgstr ""
  9 +"Project-Id-Version: PACKAGE VERSION\n"
  10 +"Report-Msgid-Bugs-To: \n"
  11 +"PO-Revision-Date: 2016-07-25 15:12+0000\n"
  12 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  13 +"Language-Team: LANGUAGE <LL@li.org>\n"
  14 +"Language: \n"
  15 +"MIME-Version: 1.0\n"
  16 +"Content-Type: text/plain; charset=UTF-8\n"
  17 +"Content-Transfer-Encoding: 8bit\n"
  18 +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
  19 +
  20 +msgid "All results"
  21 +msgstr "Todos os resultados"
  22 +
  23 +msgid "Articles"
  24 +msgstr "Artigos"
  25 +
  26 +msgid "Files"
  27 +msgstr "Arquivos"
  28 +
  29 +msgid "Communities"
  30 +msgstr "Comunidades"
  31 +
  32 +msgid "Events"
  33 +msgstr "Eventos"
  34 +
  35 +msgid "People"
  36 +msgstr "Pessoas"
  37 +
  38 +msgid "Relevance"
  39 +msgstr "Relevância"
  40 +
  41 +msgid "Alphabetical"
  42 +msgstr "Alfabético"
  43 +
  44 +msgid "More recent"
  45 +msgstr "Mais recentes"
  46 +
  47 +msgid "This plugin is used to communicate with elasticsearch engine."
  48 +msgstr "Este plugin é utilizado na comunicação com a engine elasticsearch."
  49 +
  50 +msgid "More active"
  51 +msgstr "Mais ativos"
  52 +
  53 +msgid "More popular"
  54 +msgstr "Mais populares"
  55 +
  56 +msgid "More viewed"
  57 +msgstr "Mais vistos"
  58 +
  59 +msgid "Most commented"
  60 +msgstr "Mais comentados"
  61 +
  62 +msgid " results for "
  63 +msgstr " resultados para "
  64 +
  65 +msgid " total results"
  66 +msgstr " resultados"
  67 +
  68 +msgid "Send"
  69 +msgstr "Enviar"
  70 +
  71 +msgid "Sort by"
  72 +msgstr "Ordenar por"
  73 +
  74 +msgid "Abstract"
  75 +msgstr "Resumo"
  76 +
  77 +msgid "Type of file"
  78 +msgstr "Tipo de arquivo"
  79 +
  80 +msgid "Categories"
  81 +msgstr "Categorias"
... ...
plugins/elasticsearch/po/pt/elasticsearch.po.time_stamp 0 → 100644
plugins/elasticsearch/public/javascripts/categories.js
... ... @@ -5,14 +5,10 @@ var main = function() {
5 5 var categories = $("#jstree-categories").jstree("get_checked",null,true);
6 6 var params;
7 7  
8   - url = url.replace(/.*\?/, "");
9   - params = url.split('&');
10   - params.map(function(param) {
11   - var item = param.split('=');
12   - dataParams[item[0]] = item[1];
13   - });
14   -
15   - dataParams['categories'] = categories.join(",")
  8 + dataParams['selected_type'] = $('#selected_type').val();
  9 + dataParams['filter'] = $('#filter').val();
  10 + dataParams['query'] = $('#query').val();
  11 + dataParams['categories'] = categories.join(",");
16 12  
17 13 $.ajax({
18 14 method: "GET",
... ...