Skip to content

Commit

Permalink
Support for R18n
Browse files Browse the repository at this point in the history
Add locales.
Add Setting.default_locale to config file.
Add r18n-core gem.
  • Loading branch information
Robert Mitwicki committed Mar 18, 2013
1 parent 10174fd commit 9a9f2ef
Show file tree
Hide file tree
Showing 14 changed files with 293 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rubycas-server-core.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "logger"
require "r18n-core"
require "rubycas-server-core/core_ext"
require "rubycas-server-core/version"
require "rubycas-server-core/authenticator"
Expand All @@ -18,6 +19,8 @@ module Core
# for available adapters.
def setup(config_file)
Settings.load!(config_file)
R18n.default_places = '../locales'
R18n.set(Settings.default_locale)
Database.setup(Settings.database)
end
end
Expand Down
27 changes: 27 additions & 0 deletions locales/de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
error:
no_login_ticket: "Your login request did not include a login ticket. There may be a problem with the authentication system."
login_ticket_already_used: "The login ticket you provided has already been used up. Please try logging in again."
login_timeout: "You took too long to enter your credentials. Please try again."
invalid_login_ticket: "The login ticket you provided is invalid. There may be a problem with the authentication system."
login_ticket_needs_post_request: "Für die Generierung eines Login-Tickets, ist eine POST-Anfrage erforderlich."
incorrect_username_or_password: "Falscher Benutzername oder Passwort."
invalid_submit_to_uri: "Der CAS-Login-URI konnte nicht erraten werden. Bitte ergänzen Sie Ihre Anfrage um einen submitToURI Parameter."
invalid_target_service: "Das Ziel-Service, welches Ihr Browsers geliefert hat, scheint ungültig zu sein. Bitte wenden Sie sich an Ihren Systemadministrator, um Hilfe zu erhalten."
unable_to_authenticate: "Client und Server sind nicht in der Lage eine Authentifizierung auszuhandeln. Bitte versuchen Sie, sich zu einem späteren Zeitpunkt erneut anzumelden."
no_service_parameter_given: "Der Server kann diese Gateway-Anfrage nicht erfüllen, da keine Service-Parameter übergeben wurden."

notice:
logged_in_as: "Sie sind derzeit angemeldet als '%1'. Sollten dies nicht Sie sein, melden Sie sich bitte unten an."
click_to_continue: "Bitte klicken Sie auf den folgenden Link, um fortzufahren:"
success_logged_out: "Sie haben sich erfolgreich vom Central Authentication Service abgemeldet."
success_logged_in: "Sie haben sich erfolgreich am Central Authentication Service angemeldet."
please_wait: "Bitte warten ..."

label:
username: "Benutzername"
password: "Passwort"
central_login_title: "Zentrales Login"

button:
login: "ANMELDEN"

26 changes: 26 additions & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Your login request did not include a login ticket. There may be a problem with the authentication system."
login_ticket_already_used: "The login ticket you provided has already been used up. Please try logging in again."
login_timeout: "You took too long to enter your credentials. Please try again."
invalid_login_ticket: "The login ticket you provided is invalid. There may be a problem with the authentication system."
login_ticket_needs_post_request: "To generate a login ticket, you must make a POST request."
incorrect_username_or_password: "Incorrect username or password."
invalid_submit_to_uri: "Could not guess the CAS login URI. Please supply a submitToURI parameter with your request."
invalid_target_service: "The target service your browser supplied appears to be invalid. Please contact your system administrator for help."
unable_to_authenticate: "The client and server are unable to negotiate authentication. Please try logging in again later."
no_service_parameter_given: "The server cannot fulfill this gateway request because no service parameter was given."

notice:
logged_in_as: "You are currently logged in as '%1'. If this is not you, please log in below."
click_to_continue: "Please click on the following link to continue:"
success_logged_out: "You have successfully logged out."
success_logged_in: "You have successfully logged in."
please_wait: "Please wait..."

label:
username: "Username"
password: "Password"
central_login_title: "Central Login"

button:
login: "LOGIN"
26 changes: 26 additions & 0 deletions locales/es.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Su pedido de login no incluyó un ticket. Puede que haya un problema con el sistema de autentificación."
login_ticket_already_used: "El ticket de login que ha provisto ya ha sido utilizado. Por favor intente ingresando sus credenciales nuevamente."
login_timeout: "Usted ha tardado mucho en ingresar sus credenciales. Por favor reintente nuevamente."
invalid_login_ticket: "El ticket de login que ha provisto es inválido. Puede que haya un problema con el sistema de autentificación."
login_ticket_needs_post_request: "Para generar un ticket de acceso, usted debe hacer una petición POST."
incorrect_username_or_password: "El email o contraseña ingresados son incorrectos."
invalid_submit_to_uri: "No se ha podido adivinar el URI de acceso al CAS. Suministre un submitToURI como parámetro con su solicitud."
invalid_target_service: "El servicio de destino proporcionado por su navegador parece inválido. Por favor contacte al administrador."
unable_to_authenticate: "El cliente y el servidor no pueden negociar su autentificación. Por favor intente luego."
no_service_parameter_given: "El servidor no puede atender este pedido porque no se especificó el servicio de destino."

notice:
logged_in_as: "Actualmente está logueado como '%1'. Si este no es usted, por favor ingrese sus datos debajo."
click_to_continue: "Por favor, haga click en el siguiente link para continuar:"
success_logged_out: "Ha finalizado correctamente su sesión de usuario."
success_logged_in: "Has ingresado satisfactoreamente."
please_wait: "Por favor aguarde..."

label:
username: "Usuario"
password: "Contraseña"
central_login_title: "Servicio de Autenticación Central"

button:
login: "INICIAR SESIÓN"
26 changes: 26 additions & 0 deletions locales/es_ar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Su pedido de login no incluyó un ticket. Puede que haya un problema con el sistema de autentificación."
login_ticket_already_used: "El ticket de login que ha provisto ya ha sido utilizado. Por favor intente ingresando sus credenciales nuevamente."
login_timeout: "Usted ha tardado mucho en ingresar sus credenciales. Por favor reintente nuevamente."
invalid_login_ticket: "El ticket de login que ha provisto es inválido. Puede que haya un problema con el sistema de autentificación."
login_ticket_needs_post_request: "Para generar un ticket de acceso, usted debe hacer una petición POST."
incorrect_username_or_password: "El email o contraseña ingresados son incorrectos."
invalid_submit_to_uri: "No se ha podido adivinar el URI de acceso al CAS. Suministre un submitToURI como parámetro con su solicitud."
invalid_target_service: "El servicio de destino proporcionado por su navegador parece inválido. Por favor contacte al administrador."
unable_to_authenticate: "El cliente y el servidor no pueden negociar su autentificación. Por favor intente luego."
no_service_parameter_given: "El servidor no puede atender este pedido porque no se especificó el servicio de destino."

notice:
logged_in_as: "Actualmente está logueado como '%1'. Si este no es usted, por favor ingrese sus datos debajo."
click_to_continue: "Por favor, haga click en el siguiente link para continuar:"
success_logged_out: "Ha finalizado correctamente su sesión de usuario."
success_logged_in: "Has ingresado satisfactoreamente."
please_wait: "Por favor aguarde..."

label:
username: "Usuario"
password: "Contraseña"
central_login_title: "Servicio de Autenticación Central"

button:
login: "INICIAR SESIÓN"
26 changes: 26 additions & 0 deletions locales/fr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Votre requête d'identification n'a pas inclus de ticket d'identification. Il se peut qu'il y ait un problème avec le système d'identification."
login_ticket_already_used: "Le ticket d'identification que vous avez fourni a été consommé. Veuillez essayer de vous reconnecter"
login_timeout: "Le délai de saisie de vos login et mot de passe a expiré. Veuillez réessayer."
invalid_login_ticket: "Le ticket d'identification que vous avez fourni n'est pas valide. Il se peut qu'il y ait un problème avec le système d'identification."
login_ticket_needs_post_request: "Pour générer un ticket de connexion, vous devez faire une requête POST."
incorrect_username_or_password: "Les informations transmises n'ont pas permis de vous authentifier"
invalid_submit_to_uri: "Impossible de trouver l'URI de connection de CAS. Veuillez fournir le paramètre submitToURI avec votre requête."
invalid_target_service: "Le service cible que votre navigateur a fourni semble incorrect. Veuillez contacter votre administrateur système pour assistance."
unable_to_authenticate: "Le client et le serveur ne peuvent négocier l'identification. Veuillez réessayer ultérieurement."
no_service_parameter_given: "Le serveur ne peut pas répondre à cette demande (aucun paramètre de service n'a été donné)."

notice:
logged_in_as: "Vous êtes actuellement connecté en tant que '%1'. Si ce n'est pas vous, veuillez vous connecter ci-dessous."
click_to_continue: "S'il vous plaît cliquer sur le lien suivant pour continuer:"
success_logged_out: "Vous vous êtes déconnecté(e) du Service Central d'Identification."
success_logged_in: "Vous vous êtes authentifié(e) auprès du Service Central d'Identification."
please_wait: "Veuillez patienter..."

label:
username: "Identifiant"
password: "Mot de passe"
central_login_title: "Service Central d'Identification."

button:
login: "SE CONNECTER"
26 changes: 26 additions & 0 deletions locales/jp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "ログインリクエストにログインチケットが含まれていません。認証システムに問題があるようです。"
login_ticket_already_used: "ログインチケットはすでに使い切られています。もう一度ログインしてください。"
login_timeout: "クレデンシャルの入力に時間が掛かりすぎました。もう一度試してください。"
invalid_login_ticket: "指定されたログインチケットが無効です。認証システムに問題があるようです。"
login_ticket_needs_post_request: "ログインチケットを発行するには、POSTリクエストを送る必要があります。"
incorrect_username_or_password: "ユーザー名またはパスワードが間違っています"
invalid_submit_to_uri: "CASのURIを推測することができませんでした。リクエストにsubmitToURIパラメータを指定してください。"
invalid_target_service: "ブラウザが示す対象サービスは無効のようです。システム管理者に連絡してください。"
unable_to_authenticate: "クライアントとサーバー間で認証ができませんでした。しばらくしてから再度ログインしてください。"
no_service_parameter_given: "サービスパラメーターが指定されていないので、サーバーはゲートウェイリクエストを満たす事ができません。"

notice:
logged_in_as: "'%1'としてログインしています。違うユーザーでログインするには下に入力してくだ さい。"
click_to_continue: "継続するには、以下のリンクをクリックしてください:"
success_logged_out: "ログアウトしました。"
success_logged_in: "ログインしました"
please_wait: "待つ"

label:
username: "ユーザー名"
password: "パスワード"
central_login_title: "統合ログイン"

button:
login: "ログイン"
26 changes: 26 additions & 0 deletions locales/pl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Twoje żądanie nie zawiera paraametru 'login ticket'. Prawdopodobnie jest to problem systemu autentykacji."
login_ticket_already_used: "Parametr 'login ticket' który przyszedł w żądaniu został już wykorzystany. Proszę spróbować ponownie."
login_timeout: "You took too long to enter your credentials. Please try again."
invalid_login_ticket: "Parametr 'login ticket' który przyszedł w żądaniu jest nieprawidłowy. Prawdopodobnie jest to problem systemu autentykacji."
login_ticket_needs_post_request: "Aby wygenerować parametr 'login ticket', musisz użyć żądania POST"
incorrect_username_or_password: "Niepoprawny użytkownik lub hasło."
invalid_submit_to_uri: "System nie może odgadnąć URI w celu zalogowania się. Proszę w tym celu dostarczyć parametr 'submitToURI'"
invalid_target_service: "Podany parametr 'service' jest nie prawidłowy. Skontaktuj się z administratorem systemu aby uzyskać pomoc."
unable_to_authenticate: "System nie jest wstanie przeprowadzić autentykacji. Proszę spróbować poźniej"
no_service_parameter_given: "System nie może spełnić żądania ponieważ brakuje parametru 'service'."

notice:
logged_in_as: "Jesteś aktualnie zalogowany jako '%1'. Jeżeli to nie jesteś ty, zaloguj się tutaj."
click_to_continue: "Proszę kliknąć na poniższy link, aby kontynuować:"
success_logged_out: "Zostałeś poprawnie zalogowany."
success_logged_in: "Zostałeś poprawnie wylogowany."
please_wait: "Chwileczkę..."

label:
username: "Użytkownik"
password: "Hasło"
central_login_title: "Centralna Usługa Uwierzytelniania"

button:
login: "Zaloguj"
26 changes: 26 additions & 0 deletions locales/pt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Your login request did not include a login ticket. There may be a problem with the authentication system."
login_ticket_already_used: "The login ticket you provided has already been used up. Please try logging in again."
login_timeout: "You took too long to enter your credentials. Please try again."
invalid_login_ticket: "The login ticket you provided is invalid. There may be a problem with the authentication system."
login_ticket_needs_post_request: "Para gerar um ticket de acceso, você deve fazer uma requisição via POST."
incorrect_username_or_password: "Usuário ou Senha está incorreto."
invalid_submit_to_uri: "Não encontramos a URI de acesso ao CAS. Por favor, informe corretamente no submitToURI com sua solicitação."
invalid_target_service: "O seu navegador está aparentemente com problemas. Por favor, contate o administrador do sistema para obter ajuda."
unable_to_authenticate: "O cliente e o servidor não puderam efetuar a autenticação. por favor, tente novamente mais tarde."
no_service_parameter_given: "O servidor não pode completar a solicitação porque não foi enviado o paramêtro do serviço."

notice:
logged_in_as: "Você está logado como '%1'. Se este não for você, Por favor, faça o login a baixo."
click_to_continue: "Por favor, clique no seguinte link para continuar:"
success_logged_out: "Você saiu do sistema com sucesso."
success_logged_in: "Login efetuado com sucesso."
please_wait: "Aguarde ..."

label:
username: "Usuário"
password: "Senha"
central_login_title: "Central de Autenticação"

button:
login: "ENTRAR"
26 changes: 26 additions & 0 deletions locales/ru.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "Your login request did not include a login ticket. There may be a problem with the authentication system."
login_ticket_already_used: "The login ticket you provided has already been used up. Please try logging in again."
login_timeout: "You took too long to enter your credentials. Please try again."
invalid_login_ticket: "The login ticket you provided is invalid. There may be a problem with the authentication system."
login_ticket_needs_post_request: "Чтобы сгенерировать входной билет вы должны делать POST запрос."
incorrect_username_or_password: "Неверное имя пользователя или пароль."
invalid_submit_to_uri: "Невозможно угадать адрес входа на CAS. Пожалуйста, передайте с запросом параметр submitToURI."
invalid_target_service: "Сервис, указанный вашим браузером, неверен. Свяжитесь с вашим системным администратором."
unable_to_authenticate: "Клиент и сервер не могут провести проверку прав. Попробуйте войти позже."
no_service_parameter_given: "Этот сервер не может выполнить этот запрос, поскольку не были указаны праметры сервиса."

notice:
logged_in_as: "Вы авторизированы как '%s'."
click_to_continue: "Перейдите по ссылке чтобы продолжить:"
success_logged_out: "Вы успешно вышли."
success_logged_in: "Вы успешно вошли."
please_wait: "Подождите..."

label:
username: "Логин"
password: "Пароль"
central_login_title: "Центральный вход"

button:
login: "Войти"
26 changes: 26 additions & 0 deletions locales/zh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "你的登录请求没包含登录凭证,这可能是认证系统的问题"
login_ticket_already_used: "你提供的登录凭证已经使用过了,请重新登录"
login_timeout: "你的认证花了太长时间,请重新认证"
invalid_login_ticket: "你所提供的登录凭证是无效的,这可能是认证系统的问题"
login_ticket_needs_post_request: "你必须使用 POST 来产生登录凭证"
incorrect_username_or_password: "错误的帐号或密码"
invalid_submit_to_uri: "无法判断 CAS 的登录地址。请提供 submitToURI 的参数"
invalid_target_service: "你的浏览器提供的网址是无效的,请联系你的系统管理员"
unable_to_authenticate: "现在无法认证,请稍后重试"
no_service_parameter_given: "无法完成网关请求,因为没有提供服务的参数"

notice:
logged_in_as: "你正以 '%1' 的身份登入。如果这不是你,请重新登录"
click_to_continue: "请点击下列连接继续"
success_logged_out: "你成功登出了"
success_logged_in: "你成功登录了"
please_wait: "请稍候..."

label:
username: "用户名"
password: "密码"
central_login_title: "整合登录"

button:
login: "登录"
26 changes: 26 additions & 0 deletions locales/zh_tw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error:
no_login_ticket: "你沒有傳送登入憑証,這可能是認證系統的問題"
login_ticket_already_used: "你所提供的登入憑証已經被使用過了,請重新登入"
login_timeout: "你的認證花了太多時間,請再試一次"
invalid_login_ticket: "你所傳送的登入憑証是無效的,這可能是認證系統的問題"
login_ticket_needs_post_request: "你必須使用 POST 來產生登入憑証"
incorrect_username_or_password: "你所輸入的帳號或是密碼是錯誤的"
invalid_submit_to_uri: "無法判斷 CAS 的登入網址。請提供 submitToURI 的參數"
invalid_target_service: "你的瀏覽器傳送的服務網址是無效的,請向你的系統管理員尋求協助"
unable_to_authenticate: "現在無法認證,請稍候再嘗試登入"
no_service_parameter_given: "無法完成 gateway request 因為沒有提供 service 的參數"

notice:
logged_in_as: "你正以 '%1' 的身分登入。如果這不是你,請重新登入"
click_to_continue: "請點以下的連結繼續"
success_logged_out: "你成功登出了"
success_logged_in: "你成功登入了"
please_wait: "請稍候..."

label:
username: "帳號"
password: "密碼"
central_login_title: "整合登入"

button:
login: "登入"
1 change: 1 addition & 0 deletions rubycas-server-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.add_dependency "r18n-core"
gem.add_development_dependency "rspec"
end
2 changes: 2 additions & 0 deletions spec/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ maximum_unused_service_ticket_lifetime: 300

maximum_session_lifetime: 172800
downcase_username: true

default_locale: en

0 comments on commit 9a9f2ef

Please sign in to comment.