Clean up localization - fixes #760, modifies pull request #755

- make all file loading relative to module base
- move core language files into appropriate place
- eliminate all SetLanguage commands and use SetPreference instead
- eliminate all LoadLanguage commands except for core's
- fix duplicate keys in JSON language files
- remove BOM from JSON language files

OPEN - task 760: Translations not being loaded from built kit 
http://github.com/OpenRefine/OpenRefine/issues/issue/760
This commit is contained in:
Tom Morris 2013-07-31 00:31:31 -04:00
parent ccbc163c50
commit f4ff227340
23 changed files with 85 additions and 258 deletions

View File

@ -59,7 +59,6 @@ function init() {
RS.registerCommand(module, "import-qa-data", new Packages.com.google.refine.freebase.commands.ImportQADataCommand()); RS.registerCommand(module, "import-qa-data", new Packages.com.google.refine.freebase.commands.ImportQADataCommand());
RS.registerCommand(module, "mqlread", new Packages.com.google.refine.freebase.commands.MQLReadCommand()); RS.registerCommand(module, "mqlread", new Packages.com.google.refine.freebase.commands.MQLReadCommand());
RS.registerCommand(module, "mqlwrite", new Packages.com.google.refine.freebase.commands.MQLWriteCommand()); RS.registerCommand(module, "mqlwrite", new Packages.com.google.refine.freebase.commands.MQLWriteCommand());
RS.registerCommand(module, "load-language", new Packages.com.google.refine.freebase.commands.LoadLanguageCommand());
var OR = Packages.com.google.refine.operations.OperationRegistry; var OR = Packages.com.google.refine.operations.OperationRegistry;

View File

@ -1,4 +1,4 @@
{ {
"fb-schema-alignment": { "fb-schema-alignment": {
"close-confirm": "There are unsaved changes. Close anyway?", "close-confirm": "There are unsaved changes. Close anyway?",
"status-warning": "There are unsaved changes.", "status-warning": "There are unsaved changes.",
@ -112,4 +112,4 @@
"load-sandbox": "Load to Sandbox", "load-sandbox": "Load to Sandbox",
"ok": "Ok" "ok": "Ok"
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"fb-schema-alignment": { "fb-schema-alignment": {
"close-confirm": "There are unsaved changes. Close anyway?", "close-confirm": "There are unsaved changes. Close anyway?",
"status-warning": "There are unsaved changes.", "status-warning": "There are unsaved changes.",
@ -122,4 +122,4 @@
"load-sandbox": "Load to Sandbox", "load-sandbox": "Load to Sandbox",
"ok": "Ok" "ok": "Ok"
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"fb-schema-alignment": { "fb-schema-alignment": {
"close-confirm": "Ci sono cambiamenti non salvati. Chiudere comunque?", "close-confirm": "Ci sono cambiamenti non salvati. Chiudere comunque?",
"status-warning": "Ci sono cambiamenti non salvati.", "status-warning": "Ci sono cambiamenti non salvati.",
@ -122,4 +122,4 @@
"load-sandbox": "Carica nella Sandbox", "load-sandbox": "Carica nella Sandbox",
"ok": "Ok" "ok": "Ok"
} }
} }

View File

@ -39,11 +39,12 @@ var lang = navigator.language.split("-")[0]
|| navigator.userLanguage.split("-")[0]; || navigator.userLanguage.split("-")[0];
var dictionary = ""; var dictionary = "";
$.ajax({ $.ajax({
url : "/command/freebase/load-language?", url : "/command/core/load-language?",
type : "POST", type : "POST",
async : false, async : false,
data : { data : {
lng : lang module : "freebase",
// lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data;

View File

@ -1,73 +0,0 @@
package com.google.refine.freebase.commands;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
public class LoadLanguageCommand extends Command {
public LoadLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String rawDirectoryFile = request.getSession().getServletContext()
.getRealPath("extensions/freebase/module/langs/");
String cleanedDirectory = rawDirectoryFile.replace("main" + File.separator + "webapp" + File.separator, "");
BufferedReader reader = null;String param = null;
try {
param = (String) ProjectManager.singleton.getPreferenceStore().get("userLang");
} catch (NullPointerException e) {
}
if (param == null) param = request.getParameter("lng");
String[] langs = param.split(" ");
try {
String file = cleanedDirectory + File.separator + "translation-" + langs[0] + ".json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e1) {
try {
String file = cleanedDirectory + File.separator + "translation-default.json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e3) {
e3.printStackTrace();
}
}
String line = null;
String message = new String();
if (reader != null) {
while ((line = reader.readLine()) != null) {
// buffer.append(line);
message += line + System.getProperty("line.separator");
}
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(message);
response.getWriter().flush();
response.getWriter().close();
}
}

View File

@ -43,7 +43,6 @@ function init() {
var RS = Packages.com.google.refine.RefineServlet; var RS = Packages.com.google.refine.RefineServlet;
RS.registerCommand(module, "deauthorize", Packages.com.google.refine.extension.gdata.DeAuthorizeCommand()); RS.registerCommand(module, "deauthorize", Packages.com.google.refine.extension.gdata.DeAuthorizeCommand());
RS.registerCommand(module, "upload", Packages.com.google.refine.extension.gdata.UploadCommand()); RS.registerCommand(module, "upload", Packages.com.google.refine.extension.gdata.UploadCommand());
RS.registerCommand(module, "load-language", Packages.com.google.refine.extension.gdata.commands.LoadLanguageCommand());
// Register importer and exporter // Register importer and exporter
var IM = Packages.com.google.refine.importing.ImportingManager; var IM = Packages.com.google.refine.importing.ImportingManager;

View File

@ -1,4 +1,4 @@
{ {
"gdata-import": { "gdata-import": {
"preparing": "Preparing ...", "preparing": "Preparing ...",
"creating": "Creating project ...", "creating": "Creating project ...",
@ -53,4 +53,4 @@
"authorize-label": "OpenRefine - Authorization", "authorize-label": "OpenRefine - Authorization",
"authorized-label": "Authorization process completed. Close this window and return to OpenRefine." "authorized-label": "Authorization process completed. Close this window and return to OpenRefine."
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"gdata-import": { "gdata-import": {
"preparing": "Preparing ...", "preparing": "Preparing ...",
"creating": "Creating project ...", "creating": "Creating project ...",
@ -53,4 +53,4 @@
"authorize-label": "OpenRefine - Authorization", "authorize-label": "OpenRefine - Authorization",
"authorized-label": "Authorization process completed. Close this window and return to OpenRefine." "authorized-label": "Authorization process completed. Close this window and return to OpenRefine."
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"gdata-import": { "gdata-import": {
"preparing": "In preparazione ...", "preparing": "In preparazione ...",
"creating": "Creazione il progetto ...", "creating": "Creazione il progetto ...",
@ -53,4 +53,4 @@
"authorize-label": "OpenRefine - Autorizzazione", "authorize-label": "OpenRefine - Autorizzazione",
"authorized-label": "Processo di autorizzazione completato. Chiudi questa finestra e torna ad OpenRefine." "authorized-label": "Processo di autorizzazione completato. Chiudi questa finestra e torna ad OpenRefine."
} }
} }

View File

@ -36,11 +36,12 @@ var lang = navigator.language.split("-")[0]
|| navigator.userLanguage.split("-")[0]; || navigator.userLanguage.split("-")[0];
var dictionary = ""; var dictionary = "";
$.ajax({ $.ajax({
url : "/command/gdata/load-language?", url : "/command/core/load-language?",
type : "POST", type : "POST",
async : false, async : false,
data : { data : {
lng : lang module : "gdata",
// lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data;

View File

@ -33,11 +33,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var dictionary = ""; var dictionary = "";
$.ajax({ $.ajax({
url : "/command/gdata/load-language?", url : "/command/core/load-language?",
type : "POST", type : "POST",
async : false, async : false,
data : { data : {
lng : lang module : "gdata",
// lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data;

View File

@ -1,74 +0,0 @@
package com.google.refine.extension.gdata.commands;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
public class LoadLanguageCommand extends Command {
public LoadLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String rawDirectoryFile = request.getSession().getServletContext()
.getRealPath("extensions/gdata/module/langs/");
String cleanedDirectory = rawDirectoryFile.replace("main" + File.separator + "webapp" + File.separator, "");
BufferedReader reader = null;
String param = null;
try {
param = (String) ProjectManager.singleton.getPreferenceStore().get("userLang");
} catch (NullPointerException e) {
}
if (param == null) param = request.getParameter("lng");
String[] langs = param.split(" ");
try {
String file = cleanedDirectory + File.separator + "translation-" + langs[0] + ".json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e1) {
try {
String file = cleanedDirectory + File.separator + "translation-default.json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e3) {
e3.printStackTrace();
}
}
String line = null;
String message = new String();
if (reader != null) {
while ((line = reader.readLine()) != null) {
// buffer.append(line);
message += line + System.getProperty("line.separator");
}
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(message);
response.getWriter().flush();
response.getWriter().close();
}
}

View File

@ -7,18 +7,28 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Arrays;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import com.google.refine.ProjectManager; import com.google.refine.ProjectManager;
import com.google.refine.commands.Command; import com.google.refine.commands.Command;
import com.google.refine.preference.PreferenceStore;
import edu.mit.simile.butterfly.ButterflyModule;
public class LoadLanguageCommand extends Command { public class LoadLanguageCommand extends Command {
public LoadLanguageCommand() { public LoadLanguageCommand() {
// TODO Auto-generated constructor stub super();
} }
@Override @Override
@ -30,44 +40,47 @@ public class LoadLanguageCommand extends Command {
public void doPost(HttpServletRequest request, HttpServletResponse response) public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { throws ServletException, IOException {
String rawDirectoryFile = request.getSession().getServletContext().getRealPath("webapp/modules/langs/"); String modname = request.getParameter("module");
String cleanedDirectory = rawDirectoryFile.replace("main" + File.separator + "webapp" + File.separator, "main" if (modname == null) {
+ File.separator); modname = "core";
BufferedReader reader = null;
String param = null;
try {
param = (String) ProjectManager.singleton.getPreferenceStore().get("userLang");
} catch (NullPointerException e) {
} }
if (param == null) param = request.getParameter("lng"); ButterflyModule module = this.servlet.getModule(modname);
String[] langs = param.split(" "); String[] langs = request.getParameterValues("lang");
try { if (langs == null || "".equals(langs[0])) {
String file = cleanedDirectory + File.separator + "translation-" + langs[0] + ".json"; PreferenceStore ps = ProjectManager.singleton.getPreferenceStore();
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); if (ps != null) {
} catch (FileNotFoundException e1) { langs = new String[] {(String) ps.get("userLang")};
}
}
langs = Arrays.copyOf(langs, langs.length+1);
langs[langs.length-1] = "default";
JSONObject json = null;
boolean loaded = false;
for (String lang : langs) {
File langFile = new File(module.getPath(), "langs" + File.separator + "translation-" + lang + ".json");
try { try {
String file = cleanedDirectory + File.separator + "translation-default.json"; Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(langFile), "UTF-8"));
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); json = new JSONObject(new JSONTokener(reader));
} catch (FileNotFoundException e3) { response.setCharacterEncoding("UTF-8");
e3.printStackTrace(); response.setContentType("application/json");
json.write(response.getWriter());
response.getWriter().flush();
response.getWriter().close();
loaded = true;
break;
} catch (FileNotFoundException e1) {
json = null;
continue;
} catch (JSONException e) {
json = null;
logger.error("JSON error reading/writing language file", e);
continue;
} }
} }
if (!loaded) {
String line = null; logger.error("Failed to load any language files");
String message = new String();
if (reader != null) {
while ((line = reader.readLine()) != null) {
// buffer.append(line);
message += line + System.getProperty("line.separator");
}
} }
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(message);
response.getWriter().flush();
response.getWriter().close();
} }
} }

View File

@ -1,33 +0,0 @@
package com.google.refine.commands.lang;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
import com.google.refine.preference.PreferenceStore;
public class SetLanguageCommand extends Command {
public SetLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String lang = request.getParameter("lng");
PreferenceStore pref = ProjectManager.singleton.getPreferenceStore();
pref.put("userLang", lang);
}
}

View File

@ -99,7 +99,6 @@ function registerCommands() {
RS.registerCommand(module, "key-value-columnize", new Packages.com.google.refine.commands.cell.KeyValueColumnizeCommand()); RS.registerCommand(module, "key-value-columnize", new Packages.com.google.refine.commands.cell.KeyValueColumnizeCommand());
RS.registerCommand(module, "load-language", Packages.com.google.refine.commands.lang.LoadLanguageCommand()); RS.registerCommand(module, "load-language", Packages.com.google.refine.commands.lang.LoadLanguageCommand());
RS.registerCommand(module, "set-language", Packages.com.google.refine.commands.lang.SetLanguageCommand());
RS.registerCommand(module, "add-column", new Packages.com.google.refine.commands.column.AddColumnCommand()); RS.registerCommand(module, "add-column", new Packages.com.google.refine.commands.column.AddColumnCommand());
RS.registerCommand(module, "add-column-by-fetching-urls", new Packages.com.google.refine.commands.column.AddColumnByFetchingURLsCommand()); RS.registerCommand(module, "add-column-by-fetching-urls", new Packages.com.google.refine.commands.column.AddColumnByFetchingURLsCommand());

View File

@ -1,4 +1,4 @@
{ {
"core-index": { "core-index": {
"slogan": "A power tool for working with messy data", "slogan": "A power tool for working with messy data",
"help": "Help", "help": "Help",
@ -226,7 +226,6 @@
"long-format": "Long locale format", "long-format": "Long locale format",
"full-format": "Full locale format", "full-format": "Full locale format",
"custom": "Custom", "custom": "Custom",
"help": "Help",
"local-time": "Use local time zone", "local-time": "Use local time zone",
"omit-time": "Omit time", "omit-time": "Omit time",
"out-col-header": "Output column headers", "out-col-header": "Output column headers",
@ -264,7 +263,6 @@
"facet-by-count": "Facet by choice counts", "facet-by-count": "Facet by choice counts",
"edit-based-col": "Edit Facet's Expression based on Column", "edit-based-col": "Edit Facet's Expression based on Column",
"edit-facet-exp": "Edit Facet's Expression", "edit-facet-exp": "Edit Facet's Expression",
"current-exp": "Current Expression",
"set-max-choices": "Set the maximum number of choices shown in each text facet (too many will slow down the application)", "set-max-choices": "Set the maximum number of choices shown in each text facet (too many will slow down the application)",
"case-sensitive": "case sensitive", "case-sensitive": "case sensitive",
"regular-exp": "regular expression", "regular-exp": "regular expression",
@ -410,7 +408,7 @@
"sort": "Sort", "sort": "Sort",
"collapse-expand": "Collapse/expand columns to make viewing the data more convenient", "collapse-expand": "Collapse/expand columns to make viewing the data more convenient",
"collapse-this": "Collapse this column", "collapse-this": "Collapse this column",
"collapse-all": "Collapse all other columns", "collapse-other": "Collapse all other columns",
"collapse-left": "Collapse all columns to left", "collapse-left": "Collapse all columns to left",
"collapse-right": "Collapse all columns to right", "collapse-right": "Collapse all columns to right",
"reconcile": "Reconcile", "reconcile": "Reconcile",
@ -560,7 +558,6 @@
"view": "View", "view": "View",
"collapse-all": "Collapse all columns", "collapse-all": "Collapse all columns",
"expand-all": "Expand all columns", "expand-all": "Expand all columns",
"remove-sort": "Remove sort",
"reorder-perma": "Reorder rows permanently", "reorder-perma": "Reorder rows permanently",
"by": "By", "by": "By",
"custom-text-trans": "Custom text transform on column", "custom-text-trans": "Custom text transform on column",
@ -666,4 +663,4 @@
"transpose": "Transpose", "transpose": "Transpose",
"apply-to-all": "Apply to All Identical Cells" "apply-to-all": "Apply to All Identical Cells"
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"core-index": { "core-index": {
"slogan": "A power tool for working with messy data", "slogan": "A power tool for working with messy data",
"help": "Help", "help": "Help",
@ -226,7 +226,6 @@
"long-format": "Long locale format", "long-format": "Long locale format",
"full-format": "Full locale format", "full-format": "Full locale format",
"custom": "Custom", "custom": "Custom",
"help": "Help",
"local-time": "Use local time zone", "local-time": "Use local time zone",
"omit-time": "Omit time", "omit-time": "Omit time",
"out-col-header": "Output column headers", "out-col-header": "Output column headers",
@ -264,7 +263,6 @@
"facet-by-count": "Facet by choice counts", "facet-by-count": "Facet by choice counts",
"edit-based-col": "Edit Facet's Expression based on Column", "edit-based-col": "Edit Facet's Expression based on Column",
"edit-facet-exp": "Edit Facet's Expression", "edit-facet-exp": "Edit Facet's Expression",
"current-exp": "Current Expression",
"set-max-choices": "Set the maximum number of choices shown in each text facet (too many will slow down the application)", "set-max-choices": "Set the maximum number of choices shown in each text facet (too many will slow down the application)",
"case-sensitive": "case sensitive", "case-sensitive": "case sensitive",
"regular-exp": "regular expression", "regular-exp": "regular expression",
@ -410,7 +408,7 @@
"sort": "Sort", "sort": "Sort",
"collapse-expand": "Collapse/expand columns to make viewing the data more convenient", "collapse-expand": "Collapse/expand columns to make viewing the data more convenient",
"collapse-this": "Collapse this column", "collapse-this": "Collapse this column",
"collapse-all": "Collapse all other columns", "collapse-other": "Collapse all other columns",
"collapse-left": "Collapse all columns to left", "collapse-left": "Collapse all columns to left",
"collapse-right": "Collapse all columns to right", "collapse-right": "Collapse all columns to right",
"reconcile": "Reconcile", "reconcile": "Reconcile",
@ -560,7 +558,6 @@
"view": "View", "view": "View",
"collapse-all": "Collapse all columns", "collapse-all": "Collapse all columns",
"expand-all": "Expand all columns", "expand-all": "Expand all columns",
"remove-sort": "Remove sort",
"reorder-perma": "Reorder rows permanently", "reorder-perma": "Reorder rows permanently",
"by": "By", "by": "By",
"custom-text-trans": "Custom text transform on column", "custom-text-trans": "Custom text transform on column",
@ -666,4 +663,4 @@
"transpose": "Transpose", "transpose": "Transpose",
"apply-to-all": "Apply to All Identical Cells" "apply-to-all": "Apply to All Identical Cells"
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"core-index": { "core-index": {
"slogan": "Uno strumento potente, per lavorare con dati sporchi", "slogan": "Uno strumento potente, per lavorare con dati sporchi",
"help": "Aiuto", "help": "Aiuto",
@ -226,7 +226,6 @@
"long-format": "Formato lungo", "long-format": "Formato lungo",
"full-format": "Formato completo", "full-format": "Formato completo",
"custom": "Personalizzato", "custom": "Personalizzato",
"help": "Aiuto",
"local-time": "Usa fuso orario locale", "local-time": "Usa fuso orario locale",
"omit-time": "Ometti orario", "omit-time": "Ometti orario",
"out-col-header": "Esporta le intestazioni delle colonne", "out-col-header": "Esporta le intestazioni delle colonne",
@ -264,7 +263,6 @@
"facet-by-count": "Faccetta per quantità alternative", "facet-by-count": "Faccetta per quantità alternative",
"edit-based-col": "Modifica l'espressione della faccetta basandoti sulla colonna", "edit-based-col": "Modifica l'espressione della faccetta basandoti sulla colonna",
"edit-facet-exp": "Modifica l'espressione della faccetta", "edit-facet-exp": "Modifica l'espressione della faccetta",
"current-exp": "Espressione corrente",
"set-max-choices": "Imposta il massimo numero di alternative da mostrare in ogni faccetta di testo (se troppe l'applicazione subirà rallentamenti)", "set-max-choices": "Imposta il massimo numero di alternative da mostrare in ogni faccetta di testo (se troppe l'applicazione subirà rallentamenti)",
"case-sensitive": "case sensitive", "case-sensitive": "case sensitive",
"regular-exp": "espressione regolare", "regular-exp": "espressione regolare",
@ -410,7 +408,7 @@
"sort": "Ordina", "sort": "Ordina",
"collapse-expand": "Collassa/espandi colonne per rendere più comoda la visualizzazione", "collapse-expand": "Collassa/espandi colonne per rendere più comoda la visualizzazione",
"collapse-this": "Collassa questa colonna", "collapse-this": "Collassa questa colonna",
"collapse-all": "Collassa tutte le altre colonne", "collapse-other": "Collassa tutte le altre colonne",
"collapse-left": "Collassa tutte le colonne a sinistra", "collapse-left": "Collassa tutte le colonne a sinistra",
"collapse-right": "Collassa tutte le colonne a destra", "collapse-right": "Collassa tutte le colonne a destra",
"reconcile": "Riconcilia", "reconcile": "Riconcilia",
@ -560,7 +558,6 @@
"view": "Vista", "view": "Vista",
"collapse-all": "Collassa tutte le colonne", "collapse-all": "Collassa tutte le colonne",
"expand-all": "Espandi tutte le colonne", "expand-all": "Espandi tutte le colonne",
"remove-sort": "Rimuovi ordinamento",
"reorder-perma": "Riordina righe permanentemente", "reorder-perma": "Riordina righe permanentemente",
"by": "Per", "by": "Per",
"custom-text-trans": "Trasformazione di testo personalizzata sulla colonna", "custom-text-trans": "Trasformazione di testo personalizzata sulla colonna",
@ -666,4 +663,4 @@
"transpose": "Transponi", "transpose": "Transponi",
"apply-to-all": "Applica a tutte le celle identiche" "apply-to-all": "Applica a tutte le celle identiche"
} }
} }

View File

@ -45,7 +45,8 @@ $.ajax({
type : "POST", type : "POST",
async : false, async : false,
data : { data : {
lng : lang module : "core",
// lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data;

View File

@ -11,11 +11,12 @@ Refine.SetLanguageUI = function(elmt) {
this._elmts.set_lan_btn.bind('click', function(e) { this._elmts.set_lan_btn.bind('click', function(e) {
$.ajax({ $.ajax({
url : "/command/core/set-language?", url : "/command/core/set-preference?",
type : "POST", type : "POST",
async : false, async : false,
data : { data : {
lng : $("#langDD option:selected").val() name : "userLang",
value : $("#langDD option:selected").val()
}, },
success : function(data) { success : function(data) {
alert($.i18n._('core-index-lang')["page-reload"]); alert($.i18n._('core-index-lang')["page-reload"]);

View File

@ -42,7 +42,8 @@ $.ajax({
type : "POST", type : "POST",
async : false, async : false,
data : { data : {
lng : lang module : "core",
// lang : lang
}, },
success : function(data) { success : function(data) {
dictionary = data; dictionary = data;

View File

@ -151,7 +151,7 @@ DataTableColumnHeaderUI.prototype._createMenuForColumnHeader = function(elmt) {
} }
}, },
{ {
label: $.i18n._('core-views')["collapse-all"], label: $.i18n._('core-views')["collapse-other"],
click: function() { click: function() {
var collapsedColumnNames = {}; var collapsedColumnNames = {};
for (var i = 0; i < theProject.columnModel.columns.length; i++) { for (var i = 0; i < theProject.columnModel.columns.length; i++) {