From cbd673601c5f762d71f65404c3b7ad5b3751ee8c Mon Sep 17 00:00:00 2001 From: Koala Yeung Date: Mon, 8 May 2017 21:56:00 +0800 Subject: [PATCH] Add Thai langauge (#2903) * Updated Thai language * locale: remove unused translation in Thai * locale: add Thai to settings menu and application * locale: fix activerecord.th.yml format --- app/helpers/settings_helper.rb | 1 + .../user_mailer/password_change.th.html.erb | 3 + .../user_mailer/password_change.th.text.erb | 3 + .../reset_password_instructions.th.html.erb | 8 ++ .../reset_password_instructions.th.text.erb | 8 ++ config/application.rb | 1 + config/locales/activerecord.th.yml | 13 ++ config/locales/devise.th.yml | 61 ++++++++++ config/locales/doorkeeper.th.yml | 113 ++++++++++++++++++ config/locales/simple_form.th.yml | 53 ++++++++ config/locales/th.yml | 6 +- 11 files changed, 268 insertions(+), 2 deletions(-) create mode 100644 app/views/user_mailer/password_change.th.html.erb create mode 100644 app/views/user_mailer/password_change.th.text.erb create mode 100644 app/views/user_mailer/reset_password_instructions.th.html.erb create mode 100644 app/views/user_mailer/reset_password_instructions.th.text.erb create mode 100644 config/locales/activerecord.th.yml create mode 100644 config/locales/devise.th.yml create mode 100644 config/locales/doorkeeper.th.yml create mode 100644 config/locales/simple_form.th.yml diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index aff4c8a195..2f8b923e4b 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -25,6 +25,7 @@ module SettingsHelper pt: 'Português', 'pt-BR': 'Português do Brasil', ru: 'Русский', + th: 'ภาษาไทย', tr: 'Türkçe', uk: 'Українська', 'zh-CN': '简体中文', diff --git a/app/views/user_mailer/password_change.th.html.erb b/app/views/user_mailer/password_change.th.html.erb new file mode 100644 index 0000000000..948b1508a9 --- /dev/null +++ b/app/views/user_mailer/password_change.th.html.erb @@ -0,0 +1,3 @@ +

สวัสดี <%= @resource.email %>!

+ +

เราติดต่อเข้ามาเพื่อจะแจ้งให้คุณทราบว่าพาสเวิร์ด Mastodon เปลี่ยนแล้ว

diff --git a/app/views/user_mailer/password_change.th.text.erb b/app/views/user_mailer/password_change.th.text.erb new file mode 100644 index 0000000000..0d28a207cc --- /dev/null +++ b/app/views/user_mailer/password_change.th.text.erb @@ -0,0 +1,3 @@ +สวัสดี <%= @resource.email %>! + +เราติดต่อมาเพื่อแจ้งให้คุณทราบว่า พาสเวิร์ดของคุณถูกเปลี่ยนแล้ว diff --git a/app/views/user_mailer/reset_password_instructions.th.html.erb b/app/views/user_mailer/reset_password_instructions.th.html.erb new file mode 100644 index 0000000000..1fe1c27256 --- /dev/null +++ b/app/views/user_mailer/reset_password_instructions.th.html.erb @@ -0,0 +1,8 @@ +

สวัสดี <%= @resource.email %>!

+ +

มีการแจ้งขอลิงค์เปลี่ยนแปลงพาสเวิร์ดเข้า Mastodon ของคุณ. คุณสามารถแก้ไขพาสเวิร์ดได้ผ่านทางลิงค์ด้านล่างนี้.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

ถ้าคุณไม่ได้เป็นคนขอลิงค์นี้, กรุณาข้ามเมล์นี้ไป.

+

พาร์สเวิร์ดของคุณจะยังไม่ถูกเปลี่ยนจนกว่าคุณจะเข้าไปในลิงค์ด้านบนนี้เพื่อสร้างพาสเวิร์ดใหม่.

diff --git a/app/views/user_mailer/reset_password_instructions.th.text.erb b/app/views/user_mailer/reset_password_instructions.th.text.erb new file mode 100644 index 0000000000..fe73b0165c --- /dev/null +++ b/app/views/user_mailer/reset_password_instructions.th.text.erb @@ -0,0 +1,8 @@ +Hello <%= @resource.email %>! + +Someone has requested a link to change your password on Mastodon. You can do this through the link below. + +<%= edit_password_url(@resource, reset_password_token: @token) %> + +If you didn't request this, please ignore this email. +Your password won't change until you access the link above and create a new one. diff --git a/config/application.rb b/config/application.rb index 5e6a59283f..070cccaa58 100644 --- a/config/application.rb +++ b/config/application.rb @@ -49,6 +49,7 @@ module Mastodon :pt, :'pt-BR', :ru, + :th, :tr, :uk, :'zh-CN', diff --git a/config/locales/activerecord.th.yml b/config/locales/activerecord.th.yml new file mode 100644 index 0000000000..2a41f4bce5 --- /dev/null +++ b/config/locales/activerecord.th.yml @@ -0,0 +1,13 @@ +--- +th: + activerecord: + errors: + models: + account: + attributes: + username: + invalid: only letters, numbers and underscores + status: + attributes: + reblog: + taken: of status already exists diff --git a/config/locales/devise.th.yml b/config/locales/devise.th.yml new file mode 100644 index 0000000000..fec944310c --- /dev/null +++ b/config/locales/devise.th.yml @@ -0,0 +1,61 @@ +--- +th: + 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. + last_attempt: You have one more attempt before your account is locked. + locked: 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: 'Mastodon: Confirmation instructions for %{instance}' + password_change: + subject: 'Mastodon: Password changed' + reset_password_instructions: + subject: 'Mastodon: Reset password instructions' + unlock_instructions: + subject: 'Mastodon: Unlock instructions' + 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: If your email address exists in our database, you will receive a password recovery link at your email address 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: + already_signed_out: Signed out successfully. + signed_in: Signed in successfully. + 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:" diff --git a/config/locales/doorkeeper.th.yml b/config/locales/doorkeeper.th.yml new file mode 100644 index 0000000000..29673971be --- /dev/null +++ b/config/locales/doorkeeper.th.yml @@ -0,0 +1,113 @@ +--- +th: + activerecord: + attributes: + doorkeeper/application: + name: ชื่อ + redirect_uri: เปลี่ยนเส้นทาง URI + errors: + models: + doorkeeper/application: + attributes: + redirect_uri: + fragment_present: cannot contain a fragment. + invalid_uri: ต้องใช้ URI ที่ถูกต้อง. + relative_uri: ต้องเป็น absolute URI. + secured_uri: ต้องใช้ HTTPS/SSL URI. + doorkeeper: + applications: + buttons: + authorize: Authorize + cancel: ยกเลิก + destroy: ทำลาย + edit: แก้ไข + submit: Submit + confirmations: + destroy: แน่ใจนะ? + edit: + title: แก้ไข แอ๊ฟพลิเคชั่น + form: + error: Whoops! Check your form for possible errors + help: + native_redirect_uri: ใช้ %{native_redirect_uri} สำหรับการทดสอบ + redirect_uri: ใช้บรรทัดละหนึ่ง URI + scopes: Separate scopes with spaces. Leave blank to use the default scopes. + index: + callback_url: Callback URL + name: ชื่อ + new: New Application + title: Your applications + new: + title: New Application + show: + actions: Actions + application_id: Application Id + callback_urls: Callback urls + scopes: Scopes + secret: Secret + title: 'Application: %{name}' + authorizations: + buttons: + authorize: อนุญาติ + deny: ไม่อนุญาติ + error: + title: An error has occurred + new: + able_to: It will be able to + prompt: Application %{client_name} requests access to your account + title: Authorization required + show: + title: Authorization code + authorized_applications: + buttons: + revoke: ยกเลิกการอนุญาติ + confirmations: + revoke: Are you sure? + index: + application: Application + created_at: Authorized + date_format: "%Y-%m-%d %H:%M:%S" + scopes: Scopes + title: Your authorized applications + errors: + messages: + access_denied: The resource owner or authorization server denied the request. + credential_flow_not_configured: Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured. + invalid_client: Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method. + invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. + invalid_redirect_uri: The redirect uri included is not valid. + invalid_request: The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed. + invalid_resource_owner: The provided resource owner credentials are not valid, or resource owner cannot be found + invalid_scope: The requested scope is invalid, unknown, or malformed. + invalid_token: + expired: The access token expired + revoked: The access token was revoked + unknown: The access token is invalid + resource_owner_authenticator_not_configured: Resource Owner find failed due to Doorkeeper.configure.resource_owner_authenticator being unconfiged. + server_error: The authorization server encountered an unexpected condition which prevented it from fulfilling the request. + temporarily_unavailable: The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server. + unauthorized_client: The client is not authorized to perform this request using this method. + unsupported_grant_type: The authorization grant type is not supported by the authorization server. + unsupported_response_type: The authorization server does not support this response type. + flash: + applications: + create: + notice: Application created. + destroy: + notice: Application deleted. + update: + notice: Application updated. + authorized_applications: + destroy: + notice: Application revoked. + layouts: + admin: + nav: + applications: Applications + oauth2_provider: OAuth2 Provider + application: + title: OAuth authorization required + scopes: + follow: follow, block, unblock and unfollow accounts + read: read your account's data + write: post on your behalf diff --git a/config/locales/simple_form.th.yml b/config/locales/simple_form.th.yml new file mode 100644 index 0000000000..22d6e870f1 --- /dev/null +++ b/config/locales/simple_form.th.yml @@ -0,0 +1,53 @@ +--- +th: + simple_form: + hints: + defaults: + avatar: PNG, GIF or JPG. At most 2MB. Will be downscaled to 120x120px + display_name: '%{counter} characters left' + header: PNG, GIF or JPG. At most 2MB. Will be downscaled to 700x335px + locked: Requires you to manually approve followers and defaults post privacy to followers-only + note: '%{counter} characters left' + imports: + data: CSV file exported from another Mastodon instance + sessions: + otp: Enter the Two-factor code from your phone or use one of your recovery codes. + user: + allowed_languages: These languages will be allowed in your public timelines. Languages that are not selected will be filtered out. + labels: + defaults: + avatar: Avatar + confirm_new_password: Confirm new password + confirm_password: Confirm password + current_password: Current password + data: ข้อมูล + display_name: Display name + email: E-mail address + header: Header + locale: ภาษา + locked: Lock account + new_password: New password + note: Bio + otp_attempt: Two-factor code + password: พาร์สเวิร์ด + setting_auto_play_gif: Auto-play animated GIFs + setting_boost_modal: Show confirmation dialog before boosting + setting_default_privacy: Post privacy + severity: Severity + type: Import type + username: Username + interactions: + must_be_follower: Block notifications from non-followers + must_be_following: Block notifications from people you don't follow + notification_emails: + digest: Send digest e-mails + favourite: Send e-mail when someone favourites your status + follow: Send e-mail when someone follows you + follow_request: Send e-mail when someone requests to follow you + mention: Send e-mail when someone mentions you + reblog: Send e-mail when someone boosts your status + 'no': 'ไม่' + required: + mark: "*" + text: required + 'yes': 'ใช่' diff --git a/config/locales/th.yml b/config/locales/th.yml index 5383b31ab9..d29a26faac 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -48,12 +48,13 @@ th: name: "%{account_name} สร้างโน๊ต." outbox: name: "%{account_name}'s Outbox" - summary: "รวมกิจกรรมของผู้ใช้ %{account_name}." + summary: รวมกิจกรรมของผู้ใช้ %{account_name}. admin: accounts: are_you_sure: แน่ใจนะ? confirm: ยืนยัน confirmed: ยึนยันแล้ว + disable_two_factor_authentication: Disable 2FA display_name: ชื่อสำหรับดีสเพล domain: โดแมน edit: แก้ไข @@ -118,7 +119,7 @@ th: show: affected_accounts: one: มีผลต่อหนึ่งแอคเค๊าท์ในฐานข้อมูล - other: "มีผลต่อแอคเค๊าท์ในฐานข้อมูลจำนวน %{count}" + other: มีผลต่อแอคเค๊าท์ในฐานข้อมูลจำนวน %{count} retroactive: silence: ยกเลิกการปิดเสียงทุกแอคเค๊าท์จากโดเมน suspend: ยกเลิกการหยุดทุกแอคเค๊าท์จากโดเมน @@ -221,6 +222,7 @@ th: '422': content: การตรวจสอบความปลอดภัยล้มเหลว. คุณกำลังบล๊อกคุกกี้อยู่? title: การตรวจสอบความปลอดภัยล้มเหลว + '429': Throttled exports: blocks: คุณบล๊อก csv: CSV