mooreniemi / Transbucket_Rails

:hospital: → :camera: → :thumbsup:
http://www.transbucket.com
10 stars 4 forks source link

i18n of user flow #85

Closed mooreniemi closed 3 years ago

mooreniemi commented 3 years ago

For our i18n users, translations of the sign up instructions would be really helpful. Ignoring English variants, these are our top other languages, with German being quite a bit more than all the others combined.

5. | de-de 
7. | zh-cn 
8. | fr-ca 
9. | fr-fr 
10. | it-it

Top pages to i18nize:

References:

https://github.com/svenfuchs/rails-i18n

mooreniemi commented 3 years ago

https://github.com/tigrish/devise-i18n maybe?

mooreniemi commented 3 years ago

https://github.com/iain/http_accept_language

mooreniemi commented 3 years ago

All mailers are done, and I think all views. Need to change the feature tests to use the different elements.

mooreniemi commented 3 years ago

Devise gave me basically everything except explanatory text on login...

mooreniemi commented 3 years ago

Note: upgrading devise generates a lot of errors as it was major version bump, so not doing that now.

mooreniemi commented 3 years ago

Problem: for some reason somewhere devise is generating the wrong locale path...

wrong_path

It's actually here:

main development » I18n.t("devise.failure.not_found_in_database")
=> "Invalid email or password."
mooreniemi commented 3 years ago

I would need to override the controller I think to fix this...

mooreniemi commented 3 years ago

I did bundle open on devise and hopped into lib/devise/failure_app.rb:

#<Devise::FailureApp:0x0056148c071718> development » I18n.t("devise.failure")
=> {:already_authenticated=>"您已經登入。",
 :inactive=>"您的帳號尚未被啟用。",
 :invalid=>nil,
 :last_attempt=>"您還有最後一次嘗試機會,再次失敗您的帳號將會被鎖定。",
 :locked=>"您的帳號已被鎖定。",
 :not_found_in_database=>nil,
 :timeout=>"您的登入時效過期,請重新登入。",
 :unauthenticated=>"您需要先登入或註冊後才能繼續。",
 :unconfirmed=>"您的帳號需要經過驗證後,才能繼續。"}
#<Devise::FailureApp:0x0056148c071718> development » I18n.t("devise.failure")
mooreniemi commented 3 years ago

Ok this translation is somehow literally missing in this version. It's not an overall bug.

mooreniemi commented 3 years ago

Note for later. Current method works ok for some users but won't help foreign language SEO.

https://searchengineland.com/are-your-language-detection-methods-blocking-search-engine-crawlers-30341#:~:text=Your%20web%20server%20simply%20looks,that%20contains%20that%20language%20code.&text=Because%20crawlers%20do%20not%20send,default%E2%80%9D%20language%20of%20the%20server.

mooreniemi commented 3 years ago

This is about set: https://github.com/mooreniemi/Transbucket_Rails/pull/100