about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-01-07 13:30:52 -0600
committerDavid Yip <yipdw@member.fsf.org>2018-01-07 13:30:52 -0600
commitf7c4d4464ba3b3729d707c54c4d2aa7515a9fe57 (patch)
treeb9dff90611207ec3dd075ca73fac32896dbab292
parent70c99a9f34b645baa65982dfec5351869c1924fe (diff)
parentc2e1bfd9ae3f5fe65c4918a37143d48a2cc12bb3 (diff)
Merge remote-tracking branch 'personal/merge/tootsuite/master' into gs-master
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/javascript/mastodon/locales/zh-CN.json6
-rw-r--r--app/views/user_mailer/email_changed.zh-cn.html.erb13
-rw-r--r--app/views/user_mailer/email_changed.zh-cn.text.erb11
-rw-r--r--app/views/user_mailer/reconfirmation_instructions.zh-cn.html.erb13
-rw-r--r--app/views/user_mailer/reconfirmation_instructions.zh-cn.text.erb10
-rw-r--r--config/locales/devise.zh-CN.yml12
-rw-r--r--config/locales/zh-CN.yml6
-rw-r--r--spec/controllers/application_controller_spec.rb20
-rw-r--r--spec/rails_helper.rb2
10 files changed, 73 insertions, 22 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f997e9569..276c6b012 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -31,7 +31,7 @@ class ApplicationController < ActionController::Base
   private
 
   def https_enabled?
-    Rails.env.production? && ENV['LOCAL_HTTPS'] == 'true'
+    Rails.env.production?
   end
 
   def store_current_location
diff --git a/app/javascript/mastodon/locales/zh-CN.json b/app/javascript/mastodon/locales/zh-CN.json
index ce16dcd8e..ef850256c 100644
--- a/app/javascript/mastodon/locales/zh-CN.json
+++ b/app/javascript/mastodon/locales/zh-CN.json
@@ -50,7 +50,7 @@
   "column_header.unpin": "取消固定",
   "column_subheading.navigation": "导航",
   "column_subheading.settings": "设置",
-  "compose_form.hashtag_warning": "This toot won't be listed under any hashtag as it is unlisted. Only public toots can be searched by hashtag.",
+  "compose_form.hashtag_warning": "这条嘟文被设置为“不公开”,因此它不会出现在任何话题标签的列表下。只有公开的嘟文才能通过话题标签进行搜索。",
   "compose_form.lock_disclaimer": "你的帐户没有{locked}。任何人都可以在关注你后立即查看仅关注者可见的嘟文。",
   "compose_form.lock_disclaimer.lock": "开启保护",
   "compose_form.placeholder": "在想啥?",
@@ -214,7 +214,7 @@
   "search_popout.tips.user": "用户",
   "search_results.total": "共 {count, number} 个结果",
   "standalone.public_title": "大家都在干啥?",
-  "status.block": "Block @{name}",
+  "status.block": "屏蔽 @{name}",
   "status.cannot_reblog": "无法转嘟这条嘟文",
   "status.delete": "删除",
   "status.embed": "嵌入",
@@ -223,7 +223,7 @@
   "status.media_hidden": "隐藏媒体内容",
   "status.mention": "提及 @{name}",
   "status.more": "更多",
-  "status.mute": "Mute @{name}",
+  "status.mute": "隐藏 @{name}",
   "status.mute_conversation": "隐藏此对话",
   "status.open": "展开嘟文",
   "status.pin": "在个人资料页面置顶",
diff --git a/app/views/user_mailer/email_changed.zh-cn.html.erb b/app/views/user_mailer/email_changed.zh-cn.html.erb
new file mode 100644
index 000000000..74b1b6150
--- /dev/null
+++ b/app/views/user_mailer/email_changed.zh-cn.html.erb
@@ -0,0 +1,13 @@
+<p><%= @resource.email %>,你好呀!</p>
+
+<% if @resource&.unconfirmed_email? %>
+  <p>我们发送这封邮件是为了提醒你,你在 <%= @instance %> 上使用的电子邮件地址即将变更为 <%= @resource.unconfirmed_email %>。</p>
+<% else %>
+  <p>我们发送这封邮件是为了提醒你,你在 <%= @instance %> 上使用的电子邮件地址已经变更为 <%= @resource.unconfirmed_email %>。</p>
+<% end %>
+
+<p>
+  如果你并没有请求更改你的电子邮件地址,则他人很有可能已经入侵你的帐户。请立即更改你的密码;如果你已经无法访问你的帐户,请联系实例的管理员请求协助。
+</p>
+
+<p>来自 <%= @instance %> 管理团队</p>
diff --git a/app/views/user_mailer/email_changed.zh-cn.text.erb b/app/views/user_mailer/email_changed.zh-cn.text.erb
new file mode 100644
index 000000000..d59ac58c4
--- /dev/null
+++ b/app/views/user_mailer/email_changed.zh-cn.text.erb
@@ -0,0 +1,11 @@
+<%= @resource.email %>,你好呀!
+
+<% if @resource&.unconfirmed_email? %>
+我们发送这封邮件是为了提醒你,你在 <%= @instance %> 上使用的电子邮件地址即将变更为 <%= @resource.unconfirmed_email %>。
+<% else %>
+我们发送这封邮件是为了提醒你,你在 <%= @instance %> 上使用的电子邮件地址已经变更为 <%= @resource.unconfirmed_email %>。
+<% end %>
+
+如果你并没有请求更改你的电子邮件地址,则他人很有可能已经入侵你的帐户。请立即更改你的密码;如果你已经无法访问你的帐户,请联系实例的管理员请求协助。
+
+来自 <%= @instance %> 管理团队
diff --git a/app/views/user_mailer/reconfirmation_instructions.zh-cn.html.erb b/app/views/user_mailer/reconfirmation_instructions.zh-cn.html.erb
new file mode 100644
index 000000000..7b79a490e
--- /dev/null
+++ b/app/views/user_mailer/reconfirmation_instructions.zh-cn.html.erb
@@ -0,0 +1,13 @@
+<p><%= @resource.email %>,你好呀!</p>
+
+<p>你正在更改你在 <%= @instance %> 使用的电子邮件地址。</p>
+
+<p>点击下面的链接以确认操作:<br>
+<%= link_to '确认我的电子邮件地址', confirmation_url(@resource, confirmation_token: @token) %></p>
+
+<p>上面的链接按不动?把下面的链接复制到地址栏再试试:<br>
+<span><%= confirmation_url(@resource, confirmation_token: @token) %></span>
+
+<p>记得读一读我们的<%= link_to '使用条款', terms_url %>哦。</p>
+
+<p>来自 <%= @instance %> 管理团队</p>
diff --git a/app/views/user_mailer/reconfirmation_instructions.zh-cn.text.erb b/app/views/user_mailer/reconfirmation_instructions.zh-cn.text.erb
new file mode 100644
index 000000000..977d78137
--- /dev/null
+++ b/app/views/user_mailer/reconfirmation_instructions.zh-cn.text.erb
@@ -0,0 +1,10 @@
+<%= @resource.email %>,你好呀!
+
+你正在更改你在 <%= @instance %> 使用的电子邮件地址。
+
+点击下面的链接以确认操作:
+<%= confirmation_url(@resource, confirmation_token: @token) %>
+
+记得读一读我们的使用条款哦:<%= terms_url %>
+
+来自 <%= @instance %> 管理团队
diff --git a/config/locales/devise.zh-CN.yml b/config/locales/devise.zh-CN.yml
index 5560e12b3..0bd855137 100644
--- a/config/locales/devise.zh-CN.yml
+++ b/config/locales/devise.zh-CN.yml
@@ -17,15 +17,17 @@ zh-CN:
       unconfirmed: 继续操作前请先确认你的帐户。
     mailer:
       confirmation_instructions:
-        subject: Mastodon 帐户确认信息
+        subject: Mastodon:确认 %{instance} 帐户信息
       email_changed:
-        subject: Mastodon 电子邮件地址已被修改
+        subject: Mastodon:电子邮件地址已被修改
       password_change:
-        subject: Mastodon 密码已被重置
+        subject: Mastodon:密码已被重置
+      reconfirmation_instructions:
+        subject: Mastodon:确认 %{instance} 电子邮件地址
       reset_password_instructions:
-        subject: Mastodon 重置密码信息
+        subject: Mastodon:重置密码信息
       unlock_instructions:
-        subject: Mastodon 帐户解锁信息
+        subject: Mastodon:帐户解锁信息
     omniauth_callbacks:
       failure: 由于%{reason},无法从%{kind}获得授权。
       success: 成功地从%{kind}获得授权。
diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml
index e1909ac71..bb9f45e93 100644
--- a/config/locales/zh-CN.yml
+++ b/config/locales/zh-CN.yml
@@ -263,12 +263,18 @@ zh-CN:
       unresolved: 未处理
       view: 查看
     settings:
+      activity_api_enabled:
+        desc_html: 本站用户发布的嘟文数,以及本站的活跃用户数和一周内新用户数
+        title: 公开用户活跃度的统计数据
       bootstrap_timeline_accounts:
         desc_html: 用半角逗号分隔多个用户名。只能添加来自本站且未开启保护的帐户。如果留空,则默认关注本站所有的管理员。
         title: 新用户默认关注
       contact_information:
         email: 用于联系的公开电子邮件地址
         username: 用于联系的公开用户名
+      peers_api_enabled:
+        desc_html: 截至目前本实例在网络中已发现的域名
+        title: 公开已知实例的列表
       registrations:
         closed_message:
           desc_html: 本站关闭注册期间的提示信息。可以使用 HTML 标签
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 6a54a78c5..51c0e3c70 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -47,22 +47,18 @@ describe ApplicationController, type: :controller do
     include_examples 'respond_with_error', 422
   end
 
-  it "does not force ssl if LOCAL_HTTPS is not 'true'" do
+  it "does not force ssl if Rails.env.production? is not 'true'" do
     routes.draw { get 'success' => 'anonymous#success' }
-    ClimateControl.modify LOCAL_HTTPS: '' do
-      allow(Rails.env).to receive(:production?).and_return(true)
-      get 'success'
-      expect(response).to have_http_status(:success)
-    end
+    allow(Rails.env).to receive(:production?).and_return(false)
+    get 'success'
+    expect(response).to have_http_status(:success)
   end
 
-  it "forces ssl if LOCAL_HTTPS is 'true'" do
+  it "forces ssl if Rails.env.production? is 'true'" do
     routes.draw { get 'success' => 'anonymous#success' }
-    ClimateControl.modify LOCAL_HTTPS: 'true' do
-      allow(Rails.env).to receive(:production?).and_return(true)
-      get 'success'
-      expect(response).to redirect_to('https://test.host/success')
-    end
+    allow(Rails.env).to receive(:production?).and_return(true)
+    get 'success'
+    expect(response).to redirect_to('https://test.host/success')
   end
 
   describe 'helper_method :current_account' do
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 67c6b9205..4f7399505 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -46,7 +46,7 @@ RSpec.configure do |config|
   config.include ActiveSupport::Testing::TimeHelpers
 
   config.before :each, type: :feature do
-    https = Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'
+    https = ENV['LOCAL_HTTPS'] == 'true'
     Capybara.app_host = "http#{https ? 's' : ''}://#{ENV.fetch('LOCAL_DOMAIN')}"
   end