aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/fixmystreet.js
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2013-02-06 15:08:23 +0000
committerDave Whiteland <dave@mysociety.org>2013-02-06 15:08:23 +0000
commit0f24a44cd6e8b056db482cb91c85768b6d1e7d1d (patch)
tree09a90f38574ee62754f3c8ac077152ed99a38296 /web/js/fixmystreet.js
parentc061769ba72f420e2f2c6064fa526648e57339f1 (diff)
parent5b2e18389734751165d2eeb21a3b3f2e8d2e8755 (diff)
Merge remote branch 'origin/master' into oxfordshire-header
Diffstat (limited to 'web/js/fixmystreet.js')
-rw-r--r--web/js/fixmystreet.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js
index 1d5ef6b97..e25c2a571 100644
--- a/web/js/fixmystreet.js
+++ b/web/js/fixmystreet.js
@@ -43,18 +43,18 @@ $(function(){
// FIXME - needs to use translated string
jQuery.validator.addMethod('validCategory', function(value, element) {
- return this.optional(element) || value != '-- Pick a category --'; }, validation_strings.category );
+ return this.optional(element) || value != '-- Pick a category --'; }, translation_strings.category );
jQuery.validator.addMethod('validName', function(value, element) {
var validNamePat = /\ba\s*n+on+((y|o)mo?u?s)?(ly)?\b/i;
- return this.optional(element) || value.length > 5 && value.match( /\S/ ) && value.match( /\s/ ) && !value.match( validNamePat ); }, validation_strings.category );
+ return this.optional(element) || value.length > 5 && value.match( /\S/ ) && value.match( /\s/ ) && !value.match( validNamePat ); }, translation_strings.category );
var form_submitted = 0;
var submitted = false;
$("form.validate").validate({
rules: validation_rules,
- messages: validation_strings,
+ messages: translation_strings,
onkeyup: false,
onfocusout: false,
errorElement: 'div',
@@ -128,7 +128,7 @@ $(function(){
// Geolocation
if (geo_position_js.init()) {
- var link = '<a href="#LINK" id="geolocate_link">&hellip; ' + validation_strings.geolocate + '</a>';
+ var link = '<a href="#LINK" id="geolocate_link">&hellip; ' + translation_strings.geolocate + '</a>';
$('form[action="/alert/list"]').append(link.replace('LINK','alert/list'));
if ($('body.frontpage').length) {
$('#postcodeForm').after(link.replace('LINK','around'));
@@ -153,13 +153,13 @@ $(function(){
}, function(err) {
$link.find('img').remove();
if (err.code == 1) { // User said no
- $link.html("You declined; please fill in the box above");
+ $link.html(translation_strings.geolocation_declined);
} else if (err.code == 2) { // No position
- $link.html("Could not look up location");
+ $link.html(translation_strings.geolocation_no_position);
} else if (err.code == 3) { // Too long
- $link.html("No result returned");
+ $link.html(translation_strings.geolocation_no_result);
} else { // Unknown
- $link.html("Unknown error");
+ $link.html(translation_strings.geolocation_unknown);
}
}, {
enableHighAccuracy: true,