Browse Source

i18n & l10n

master
Aeris 3 years ago
parent
commit
5bce485c76

+ 1
- 0
Gemfile View File

@@ -7,6 +7,7 @@ gem 'sidekiq', '~> 3.4.2'
gem 'stretcher', '~> 1.21.1'
gem 'faraday', '~> 0.8.9' # For stretcher compatibility
gem 'simpleidn', '~> 0.0.5'
gem 'http_accept_language'

group :assets do
gem 'therubyracer', platforms: :ruby

+ 2
- 0
app/controllers/application_controller.rb View File

@@ -2,4 +2,6 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception

include HttpAcceptLanguage::AutoLocale
end

+ 5
- 3
app/views/application/_headers.erb View File

@@ -2,7 +2,9 @@
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<span class="navbar-brand">CryptCheck</span>
<span>
<%= link_to 'CryptCheck', root_path, class: %i(navbar-brand) %>
</span>
</div>
<ul class="nav navbar-nav">
<li><%= link_to 'HTTPS / SMTP / XMPP', root_path %></li>
@@ -10,8 +12,8 @@
<li><%= link_to 'SSH', ssh_path %></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><%= link_to 'Cipher suite', suite_path %></li>
<li><%= link_to 'Ciphers', ciphers_path %></li>
<li><%= link_to t('User agent compatibility'), suite_path %></li>
<li><%= link_to t('Supported ciphers'), ciphers_path %></li>
<!--
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">

+ 4
- 4
app/views/check/processing.html.erb View File

@@ -6,14 +6,14 @@
<div class="col-sm-8 col-sm-offset-2">
<h1>
<i class="fa fa-spinner fa-pulse"></i>
[<%= self.type.to_s.upcase %>] Analyse en cours de <%= @host %>
[<%= self.type.to_s.upcase %>] <%= t 'Currently analysing %{host}', host: @host %>
</h1>
<p class="small">
Début de l’analyse : <%= l @result.date %>
<%= t 'Start of analysis: %{date}', date: l(@result.date) %>
</p>
<p class="pull-right">
Merci de patienter…
<span class="small">(Cette page se rafraîchit automatiquement toutes les 10 secondes)</span>
<%= t('Please waiting…') %>
<span class="small">(<%= t 'Cette page se rafraîchit automatiquement toutes les 10 secondes' %>)</span>
</p>
</div>
</div>

+ 31
- 31
app/views/check/show.html.erb View File

@@ -7,7 +7,7 @@
</div>
<% if Time.now - @result.date >= Rails.configuration.refresh_delay %>
<div class="col-sm-1">
<%= link_to 'Rafraîchir', {action: :refresh}, class: %i(btn btn-default) %>
<%= link_to t('Refresh'), {action: :refresh}, class: %i(btn btn-default) %>
</div>
<% end %>
</div>
@@ -19,7 +19,7 @@
<div class="row">
<div class="col-sm-12">
<h2><%= host.name %> - <%= host.ip %> : <%= host.port %></h2>
Error during analysis :
<%= t 'Error during analysis:' %>
<span class="label label-error"><%= error %></span>
</div>
</div>
@@ -45,12 +45,12 @@
</thead>
<tbody>
<%
{ 'Protocole' => 'protocol',
'Échange de clef' => 'key_exchange',
'Chiffrement' => 'cipher_strengths',
'Total' => 'score'}.each do |name, v| %>
{ 'Protocol' => 'protocol',
'Key exchange' => 'key_exchange',
'Cipher' => 'cipher_strengths',
'Overall' => 'score'}.each do |name, v| %>
<tr>
<th class="col-sm-4"><%= name %></th>
<th class="col-sm-4"><%= t name %></th>
<td class="col-sm-8"><%= score_progress grade.details[v] %></td>
</tr>
<% end %>
@@ -61,25 +61,25 @@
<table class="table table-bordered table-condensed table-striped">
<tbody>
<tr>
<th class="col-sm-4">Protocoles</th>
<th class="col-sm-4"><%= t 'Protocols' %></th>
<td class="col-sm-8"><%= protocol_labels handshake.protocols %></td>
</tr>
<tr>
<th>Clefs</th>
<th><%= t 'Keys' %></th>
<td>
<p>Certificat : <%= key_label handshake[:key] %></p>
<p><%= t 'Certificates:' %> <%= key_label handshake[:key] %></p>
<p>Diffie Hellman : <%= key_labels handshake.dh %></p>
</td>
</tr>
<% { 'Bonnes pratiques' => :success,
'Alertes' => :warning,
'Dangers' => :danger,
'Erreurs' => :error }.each do |name, color|
<% { 'Good practices' => :success,
'Warning' => :warning,
'Critical' => :danger,
'Fatal' => :error }.each do |name, color|
names = grade[color]
next if names.nil? or names.empty?
%>
<tr>
<th><%= name %></th>
<th><%= t name %></th>
<td>
<% names.each do |name| %>
<span class="label label-<%= color %>"><%= name.upcase %></span>
@@ -96,24 +96,24 @@
<table class="table table-bordered table-condensed table-striped center">
<thead>
<tr>
<th rowspan="2">Name</th>
<th colspan="2">Key exchange</th>
<th colspan="2">Authentification</th>
<th colspan="4">Encryption</th>
<th colspan="2">MAC</th>
<th rowspan="2">PFS</th>
<th rowspan="2"><%= t 'Name' %></th>
<th colspan="2"><%= t 'Key exchange' %></th>
<th colspan="2"><%= t 'Authentication' %></th>
<th colspan="4"><%= t 'Encryption' %></th>
<th colspan="2"><%= t 'MAC' %></th>
<th rowspan="2"><%= t 'PFS' %></th>
</tr>
<tr>
<th>Type</th>
<th>Key size</th>
<th>Type</th>
<th>Key size</th>
<th>Type</th>
<th>Key size</th>
<th>Block size</th>
<th>Mode</th>
<th>Type</th>
<th>Size</th>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Block size' %></th>
<th><%= t 'Mode' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Size' %></th>
</tr>
</thead>
<tbody>

+ 1
- 1
app/views/layouts/application.html.erb View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>CryptcheckRails</title>
<title>CryptCheck</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>

+ 12
- 12
app/views/site/ciphers.html.erb View File

@@ -3,20 +3,20 @@
<table class="table table-bordered table-condensed table-striped center col-sm-12">
<thead>
<tr>
<th rowspan="2">Name</th>
<th rowspan="2">Key exchange</th>
<th rowspan="2">Authentification</th>
<th colspan="4">Encryption</th>
<th colspan="2">MAC</th>
<th rowspan="2">PFS</th>
<th rowspan="2"><%= t 'Name' %></th>
<th rowspan="2"><%= t 'Key exchange' %></th>
<th rowspan="2"><%= t 'Authentication' %></th>
<th colspan="4"><%= t 'Encryption' %></th>
<th colspan="2"><%= t 'MAC' %></th>
<th rowspan="2"><%= t 'PFS' %></th>
</tr>
<tr>
<th>Type</th>
<th>Key size</th>
<th>Block size</th>
<th>Mode</th>
<th>Type</th>
<th>Size</th>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Block size' %></th>
<th><%= t 'Mode' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Size' %></th>
</tr>
</thead>
<tbody>

+ 2
- 2
app/views/site/index.html.erb View File

@@ -1,7 +1,7 @@
<div id="check" class="container">
<div class="row">
<div class="col-sm-12">
<h1>Vérifier votre domaine</h1>
<h1><%= t 'Check your domain' %></h1>
<%= form_tag root_path do %>
<div class="form-group">
<div class="col-sm-8">
@@ -11,7 +11,7 @@
<%= select_tag :type, options_for_select({'HTTPS' => :https, 'SMTP' => :smtp, 'XMPP' => :xmpp}), class: %i(form-control input-lg) %>
</div>
<div class="col-sm-2">
<%= submit_tag 'Test-moi !', class: %i(form-control btn btn-primary input-lg pull-right) %>
<%= submit_tag t('Test me!'), class: %i(form-control btn btn-primary input-lg pull-right) %>
</div>
</div>
<% end %>

+ 26
- 26
app/views/site/suite.html.erb View File

@@ -1,28 +1,28 @@
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1>Cipher suite : <%= @suite %></h1>
<h1><%= t 'Cipher suite:' %> <%= @suite %></h1>
</div>
</div>
<div class="row">
<table class="table table-bordered table-condensed table-striped col-sm-12">
<thead>
<tr>
<th rowspan="2">Navigateur</th>
<th rowspan="2">Name</th>
<th rowspan="2">Key exchange</th>
<th rowspan="2">Authentification</th>
<th colspan="4">Encryption</th>
<th colspan="2">MAC</th>
<th rowspan="2">PFS</th>
<th rowspan="2"><%= t 'User agent' %></th>
<th rowspan="2"><%= t 'Name' %></th>
<th rowspan="2"><%= t 'Key exchange' %></th>
<th rowspan="2"><%= t 'Authentication' %></th>
<th colspan="4"><%= t 'Encryption' %></th>
<th colspan="2"><%= t 'MAC' %></th>
<th rowspan="2"><%= t 'PFS' %></th>
</tr>
<tr>
<th>Type</th>
<th>Key size</th>
<th>Block size</th>
<th>Mode</th>
<th>Type</th>
<th>Size</th>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Block size' %></th>
<th><%= t 'Mode' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Size' %></th>
</tr>
</thead>
<tbody>
@@ -66,20 +66,20 @@
<table class="table table-bordered table-condensed table-striped center col-sm-12">
<thead>
<tr>
<th rowspan="2">Name</th>
<th rowspan="2">Key exchange</th>
<th rowspan="2">Authentification</th>
<th colspan="4">Encryption</th>
<th colspan="2">MAC</th>
<th rowspan="2">PFS</th>
<th rowspan="2"><%= t 'Name' %></th>
<th rowspan="2"><%= t 'Key exchange' %></th>
<th rowspan="2"><%= t 'Authentication' %></th>
<th colspan="4"><%= t 'Encryption' %></th>
<th colspan="2"><%= t 'MAC' %></th>
<th rowspan="2"><%= t 'PFS' %></th>
</tr>
<tr>
<th>Type</th>
<th>Key size</th>
<th>Block size</th>
<th>Mode</th>
<th>Type</th>
<th>Size</th>
<th><%= t 'Type' %></th>
<th><%= t 'Key size' %></th>
<th><%= t 'Block size' %></th>
<th><%= t 'Mode' %></th>
<th><%= t 'Type' %></th>
<th><%= t 'Size' %></th>
</tr>
</thead>
<tbody>

+ 3
- 2
app/views/site/suite_index.html.erb View File

@@ -1,14 +1,15 @@
<div id="check" class="container">
<div class="row">
<div class="col-sm-12">
<h1>Compatibilités des user agents</h1>
<h1><%= t 'User agent compatibility' %></h1>
<h2><%= t 'Cipher suite' %></h2>
<%= form_tag suite_path do %>
<div class="form-group">
<div class="col-sm-10">
<%= text_field_tag :suite, nil, class: %i(form-control input-lg), placeholder: 'EECDH+AES' %>
</div>
<div class="col-sm-2">
<%= submit_tag 'Test-moi !', class: %i(form-control btn btn-primary input-lg pull-right) %>
<%= submit_tag t('Test me!'), class: %i(form-control btn btn-primary input-lg pull-right) %>
</div>
</div>
<% end %>

+ 2
- 2
app/views/ssh/index.html.erb View File

@@ -1,7 +1,7 @@
<div id="ssh_check" class="container">
<div class="row">
<div class="col-sm-12">
<h1>Vérifier votre serveur SSH</h1>
<h1><%= t 'Check your SSH server' %></h1>
<%= form_tag root_path do %>
<div class="form-group">
<div class="col-sm-8">
@@ -12,7 +12,7 @@
</div>
<div class="col-sm-2">
<%= hidden_field_tag :type, :ssh %>
<%= submit_tag 'Test-moi !', class: %i(form-control btn btn-primary input-lg pull-right) %>
<%= submit_tag t('Test me!'), class: %i(form-control btn btn-primary input-lg pull-right) %>
</div>
</div>
<% end %>

+ 7
- 7
app/views/ssh/show.html.erb View File

@@ -7,7 +7,7 @@
</div>
<% if Time.now - @result.date >= Rails.configuration.refresh_delay %>
<div class="col-sm-1">
<%= link_to 'Rafraîchir', {action: :refresh}, class: %i(btn btn-default) %>
<%= link_to t('Refresh'), {action: :refresh}, class: %i(btn btn-default) %>
</div>
<% end %>
</div>
@@ -19,7 +19,7 @@
<div class="row">
<div class="col-sm-12">
<h2><%= host.name %> - <%= host.ip %> : <%= host.port %></h2>
Error during analysis :
<%= t 'Error during analysis:' %>
<span class="label label-error"><%= error %></span>
</div>
</div>
@@ -37,7 +37,7 @@
<table class="table table-bordered table-condensed table-striped">
<tbody>
<tr>
<th>Échange de clef</th>
<th><%= t 'Key exchange' %></th>
</tr>
<% server.kex.each do |kex| %>
<tr>
@@ -46,7 +46,7 @@
<% end %>

<tr>
<th>Chiffrement</th>
<th><%= t 'Cipher' %></th>
</tr>
<% server.encryption.each do |cipher| %>
<tr>
@@ -55,7 +55,7 @@
<% end %>

<tr>
<th>HMAC</th>
<th><%= t 'HMAC' %></th>
</tr>
<% server.hmac.each do |hmac| %>
<tr>
@@ -64,7 +64,7 @@
<% end %>

<tr>
<th>Compression</th>
<th><%= t 'Compression' %></th>
</tr>
<% server.compression.each do |compression| %>
<tr>
@@ -73,7 +73,7 @@
<% end %>

<tr>
<th>Clefs</th>
<th><%= t 'Keys' %></th>
</tr>
<% server.key_.each do |key| %>
<tr>

+ 2
- 2
app/views/tls/index.html.erb View File

@@ -1,7 +1,7 @@
<div id="tls_check" class="container">
<div class="row">
<div class="col-sm-12">
<h1>Vérifier votre serveur TLS</h1>
<h1><%= t 'Check your TLS server' %></h1>
<%= form_tag root_path do %>
<div class="form-group">
<div class="col-sm-8">
@@ -12,7 +12,7 @@
</div>
<div class="col-sm-2">
<%= hidden_field_tag :type, :tls %>
<%= submit_tag 'Test-moi !', class: %i(form-control btn btn-primary input-lg pull-right) %>
<%= submit_tag t('Test me!'), class: %i(form-control btn btn-primary input-lg pull-right) %>
</div>
</div>
<% end %>

+ 1
- 0
config/application.rb View File

@@ -35,6 +35,7 @@ module CryptcheckRails
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = :fr
config.i18n.available_locales = %w(en fr)
config.action_controller.include_all_helpers = false

config.refresh_delay = 1.hour

+ 43
- 0
config/locales/en.yml View File

@@ -1 +1,44 @@
en:
User agent compatibility: User agent compatibility
Supported ciphers: Supported ciphers
Cipher suite: Cipher suite
"Cipher suite:": "Cipher suite:"

Check your domain: Check your domain
Check your SSH server: Check your SSH server
Check your SMTP server: Check your SMTP server
Test me!: Test me!

Currently analysing %{host}: Currently analysing %{host}
"Start of analysis: %{date}": "Start of analysis: %{date}"
Please waiting…: Please waiting…
This page refreshes automatically every 10 seconds: This page refreshes automatically every 10 seconds

"Error during analysis:": "Error during analysis:"
Refresh: Refresh

Protocol: Protocol
Protocols: Protocols
Keys: Keys
Key exchange: Key exchange
Cipher: Cipher
Overall: Overall
"Certificates:": "Certificats:"
Good practices: Good practices
Warning: Warning
Critical: Critical
Fatal: Fatal

User agent: User agent
Name: Name
Authentication: Authentication
Encryption: Encryption
Compression: Compression
MAC: MAC
HMAC: HMAC
PFS: PFS
Mode: Mode
Type: Type
Key size: Key size
Block size: Block size
Size: Size

+ 44
- 0
config/locales/fr.yml View File

@@ -1,4 +1,48 @@
fr:
User agent compatibility: Compatibilité navigateur
Supported ciphers: Chiffrements supportés
Cipher suite: Suite de chiffrement
"Cipher suite:": "Suite de chiffrement :"

Check your domain: Testez votre domaine
Check your SSH server: Testez votre serveur SSH
Check your TLS server: Testez votre serveur TLS
Test me!: Testez-moi !

Currently analysing %{host}: Analyse en cours de %{host}
"Start of analysis: %{date}": "Début de l’analyse : %{date}"
Please waiting…: Merci de patienter…
This page refreshes automatically every 10 seconds: Cette page se rafraîchit automatiquement toutes les 10 secondes

"Error during analysis:": "Erreur durant l’analyse :"
Refresh: Rafraîchir

Protocol: Protocole
Protocols: Protocoles
Keys: Clefs
Key exchange: Échange de clef
Cipher: Chiffrement
Overall: Global
"Certificates:": "Certificats :"
Good practices: Bonnes pratiques
Warning: Attention
Critical: Critique
Fatal: Fatal

User agent: Navigateur
Name: Nom
Authentication: Authentification
Encryption: Chiffrement
Compression: Compression
MAC: MAC
HMAC: HMAC
PFS: PFS
Mode: Mode
Type: Type
Key size: Taille de clef
Block size: Taille de bloc
Size: Taille

date:
abbr_day_names:
- dim

Loading…
Cancel
Save