<commit_before>/*
	moneylog.js
	http://aurelio.net/moneylog
*/

/*********************************************************************
* User Config
* -----------
*
* There is no need to change *anything*, but if you have special
* needs, here is the place to customize this script.
*
*********************************************************************/
// Program interface
var lang = 'pt';                  // pt:Portuguese, en:English, ca:Catalan, es:Spanish (Argentina)
var maxLastMonths = 12;           // Number of months on the last months combo
var initLastMonths = 3;           // Initial value for last months combo
var defaultLastMonths = false;    // Last months combo inits checked?
var defaultMonthPartials = true;  // Monthly checkbox inits checked?
var defaultFuture = false;        // Show future checkbox inits checked?
var defaultRegex = false;         // Search regex checkbox inits checked?
var defaultNegate = false;        // Search negate checkbox inits checked?
var defaultSearch = '';           // Search for this text on init
var showRowCount = true;          // Show the row numbers at left?
var monthlyRowCount = true;       // The row numbers are reset each month?
var highlightWords = '';          // The words you may want to highlight (ie: 'XXX TODO')
var highlightTags = '';           // The tags you may want to highlight (ie: 'work kids')
var reportType = 'd';             // Initial report type: d m y (daily, monthly, yearly)
var showLocaleDate = false;       // Show dates in the regional format? (ie: 12/31/2009)

// Charts
var showMiniBars = true;          // Show the percentage bars in monthly/yearly reports?
var showMiniBarsLabels = true;    // Show the labels inside the bars?
var miniBarWidth = 70;            // The percentage bar width, in pixels
var showCharts = true;            // Show the bar chart after the monthly/yearly report?
var showChartBarLabel = true;     // Show the labels above the bars?

// Program structure and files
var oneFile = false;              // Full app is at moneylog.html single file?
var dataFiles = ['moneylog.txt']; // The paths for the data files (requires oneFile=false)
// Note: The dataFile encoding is UTF-8. Change to ISO-8859-1 if accents got mangled.

// Data format
var dataFieldSeparator = '\t';
var dataRecordSeparator = /\r?\n/;  // \r\n Windows, \n Linux/Mac
var dataTagTerminator = '|';
var dataTagSeparator = ',';
var commentChar = '#';   // Must be at line start (column 1)
var dataPatterns = {
	date:
		// YYYY-MM-DD
		/^ *(\d{4}-\d\d-\d\d) *$/,
	amountNumber:
		// 7  +7  -7  7.00  7,00  1234567,89  1.234.567,89  1,234,567.89 1234567,89
		/^ *([+\-]? *(\d+|\d{1,3}([.,]\d{3})*)([.,]\d\d)?) *$/,
	amountCents:
		// .12  ,12
		/[.,](\d\d) *$/,
	amountRecurrent:
		// *N or /N where N>0
		/([*\/])([1-9][0-9]*) *$/
};

// Internationalisation (i18n) - Screen Labels and formatting
var i18nDatabase = {
	defaultLanguage: 'en',
	pt: {
		labelLastMonths: 'Somente Recentes:',
		labelMonthPartials: 'Mostrar Parciais Mensais',
		labelFuture: 'Mostrar Lançamentos Futuros',
		labelNoData: 'Nenhum lançamento.',
		labelsDetailed: ['Data', 'Valor', 'Tags', 'Descrição', 'Acumulado'],
		labelsOverview: ['Período', 'Ganhos', 'Gastos', 'Saldo', 'Acumulado'],
		labelTotal: 'Total',
		labelAverage: 'Média',
		labelMinimum: 'Mínimo',
		labelMaximum: 'Máximo',
		labelMonths: ['mês', 'meses'],
		labelRegex: 'regex',
		labelNegate: 'excluir',
		labelDaily: 'diário',
		labelMonthly: 'mensal',
		labelYearly: 'anual',
		labelHelp: 'Ajuda',
		labelReload: 'Recarregar',
		labelValueFilter: 'Somente Valores:',
		labelPositive: 'positivo',
		labelNegative: 'negativo',
		labelGreaterThan: 'maior que',
		labelLessThan: 'menor que',
		labelTagEmpty: 'VAZIO',
		labelTagGroup: 'Unir as tags escolhidas',
		errorInvalidData: 'Lançamento inválido na linha ',
		errorNoFieldSeparator: 'Separador não encontrado:',
		errorTooManySeparators: 'Há mais de 2 sepadarores',
		errorInvalidDate: 'Data inválida:',
		errorInvalidAmount: 'Valor inválido:',
		msgLoading: 'Carregando %s...',
		appUrl: 'http://aurelio.net/moneylog/beta.html',
		appDescription: 'Uma página. Um programa.',
		dateFormat: 'd/m/Y',
		centsSeparator: ',',
		thousandSeparator: '.'
	},
	en: {
		labelLastMonths: 'Recent Only:',
		labelMonthPartials: 'Show Monthly Partials',
		labelFuture: 'Show Future Data',
		labelNoData: 'No data.',
		labelsDetailed: ['Date', 'Amount', 'Tags', 'Description', 'Balance'],
		labelsOverview: ['Period', 'Incoming', 'Expense', 'Partial', 'Balance'],
		labelTotal: 'Total',
		labelAverage: 'Average',
		labelMinimum: 'Min',
		labelMaximum: 'Max',
		labelMonths: ['month', 'months'],
		labelRegex: 'regex',
		labelNegate: 'negate',
		labelDaily: 'daily',
		labelMonthly: 'monthly',
		labelYearly: 'yearly',
		labelHelp: 'Help',
		labelReload: 'Reload',
		labelValueFilter: 'Filter Values:',
		labelPositive: 'positive',
		labelNegative: 'negative',
		labelGreaterThan: 'greater than',
		labelLessThan: 'less than',
		labelTagEmpty: 'EMPTY',
		labelTagGroup: 'Group selected tags',
		errorInvalidData: 'Invalid data at line ',
		errorNoFieldSeparator: 'No separator found:',
		errorTooManySeparators: 'Too many separators',
		errorInvalidDate: 'Invalid date:',
		errorInvalidAmount: 'Invalid amount:',
		msgLoading: 'Loading %s...',
		appUrl: 'http://aurelio.net/soft/moneylog',
		appDescription: 'A webpage. A software.',
		dateFormat: 'm/d/y',
		centsSeparator: '.',
		thousandSeparator: ','
	},
	ca: {
		labelLastMonths: 'Només els Darrers:',
		labelMonthPartials: 'Mostra els Parcials Mensuals',
		labelFuture: 'Mostra les dades futures',
		labelNoData: 'No hi ha dades.',
		labelsDetailed: ['Data', 'Import', 'Etiquetes', 'Descripció', 'Balanç'],
		labelsOverview: ['Període', 'Ingressos', 'Despeses', 'Parcials', 'Balanç'],
		labelTotal: 'Total',
		labelAverage: 'Mitja',
		labelMinimum: 'Min',
		labelMaximum: 'Max',
		labelMonths: ['mes', 'mesos'],
		labelRegex: 'regex',
		labelNegate: 'nega-ho',
		labelDaily: 'diari',
		labelMonthly: 'mensual',
		labelYearly: 'anual',
		labelHelp: 'Ajuda',
		labelReload: 'Carrega',
		labelValueFilter: 'Valors Filtrats:',
		labelPositive: 'positiu',
		labelNegative: 'negatiu',
		labelGreaterThan: 'més gran que',
		labelLessThan: 'més petit que',
		labelTagEmpty: 'BUIT',
		labelTagGroup: 'Etiquetes de grup triades',
		errorInvalidData: 'Hi ha un adada no vàlida a la línia ',
		errorNoFieldSeparator: 'No separator found:',
		errorTooManySeparators: 'Hi ha masses separadors',
		errorInvalidDate: 'La data no és vàlida:',
		errorInvalidAmount: "L'import no és vàlid:",
		appUrl: 'http://aurelio.net/soft/moneylog',
		appDescription: 'Una pàgina web. Un programari.',
		centsSeparator: ',',
		thousandSeparator: '.',
		dateFormat: 'd-m-y',
		msgLoading: "S'està carregant %s..."
	},
	es: {
		labelLastMonths: 'Ver solo últimos:',
		labelMonthPartials: 'Mostrar Parcial Mensual',
		labelFuture: 'Mostrar Transacciones Futuras',
		labelNoData: 'Sin información.',
		labelsDetailed: ['Fecha', 'Monto', 'Concepto', 'Descripción', 'Balance'],
		labelsOverview: ['Período', 'Ingresos', 'Egresos', 'Saldo', 'Balance'],
		labelTotal: 'Total',
		labelAverage: 'Promedio',
		labelMinimum: 'Min',
		labelMaximum: 'Max',
		labelMonths: ['mes', 'meses'],
		labelRegex: 'regex',
		labelNegate: 'negar',
		labelDaily: 'diario',
		labelMonthly: 'mensual',
		labelYearly: 'anual',
		labelHelp: 'Ayuda',
		labelReload: 'Recargar',
		labelValueFilter: 'Mostrar Valores:',
		labelPositive: 'positivos',
		labelNegative: 'negativos',
		labelGreaterThan: 'mayores a',
		labelLessThan: 'menores a',
		labelTagEmpty: 'Vacío',
		labelTagGroup: 'Unir conceptos seleccionados',
		errorInvalidData: 'Información invalida en la línea ',
		errorNoFieldSeparator: 'No se encontraron separadores:',
		errorTooManySeparators: 'Demasiados separadores',
		errorInvalidDate: 'Fecha invalida:',
		errorInvalidAmount: 'Cantidad invalida:',
		msgLoading: 'Cargando %s...',
		appUrl: 'http://aurelio.net/soft/moneylog',
		appDescription: 'Una página web. Un software.',
		dateFormat: 'd/m/Y',
		centsSeparator: ',',
		thousandSeparator: '.'
	},
	getLanguage: function(lang) {
		var phrase, defaultLang = this.defaultLanguage;
		
		if (defaultLang != lang) {
			if (this[lang]) {
				// check if all attributes from 'defaultLang' are in 'lang'<commit_msg>Changed 'labelTagEmpty' from lower to uppercaps and made it plural in es Argentina<commit_after>/*
	moneylog.js
	http://aurelio.net/moneylog
*/

/*********************************************************************
* User Config
* -----------
*
* There is no need to change *anything*, but if you have special
* needs, here is the place to customize this script.
*
*********************************************************************/
// Program interface
var lang = 'pt';                  // pt:Portuguese, en:English, ca:Catalan, es:Spanish (Argentina)
var maxLastMonths = 12;           // Number of months on the last months combo
var initLastMonths = 3;           // Initial value for last months combo
var defaultLastMonths = false;    // Last months combo inits checked?
var defaultMonthPartials = true;  // Monthly checkbox inits checked?
var defaultFuture = false;        // Show future checkbox inits checked?
var defaultRegex = false;         // Search regex checkbox inits checked?
var defaultNegate = false;        // Search negate checkbox inits checked?
var defaultSearch = '';           // Search for this text on init
var showRowCount = true;          // Show the row numbers at left?
var monthlyRowCount = true;       // The row numbers are reset each month?
var highlightWords = '';          // The words you may want to highlight (ie: 'XXX TODO')
var highlightTags = '';           // The tags you may want to highlight (ie: 'work kids')
var reportType = 'd';             // Initial report type: d m y (daily, monthly, yearly)
var showLocaleDate = false;       // Show dates in the regional format? (ie: 12/31/2009)

// Charts
var showMiniBars = true;          // Show the percentage bars in monthly/yearly reports?
var showMiniBarsLabels = true;    // Show the labels inside the bars?
var miniBarWidth = 70;            // The percentage bar width, in pixels
var showCharts = true;            // Show the bar chart after the monthly/yearly report?
var showChartBarLabel = true;     // Show the labels above the bars?

// Program structure and files
var oneFile = false;              // Full app is at moneylog.html single file?
var dataFiles = ['moneylog.txt']; // The paths for the data files (requires oneFile=false)
// Note: The dataFile encoding is UTF-8. Change to ISO-8859-1 if accents got mangled.

// Data format
var dataFieldSeparator = '\t';
var dataRecordSeparator = /\r?\n/;  // \r\n Windows, \n Linux/Mac
var dataTagTerminator = '|';
var dataTagSeparator = ',';
var commentChar = '#';   // Must be at line start (column 1)
var dataPatterns = {
	date:
		// YYYY-MM-DD
		/^ *(\d{4}-\d\d-\d\d) *$/,
	amountNumber:
		// 7  +7  -7  7.00  7,00  1234567,89  1.234.567,89  1,234,567.89 1234567,89
		/^ *([+\-]? *(\d+|\d{1,3}([.,]\d{3})*)([.,]\d\d)?) *$/,
	amountCents:
		// .12  ,12
		/[.,](\d\d) *$/,
	amountRecurrent:
		// *N or /N where N>0
		/([*\/])([1-9][0-9]*) *$/
};

// Internationalisation (i18n) - Screen Labels and formatting
var i18nDatabase = {
	defaultLanguage: 'en',
	pt: {
		labelLastMonths: 'Somente Recentes:',
		labelMonthPartials: 'Mostrar Parciais Mensais',
		labelFuture: 'Mostrar Lançamentos Futuros',
		labelNoData: 'Nenhum lançamento.',
		labelsDetailed: ['Data', 'Valor', 'Tags', 'Descrição', 'Acumulado'],
		labelsOverview: ['Período', 'Ganhos', 'Gastos', 'Saldo', 'Acumulado'],
		labelTotal: 'Total',
		labelAverage: 'Média',
		labelMinimum: 'Mínimo',
		labelMaximum: 'Máximo',
		labelMonths: ['mês', 'meses'],
		labelRegex: 'regex',
		labelNegate: 'excluir',
		labelDaily: 'diário',
		labelMonthly: 'mensal',
		labelYearly: 'anual',
		labelHelp: 'Ajuda',
		labelReload: 'Recarregar',
		labelValueFilter: 'Somente Valores:',
		labelPositive: 'positivo',
		labelNegative: 'negativo',
		labelGreaterThan: 'maior que',
		labelLessThan: 'menor que',
		labelTagEmpty: 'VAZIO',
		labelTagGroup: 'Unir as tags escolhidas',
		errorInvalidData: 'Lançamento inválido na linha ',
		errorNoFieldSeparator: 'Separador não encontrado:',
		errorTooManySeparators: 'Há mais de 2 sepadarores',
		errorInvalidDate: 'Data inválida:',
		errorInvalidAmount: 'Valor inválido:',
		msgLoading: 'Carregando %s...',
		appUrl: 'http://aurelio.net/moneylog/beta.html',
		appDescription: 'Uma página. Um programa.',
		dateFormat: 'd/m/Y',
		centsSeparator: ',',
		thousandSeparator: '.'
	},
	en: {
		labelLastMonths: 'Recent Only:',
		labelMonthPartials: 'Show Monthly Partials',
		labelFuture: 'Show Future Data',
		labelNoData: 'No data.',
		labelsDetailed: ['Date', 'Amount', 'Tags', 'Description', 'Balance'],
		labelsOverview: ['Period', 'Incoming', 'Expense', 'Partial', 'Balance'],
		labelTotal: 'Total',
		labelAverage: 'Average',
		labelMinimum: 'Min',
		labelMaximum: 'Max',
		labelMonths: ['month', 'months'],
		labelRegex: 'regex',
		labelNegate: 'negate',
		labelDaily: 'daily',
		labelMonthly: 'monthly',
		labelYearly: 'yearly',
		labelHelp: 'Help',
		labelReload: 'Reload',
		labelValueFilter: 'Filter Values:',
		labelPositive: 'positive',
		labelNegative: 'negative',
		labelGreaterThan: 'greater than',
		labelLessThan: 'less than',
		labelTagEmpty: 'EMPTY',
		labelTagGroup: 'Group selected tags',
		errorInvalidData: 'Invalid data at line ',
		errorNoFieldSeparator: 'No separator found:',
		errorTooManySeparators: 'Too many separators',
		errorInvalidDate: 'Invalid date:',
		errorInvalidAmount: 'Invalid amount:',
		msgLoading: 'Loading %s...',
		appUrl: 'http://aurelio.net/soft/moneylog',
		appDescription: 'A webpage. A software.',
		dateFormat: 'm/d/y',
		centsSeparator: '.',
		thousandSeparator: ','
	},
	ca: {
		labelLastMonths: 'Només els Darrers:',
		labelMonthPartials: 'Mostra els Parcials Mensuals',
		labelFuture: 'Mostra les dades futures',
		labelNoData: 'No hi ha dades.',
		labelsDetailed: ['Data', 'Import', 'Etiquetes', 'Descripció', 'Balanç'],
		labelsOverview: ['Període', 'Ingressos', 'Despeses', 'Parcials', 'Balanç'],
		labelTotal: 'Total',
		labelAverage: 'Mitja',
		labelMinimum: 'Min',
		labelMaximum: 'Max',
		labelMonths: ['mes', 'mesos'],
		labelRegex: 'regex',
		labelNegate: 'nega-ho',
		labelDaily: 'diari',
		labelMonthly: 'mensual',
		labelYearly: 'anual',
		labelHelp: 'Ajuda',
		labelReload: 'Carrega',
		labelValueFilter: 'Valors Filtrats:',
		labelPositive: 'positiu',
		labelNegative: 'negatiu',
		labelGreaterThan: 'més gran que',
		labelLessThan: 'més petit que',
		labelTagEmpty: 'BUIT',
		labelTagGroup: 'Etiquetes de grup triades',
		errorInvalidData: 'Hi ha un adada no vàlida a la línia ',
		errorNoFieldSeparator: 'No separator found:',
		errorTooManySeparators: 'Hi ha masses separadors',
		errorInvalidDate: 'La data no és vàlida:',
		errorInvalidAmount: "L'import no és vàlid:",
		appUrl: 'http://aurelio.net/soft/moneylog',
		appDescription: 'Una pàgina web. Un programari.',
		centsSeparator: ',',
		thousandSeparator: '.',
		dateFormat: 'd-m-y',
		msgLoading: "S'està carregant %s..."
	},
	es: {
		labelLastMonths: 'Ver solo últimos:',
		labelMonthPartials: 'Mostrar Parcial Mensual',
		labelFuture: 'Mostrar Transacciones Futuras',
		labelNoData: 'Sin información.',
		labelsDetailed: ['Fecha', 'Monto', 'Concepto', 'Descripción', 'Balance'],
		labelsOverview: ['Período', 'Ingresos', 'Egresos', 'Saldo', 'Balance'],
		labelTotal: 'Total',
		labelAverage: 'Promedio',
		labelMinimum: 'Min',
		labelMaximum: 'Max',
		labelMonths: ['mes', 'meses'],
		labelRegex: 'regex',
		labelNegate: 'negar',
		labelDaily: 'diario',
		labelMonthly: 'mensual',
		labelYearly: 'anual',
		labelHelp: 'Ayuda',
		labelReload: 'Recargar',
		labelValueFilter: 'Mostrar Valores:',
		labelPositive: 'positivos',
		labelNegative: 'negativos',
		labelGreaterThan: 'mayores a',
		labelLessThan: 'menores a',
		labelTagEmpty: 'VACÍOS',
		labelTagGroup: 'Unir conceptos seleccionados',
		errorInvalidData: 'Información invalida en la línea ',
		errorNoFieldSeparator: 'No se encontraron separadores:',
		errorTooManySeparators: 'Demasiados separadores',
		errorInvalidDate: 'Fecha invalida:',
		errorInvalidAmount: 'Cantidad invalida:',
		msgLoading: 'Cargando %s...',
		appUrl: 'http://aurelio.net/soft/moneylog',
		appDescription: 'Una página web. Un software.',
		dateFormat: 'd/m/Y',
		centsSeparator: ',',
		thousandSeparator: '.'
	},
	getLanguage: function(lang) {
		var phrase, defaultLang = this.defaultLanguage;
		
		if (defaultLang != lang) {
			if (this[lang]) {
				// check if all attributes from 'defaultLang' are in 'lang'
{'fraction_non_alphanumeric': 0.1622299152441208, 'fraction_numerical': 0.009908081652142771, 'mean_word_length': 4.109789569990851, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2036219', 'n_tokens_mistral': 6173, 'n_tokens_neox': 5648, 'n_words': 1573}