diff options
author | Vincent Tam <sere@live.hk> | 2019-05-21 04:44:26 +0300 |
---|---|---|
committer | Vincent Tam <sere@live.hk> | 2019-05-21 04:44:54 +0300 |
commit | e661fed5bfa6d6a633842c6c3ac6fdfd4db63a0b (patch) | |
tree | 9c7bac44370acda0022464ca6ea0f25431844297 /assets | |
parent | c9e48180845fc19f8c111d551ba8b3faa67aa927 (diff) |
Staticman i18n
Ce script en AWK a été appliqué
```awk
/^# [A-Z].*/,/^[a-z-]+:/ {
print $0
}
/^[a-z-]+:/ {
sub(":", "", $1)
system("ls i18n | grep -q " $1 " && echo true || echo false"); print ""
}
/comment_btn_submit/,/comment_error_msg/ {
split($1, a, "_")
a31 = toupper(substr(a[3],1,1))
a32 = substr(a[3],2)
print("- id: " a[2] a31 a32)
split($0, b, " : ")
print(" translation: " b[2])
}
/comment_error_msg/ { print "" }
```
sur le fichier d'i18n du thème Beautiful Jekyll.
J'ai vérifié mot à mot de l'esperanto. Néanmoins, le norvégien est
d'autant plus dûr que j'avais pas envie de vérifier son grammaire.
Diffstat (limited to 'assets')
-rw-r--r-- | assets/css/staticman.css | 18 | ||||
-rw-r--r-- | assets/js/staticman.js | 9 |
2 files changed, 11 insertions, 16 deletions
diff --git a/assets/css/staticman.css b/assets/css/staticman.css index d76032d..2b3e8a8 100644 --- a/assets/css/staticman.css +++ b/assets/css/staticman.css @@ -35,17 +35,16 @@ -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; - box-shadow:0 0 2px #888; width: 100%; max-width: 100%; - min-height: 10ex; + min-height: 5rem; } .staticman-comments .comment-avatar { float: left; - width: 48px; - height: 48px; - margin-right: 10px; + width: 3rem; + height: 3rem; + margin-right: 1rem; } .staticman-comments .static-comment-reply { @@ -56,10 +55,7 @@ content: ' ↷ '; } -.form--loading:before { - content: ''; -} - -.form--loading .form__spinner { - display: block; +.staticman-comments .form--loading:before { + opacity: 0.5; + cursor: not-allowed; } diff --git a/assets/js/staticman.js b/assets/js/staticman.js index 0d20fe1..a09cbd8 100644 --- a/assets/js/staticman.js +++ b/assets/js/staticman.js @@ -14,16 +14,15 @@ $(document).ready(function() { data: $(this).serialize(), contentType: 'application/x-www-form-urlencoded', success: function (data) { - // $('.js-form input[type="submit"]').val('{{ i18n comment_btn_submit }}'); - // showAlert('{{ i18n comment_success_msg }}'); + $('.js-form input[type="submit"]').val('{{ i18n btnSubmitted }}'); + showAlert('{{ i18n successMsg }}'); showAlert('success'); - $(form).removeClass('form--loading'); clearForm(); }, error: function (err) { console.log(err); - // $('.js-form input[type="submit"]').val('{{ i18n comment_btn_submit }}'); - // showAlert('{{ i18n comment_error_msg }}'); + $('.js-form input[type="submit"]').val('{{ i18n btnSubmit }}'); + showAlert('{{ i18n errorMsg }}'); showAlert('failed'); $(form).removeClass('form--loading'); } |