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

added translations in json format #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

opichon
Copy link

@opichon opichon commented May 11, 2015

I have added to the i18n directories the translations resources renamed after the ISO 639-1 code. This allows an app to determine the appropriate translation file based ont he app's locale. This is more convenient and reliable than the language name (especially as some have typos in the language name, e.g. Ukranian instead of Ukrainian). See for example our own UAMDatatablesBundle for the symfony 2 framework.
The files' content is in pure JSON format; the comments at the top have been removed.
The extension is changed to json.
The contents have been converted to the new keys ("processing" as opposed to "sProcessing").

@DataTables
Copy link
Collaborator

Thank you for the PR. I'm not going to pull it in immediately, as I need to think about how to restructure the directory for this change, and subsequently also the web-site, but this is a change that I will be making at some point.

Are you happy for the changes to be released under the MIT license if I do pull it in? It might be a month or two before I have time to do so.

@opichon
Copy link
Author

opichon commented May 11, 2015

MIT license is fine.

@arturmamedov
Copy link

It will be merged or no? The language in i18n at the moment aren't ready to be used after install, i need to delete the comments for make it work, its not good approach in my opinion.

Example for Italian.lang i have this ontent that not work if i use it in language.url

/**
 * Italian translation
 *  @name Italian
 *  @anchor Italian
 *  @author Nicola Zecchin & Giulio Quaresima
 */

{
	"sEmptyTable":     "Nessun dato presente nella tabella",
	"sInfo":           "Vista da _START_ a _END_ di _TOTAL_ elementi",
	"sInfoEmpty":      "Vista da 0 a 0 di 0 elementi",
	"sInfoFiltered":   "(filtrati da _MAX_ elementi totali)",
	"sInfoPostFix":    "",
	"sInfoThousands":  ".",
	"sLengthMenu":     "Visualizza _MENU_ elementi",
	"sLoadingRecords": "Caricamento...",
	"sProcessing":     "Elaborazione...",
	"sSearch":         "Cerca:",
	"sZeroRecords":    "La ricerca non ha portato alcun risultato.",
	"oPaginate": {
		"sFirst":      "Inizio",
		"sPrevious":   "Precedente",
		"sNext":       "Successivo",
		"sLast":       "Fine"
	},
	"oAria": {
		"sSortAscending":  ": attiva per ordinare la colonna in ordine crescente",
		"sSortDescending": ": attiva per ordinare la colonna in ordine decrescente"
	}
}

If i remove comments for get this, all work fine!

{
	"sEmptyTable":     "Nessun dato presente nella tabella",
	"sInfo":           "Vista da _START_ a _END_ di _TOTAL_ elementi",
	"sInfoEmpty":      "Vista da 0 a 0 di 0 elementi",
	"sInfoFiltered":   "(filtrati da _MAX_ elementi totali)",
	"sInfoPostFix":    "",
	"sInfoThousands":  ".",
	"sLengthMenu":     "Visualizza _MENU_ elementi",
	"sLoadingRecords": "Caricamento...",
	"sProcessing":     "Elaborazione...",
	"sSearch":         "Cerca:",
	"sZeroRecords":    "La ricerca non ha portato alcun risultato.",
	"oPaginate": {
		"sFirst":      "Inizio",
		"sPrevious":   "Precedente",
		"sNext":       "Successivo",
		"sLast":       "Fine"
	},
	"oAria": {
		"sSortAscending":  ": attiva per ordinare la colonna in ordine crescente",
		"sSortDescending": ": attiva per ordinare la colonna in ordine decrescente"
	}
}

What are your suggestions, thank in advance.

@DataTables
Copy link
Collaborator

Ultimately yes, this will be done when I do some structural work on this repo.

In the mean time, the JSON files are all available on the CDN.

@arturmamedov
Copy link

@DataTables hi, unfortunately the file in CDN dosn't work to, for me, with language.url, i see from console that a http OPTIONS request is performed but it return a wrong formatted json at line 1. There is a solution for this?
I on the 1.10.15 version of DataTables, Thanks!

@DataTables
Copy link
Collaborator

Happy to take a look at a test case showing the issue.

@dzhuang
Copy link

dzhuang commented Mar 13, 2018

I think zh.json should be zh-Hans.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants