Adds a way to translate displayed string messages, in OPAC
JS source code alerts and other outputs. This is done by having
js.tt2 include i18n-strings.tt2 which contains an explosed/global
JS blob variable called eg_opac_i18n. This is intended to work
in similar fashion as base_js.tt2 in the webstaff ng client.
Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
--- /dev/null
+<!--
+This file allows us to bring TT2 i18n'ized strings
+to js source files, via js blob.
+-->
+<script>
+ var eg_opac_i18n = {};
+
+ eg_opac_i18n.EG_MISSING_REQUIRED_INPUT = "[% l('Please fill out all required fields') %]";
+</script>
<!-- JS imports, etc. -->
<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/simple.js[% ctx.cache_key %]"></script>
-
+[% INCLUDE "opac/i18n_strings.tt2" %]
<!-- DOB validation for Patron Registration in OPAC -->
<script type="text/javascript">
function dobValidate(input) {
{
return true;
} else {
- alert ("Please complete hold notification method info.");
+ alert(eg_opac_i18n.EG_MISSING_REQUIRED_INPUT);
res.culpritNames.forEach(function(n){
document.getElementsByName(n)[0].style.backgroundColor = "yellow";
});