Commit cf355bee authored by Yamagishi Kazutoshi's avatar Yamagishi Kazutoshi

Add Japanese Translations

parent 16b074d5
......@@ -15,12 +15,14 @@ gem 'bootsnap'
gem 'mastodon-api', require: 'mastodon', git: 'https://github.com/tootsuite/mastodon-api'
gem 'twitter', git: 'https://github.com/sferik/twitter'
gem 'devise', '~> 4.4'
gem 'devise-i18n', '~> 1.6'
gem 'omniauth-twitter'
gem 'omniauth-mastodon', '>= 0.9.2'
gem 'hamlit-rails'
gem 'fast_blank', '~> 1.0'
gem 'dotenv-rails', '~> 2.2'
gem 'http'
gem 'http_accept_language', '~> 2.1'
gem 'httplog', '~> 0.99'
gem 'hiredis', '~> 0.6'
gem 'redis', '~> 3.3', require: ['redis', 'redis/connection/hiredis']
......
......@@ -103,6 +103,8 @@ GEM
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
devise-i18n (1.6.2)
devise (>= 4.4)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.4.0)
......@@ -139,6 +141,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (2.1.1)
http_accept_language (2.1.1)
http_parser.rb (0.6.0)
httplog (0.99.7)
colorize
......@@ -349,12 +352,14 @@ DEPENDENCIES
binding_of_caller (~> 0.7)
bootsnap
devise (~> 4.4)
devise-i18n (~> 1.6)
dotenv-rails (~> 2.2)
fast_blank (~> 1.0)
font-awesome-rails
hamlit-rails
hiredis (~> 0.6)
http
http_accept_language (~> 2.1)
httplog (~> 0.99)
jquery-rails
listen (~> 3.0.5)
......
......@@ -3,6 +3,8 @@
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :set_locale
def after_sign_in_path_for(user)
if user.twitter.nil?
root_path
......@@ -10,4 +12,10 @@ class ApplicationController < ActionController::Base
friends_path
end
end
private
def set_locale
I18n.locale = http_accept_language.compatible_language_from(I18n.available_locales)
end
end
.page-heading
%h3
Connections
%small Manage your connected accounts
= t('.heading.title')
%small= t('.heading.description')
%ul.connections
- @authorizations.each do |authorization|
......@@ -15,4 +15,4 @@
.connection-info
%strong= authorization.display_name.presence || authorization.uid
= fa_icon 'check'
= link_to 'Disconnect', authorization_path(authorization), method: :delete, class: 'connection-disconnect-link'
= link_to t('.disconnect'), authorization_path(authorization), method: :delete, class: 'connection-disconnect-link'
.page-heading
%h3
Find your friends on Mastodon
%small Login via Twitter to get started
= t('.heading.title')
%small= t('.heading.description')
%iframe.hero-link{ width: 600, height: 337, src: "https://www.youtube-nocookie.com/embed/IPSbNdBmWKE?rel=0&showinfo=0", frameborder: 0, allow: "autoplay; encrypted-media", allowfullscreen: true }
......@@ -11,26 +11,25 @@
.login-content
.login-numbers
%strong= number_with_delimiter @twitter_count
connected
= t('.connected')
- if twitter?
.login-name
%strong= current_user.twitter.display_name.presence || current_user.twitter.uid
= fa_icon 'check'
- else
%span.login-btn Connect Twitter
%span.login-btn= t('.connect_twitter')
= content_tag mastodon? ? :div : :a, href: user_mastodon_omniauth_authorize_path, class: 'mastodon' do
.login-brand= image_tag 'logo.svg', alt: 'Mastodon'
.login-content
.login-numbers
%strong= number_with_delimiter @mastodon_count
connected
= t('.connected')
- if mastodon?
.login-name
%strong= current_user.mastodon.display_name.presence || current_user.mastodon.uid
= fa_icon 'check'
- else
%span.login-btn Connect Mastodon
%span.login-btn= t('.connect_mastodon')
%p
This website uses a database of Twitter users and Mastodon users who signed in here to match them together across multiple Mastodon instances. Are your friends among them?
%p= t('.description')
......@@ -2,7 +2,7 @@
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title Find your Twitter friends on Mastodon - Mastodon Bridge
%title= t('.title')
= csrf_meta_tags
= stylesheet_link_tag 'application', media: 'all'
......@@ -28,11 +28,11 @@
%ul.right
- if twitter?
%li= link_to 'Friends', friends_path
%li= link_to t('.friends'), friends_path
- if user_signed_in?
%li= link_to 'Account', account_path
%li= link_to 'Logout', destroy_user_session_path, method: :delete
%li= link_to t('.account'), account_path
%li= link_to t('.logout'), destroy_user_session_path, method: :delete
- if flash[:notice]
.flash-message
......@@ -47,11 +47,4 @@
%hr/
%p.footer
This website is run by
%a{:href => "https://mastodon.social/@Mastodon"} @Mastodon@mastodon.social
\/
= succeed "." do
%a{:href => "https://twitter.com/MastodonProject"} @MastodonProject
%br/
%a{:href => "https://source.joinmastodon.org/mastodon/bridge", :target => "_blank"} Source code
%p.footer= t('.footer_html')
......@@ -22,6 +22,10 @@ module MastodonBridge
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# 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.available_locales = [:en, :ja]
config.active_job.queue_adapter = :sidekiq
end
end
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
en:
devise:
confirmations:
confirmed: "Your email address has been successfully confirmed."
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
failure:
already_authenticated: "You are already signed in."
inactive: "Your account is not activated yet."
invalid: "Invalid %{authentication_keys} or password."
locked: "Your account is locked."
last_attempt: "You have one more attempt before your account is locked."
not_found_in_database: "Invalid %{authentication_keys} or password."
timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your email address before continuing."
mailer:
confirmation_instructions:
subject: "Confirmation instructions"
reset_password_instructions:
subject: "Reset password instructions"
unlock_instructions:
subject: "Unlock instructions"
password_change:
subject: "Password Changed"
omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account."
passwords:
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
updated: "Your password has been changed successfully. You are now signed in."
updated_not_active: "Your password has been changed successfully."
registrations:
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully."
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
updated: "Your account has been updated successfully."
sessions:
signed_in: "Signed in successfully."
signed_out: "Signed out successfully."
already_signed_out: "Signed out successfully."
unlocks:
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
errors:
messages:
already_confirmed: "was already confirmed, please try signing in"
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
expired: "has expired, please request a new one"
not_found: "not found"
not_locked: "was not locked"
not_saved:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t 'hello'
#
# In views, this is aliased to just `t`:
#
# <%= t('hello') %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html.
---
en:
hello: "Hello world"
accounts:
show:
disconnect: Disconnect
heading:
description: Manage your connected accounts
title: Connections
home:
index:
connect_mastodon: Connect Mastodon
connect_twitter: Connect Twitter
connected: connected
description: This website uses a database of Twitter users and Mastodon users who signed in here to match them together across multiple Mastodon instances. Are your friends among them?
heading:
description: Login via Twitter to get started
title: Find your friends on Mastodon
layouts:
application:
account: Account
footer_html: |
This website is run by <a href="https://mastodon.social/@Mastodon" target="_blank">@Mastodon@mastodon.social</a> / <a href="https://twitter.com/MastodonProject" target="_blank">@MastodonProject</a>.<br />
<a href="https://source.joinmastodon.org/mastodon/bridge" target="_blank">Source code</a>
friends: Friends
logout: Logout
title: Find your Twitter friends on Mastodon - Mastodon Bridge
---
ja:
accounts:
show:
disconnect: 切断
heading:
description: 接続されたアカウントを管理する
title: 接続中
home:
index:
connect_mastodon: Mastodonに接続
connect_twitter: Twitterに接続
connected: 件接続中
description: このウェブサイトに登録したTwitterユーザーとMastodonユーザーのデータベースを使って複数のMastodonインスタンス間でそれらを一致させます。あなたの友だちはその中にいますか?
heading:
description: Twitterでログインして始める
title: Mastodonの友だちを探す
layouts:
application:
account: アカウント
footer_html: |
このウェブサイトは<a href="https://mastodon.social/@Mastodon" target="_blank">@Mastodon@mastodon.social</a> / <a href="https://twitter.com/MastodonProject" target="_blank">@MastodonProject</a>によって運営されています。<br />
<a href="https://source.joinmastodon.org/mastodon/bridge" target="_blank">ソースコード</a>
friends: 友だち
logout: ログアウト
title: MastodonであなたのTwitterの友だちを探す - Mastodon Bridge
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment