PageSourceSearch

https://ajopa.org/lib/pkp/js/functions/jqueryValidatorI18n.js

js ajopa.org collected 2026-10-08 19:58:12 UTC 1,042 bytes, 39 lines download raw bytes

1/**
2 * jqueryValidatorI18n.js
3 *
4 * Copyright (c) 2013-2019 Simon Fraser University
5 * Copyright (c) 2000-2019 John Willinsky
6 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
7 *
8 * short function to map PKP localization strings to the jquery validation plugin localization
9 */
10
11/**
12 * need a mapping of PKP locale strings to the ones used by the jquery validation plugin
13 */
14function jqueryValidatorI18n(baseUrl, locale) {
15	var scriptPrefix;
16	scriptPrefix = baseUrl + "/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_";
17	switch(locale) {
18		//TODO: add all other PKP supported locales
19		// French
20		case 'fr_FR':
21		case 'ca_FR':
22			eval($.getScript(scriptPrefix + "fr.js"));
23			break;
24		// Portuguese
25		case 'pt_BR':
26			eval($.getScript(scriptPrefix + "ptbr.js"));
27			break;
28		case 'pt_PT':
29			eval($.getScript(scriptPrefix + "ptpt.js"));
30			break;
31		// Spanish
32		case 'es_AR':
33		case 'es_ES':
34			eval($.getScript(scriptPrefix + "es.js"));
35			break;
36		default:
37			// default to no localization
38	}
39}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.