diff --git a/extensions/pc-axis/module/MOD-INF/controller.js b/extensions/pc-axis/module/MOD-INF/controller.js index 7535e42de..cc7422226 100644 --- a/extensions/pc-axis/module/MOD-INF/controller.js +++ b/extensions/pc-axis/module/MOD-INF/controller.js @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function init() { var IM = Packages.com.google.refine.importing.ImportingManager; - IM.registerFormat("text/line-based/pc-axis", "PC-Axis text files", "PCAxisParserUI", + IM.registerFormat("text/line-based/pc-axis", "pc-axis-import-format/text/line-based/pc-axis", "PCAxisParserUI", new Packages.com.google.refine.pcaxis.PCAxisImporter()); IM.registerExtension(".px", "text/line-based/pc-axis"); diff --git a/extensions/pc-axis/module/langs/translation-en.json b/extensions/pc-axis/module/langs/translation-en.json new file mode 100644 index 000000000..8efe47191 --- /dev/null +++ b/extensions/pc-axis/module/langs/translation-en.json @@ -0,0 +1,3 @@ +{ + "pc-axis-import-format/text/line-based/pc-axis": "PC-Axis text files" +} diff --git a/extensions/pc-axis/module/scripts/pc-axis-parser-ui.js b/extensions/pc-axis/module/scripts/pc-axis-parser-ui.js index ee5599ccc..05f4ea45f 100644 --- a/extensions/pc-axis/module/scripts/pc-axis-parser-ui.js +++ b/extensions/pc-axis/module/scripts/pc-axis-parser-ui.js @@ -31,6 +31,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +//Internationalization init + +var dictionary = {}; +$.ajax({ +url : "command/core/load-language?", +type : "POST", +async : false, +data : { +module : "pc-axis", +}, +success : function(data) { +dictionary = data['dictionary']; +lang = data['lang']; +} +}); +$.i18n().load(dictionary, lang); +// End internationalization + Refine.PCAxisParserUI = function(controller, jobID, job, format, config, dataContainerElmt, progressContainerElmt, optionContainerElmt) { diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index 7067f4c0a..a5642a551 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -204,33 +204,33 @@ function registerImporting() { * they also generate defaults for the client-side UIs to initialize. */ - IM.registerFormat("text", "Text files"); // generic format, no parser to handle it - IM.registerFormat("text/line-based", "Line-based text files", "LineBasedParserUI", + IM.registerFormat("text", "core-import-formats/text" ); // generic format, no parser to handle it + IM.registerFormat("text/line-based", "core-import-formats/text/line-based", "LineBasedParserUI", new Packages.com.google.refine.importers.LineBasedImporter()); - IM.registerFormat("text/line-based/*sv", "CSV / TSV / separator-based files", "SeparatorBasedParserUI", + IM.registerFormat("text/line-based/*sv", "core-import-formats/text/line-based/*sv", "SeparatorBasedParserUI", new Packages.com.google.refine.importers.SeparatorBasedImporter()); - IM.registerFormat("text/line-based/fixed-width", "Fixed-width field text files", "FixedWidthParserUI", + IM.registerFormat("text/line-based/fixed-width", "core-import-formats/text/line-based/fixed-width", "FixedWidthParserUI", new Packages.com.google.refine.importers.FixedWidthImporter()); - IM.registerFormat("text/rdf/nt", "RDF/N-Triples files", "RdfTriplesParserUI", + IM.registerFormat("text/rdf/nt", "core-import-formats/text/rdf/nt", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfTripleImporter(Packages.com.google.refine.importers.RdfTripleImporter.Mode.NT)); - IM.registerFormat("text/rdf/n3", "RDF/N3 files", "RdfTriplesParserUI", + IM.registerFormat("text/rdf/n3", "core-import-formats/text/rdf/n3", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfTripleImporter(Packages.com.google.refine.importers.RdfTripleImporter.Mode.N3)); - IM.registerFormat("text/rdf/ttl", "RDF/Turtle files", "RdfTriplesParserUI", + IM.registerFormat("text/rdf/ttl", "core-import-formats/text/rdf/ttl", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfTripleImporter(Packages.com.google.refine.importers.RdfTripleImporter.Mode.TTL)); - IM.registerFormat("text/rdf/xml", "RDF/XML files", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfXmlTripleImporter()); - IM.registerFormat("text/rdf/ld+json", "JSON-LD files", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfJsonldTripleImporter()); + IM.registerFormat("text/rdf/xml", "core-import-formats/text/rdf/xml", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfXmlTripleImporter()); + IM.registerFormat("text/rdf/ld+json", "core-import-formats/text/rdf/ld+json", "RdfTriplesParserUI", new Packages.com.google.refine.importers.RdfJsonldTripleImporter()); - IM.registerFormat("text/xml", "XML files", "XmlParserUI", new Packages.com.google.refine.importers.XmlImporter()); - IM.registerFormat("binary/text/xml/xls/xlsx", "Excel files", "ExcelParserUI", new Packages.com.google.refine.importers.ExcelImporter()); - IM.registerFormat("text/xml/ods", "Open Document Format spreadsheets (.ods)", "ExcelParserUI", new Packages.com.google.refine.importers.OdsImporter()); - IM.registerFormat("text/json", "JSON files", "JsonParserUI", new Packages.com.google.refine.importers.JsonImporter()); - IM.registerFormat("text/marc", "MARC files", "XmlParserUI", new Packages.com.google.refine.importers.MarcImporter()); - IM.registerFormat("text/wiki", "Wikitext", "WikitextParserUI", new Packages.com.google.refine.importers.WikitextImporter()); + IM.registerFormat("text/xml", "core-import-formats/text/xml", "XmlParserUI", new Packages.com.google.refine.importers.XmlImporter()); + IM.registerFormat("binary/text/xml/xls/xlsx", "core-import-formats/binary/text/xml/xls/xlsx", "ExcelParserUI", new Packages.com.google.refine.importers.ExcelImporter()); + IM.registerFormat("text/xml/ods", "core-import-formats/text/xml/ods", "ExcelParserUI", new Packages.com.google.refine.importers.OdsImporter()); + IM.registerFormat("text/json", "core-import-formats/text/json", "JsonParserUI", new Packages.com.google.refine.importers.JsonImporter()); + IM.registerFormat("text/marc", "core-import-formats/text/marc", "XmlParserUI", new Packages.com.google.refine.importers.MarcImporter()); + IM.registerFormat("text/wiki", "core-import-formats/text/wiki", "WikitextParserUI", new Packages.com.google.refine.importers.WikitextImporter()); - IM.registerFormat("binary", "Binary files"); // generic format, no parser to handle it + IM.registerFormat("binary", "core-import-formats/binary"); // generic format, no parser to handle it - IM.registerFormat("service", "Services"); // generic format, no parser to handle it + IM.registerFormat("service", "core-import-formats/service"); // generic format, no parser to handle it /* * Extension to format mappings diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index e56d40845..2b4af6915 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -750,5 +750,22 @@ "core-buttons/match": "Match", "core-buttons/copy": "Copy", "core-buttons/transpose": "Transpose", - "core-buttons/apply-to-all": "Apply to All Identical Cells" + "core-buttons/apply-to-all": "Apply to All Identical Cells", + "core-import-formats/text/line-based": "Line-based text files", + "core-import-formats/text/line-based/*sv": "CSV / TSV / separator-based files", + "core-import-formats/text/line-based/fixed-width": "Fixed-width field text files", + "core-import-formats/text/rdf/nt": "RDF/N-Triples files", + "core-import-formats/text/rdf/n3": "RDF/N3 files", + "core-import-formats/text/rdf/ttl": "RDF/Turtle files", + "core-import-formats/text/rdf/xml": "RDF/XML files", + "core-import-formats/text/rdf/ld+json": "JSON-LD files", + "core-import-formats/text/xml": "XML files", + "core-import-formats/binary/text/xml/xls/xlsx": "Excel files", + "core-import-formats/text/xml/ods": "Open Document Format spreadsheets (.ods)", + "core-import-formats/text/json": "JSON files", + "core-import-formats/text/marc": "MARC files", + "core-import-formats/text/wiki": "Wikitext", + "core-import-formats/text": "Text files", + "core-import-formats/binary": "Binary files", + "core-import-formats/service": "Services" } diff --git a/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js b/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js index baccb7100..5377a1032 100644 --- a/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js +++ b/main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js @@ -141,8 +141,9 @@ Refine.DefaultImportingController.prototype._prepareParsingPanel = function() { var formats = this._job.config.rankedFormats; var createFormatTab = function(format) { + var formatLabelKey =Refine.importingConfig.formats[format].label; var tab = $('