Repository: ckan/ckan

Issue:
Translation missing for "Data explorer" in reclineview
**CKAN version=2.8.6**

**Describe the bug**
When switching to the french language, the tab name "data explorer on a resource preview page is not translated

**Steps to reproduce**
1. Installing ckan from source
2. Set up a dataset with a previewable format (e.g csv)
3. preview the data 
4. Select the french language by changing the url t0 http://XXX.X.X.X:XXXXfr/XXXXXXX


**Expected behavior**
The tab name shoud be translated to something like "Explorateur de données"



Discussion:
You are right, the "Data Explorer" string [here](https://github.com/ckan/ckan/blob/f6ebeb5a581e7550bc8f2c5b3bf59343b1692602/ckanext/reclineview/plugin.py#L109) and all the the `title` properties of the other plugins should be wrapped in the underscore function to make them translatable, eg `'title': _('Data Explorer')`

Do you want to submit a pull request for this?
@J-bytes @amercader  , I have wrapped the title property of recline_view and other plugins in the underscore function to make them translatable but getting the below NameError.

 ![Capture](https://user-images.githubusercontent.com/66116382/98807733-19d81d80-2441-11eb-8c17-0fbcc15c42ad.JPG)

However to resolve the above NameError I have import _ from ckan.common but still "Data Explorer" is not translatable.

@amercader , I have check and found that "Data Explorer" is not translated in other languages as well.
@Gauravp-NEC thanks for your help. It's better to import `_` from the toolkit when in an extension like this one.

For "Data Explorer" to be translatable, the string needs to be extracted first and included in the `.po` files that we use for translation. But we do this separately before a release, so just wrapping the string with `_()` at this point should be enough
@amercader I've checked deeper and it seems many translations displayed inside the iframe do not get translated too. They are all wrapped with the underscore function and the traductions were already available in the .po file. I've tried recompiling the .mo file with and without fuzzy with no success... Do you have any idea what could stop babel from translating these? Thank you for your help.
![image](https://user-images.githubusercontent.com/60334318/99886822-9622eb80-2c0d-11eb-8b84-7bc25644ce0d.png)

![image](https://user-images.githubusercontent.com/60334318/99886824-9ae79f80-2c0d-11eb-9695-1e98bec33d3c.png)


Resolving patch:
diff --git a/ckanext/reclineview/plugin.py b/ckanext/reclineview/plugin.py
--- a/ckanext/reclineview/plugin.py
+++ b/ckanext/reclineview/plugin.py
@@ -7,6 +7,7 @@
 from ckan.common import json, config
 import ckan.plugins as p
 import ckan.plugins.toolkit as toolkit
+from ckan.plugins.toolkit import _
 
 log = getLogger(__name__)
 ignore_empty = p.toolkit.get_validator('ignore_empty')
@@ -106,7 +107,7 @@ class ReclineView(ReclineViewBase):
 
     def info(self):
         return {'name': 'recline_view',
-                'title': 'Data Explorer',
+                'title': _('Data Explorer'),
                 'filterable': True,
                 'icon': 'table',
                 'requires_datastore': False,
@@ -135,7 +136,7 @@ class ReclineGridView(ReclineViewBase):
 
     def info(self):
         return {'name': 'recline_grid_view',
-                'title': 'Grid',
+                'title': _('Grid'),
                 'filterable': True,
                 'icon': 'table',
                 'requires_datastore': True,
@@ -177,7 +178,7 @@ def info(self):
             'series': [ignore_empty, in_list(self.list_datastore_fields)]
         }
         return {'name': 'recline_graph_view',
-                'title': 'Graph',
+                'title': _('Graph'),
                 'filterable': True,
                 'icon': 'bar-chart-o',
                 'requires_datastore': True,
@@ -238,7 +239,7 @@ def info(self):
             'cluster_markers': [ignore_empty]
         }
         return {'name': 'recline_map_view',
-                'title': 'Map',
+                'title': _('Map'),
                 'schema': schema,
                 'filterable': True,
                 'icon': 'map-marker',


Test patch: