translating javascript alert string in tpl-login.php & tpl-registration.php
This JavaScript function is defined at the top of
tpl-login.php:
HTML Code:
<script type="text/javascript">
function CheckLength(name) {
var password = document.getElementById(name).value;
if (password.length < 6)
alert('Your password should have miniumum 6 characters');
}
</script>
It contains a typo ("miniumum").
I don't think non-English language users will be able to translate it via .mo files.
One way someone can re-implement that so it is translatable via .mo files is to embed PHP inside the JavaScript function.
For example:
PHP Code:
<script type="text/javascript">
function CheckLength(name) {
var password = document.getElementById(name).value;
if (password.length < 6)
alert('<?php echo _( 'Your password should have miniumum 6 characters' ) ?>');
}
</script>
On a side note, the minimum password length value is hard-coded here. It may be incompatible with plugins that control minimum password length (e.g. user may submit a password with length 5, see this client-side alert telling them the minimum length is 6, re-submit password with length 7; then see an HTML alert saying the minimum length on the server-side is 8).