rodauth-i18n 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ca239979b32a8e406b1763945b5e9cc5f0eb2f806df1725b82067aa655e4818b
4
+ data.tar.gz: 2bf9f5bd61fedd012269deea89b977a160b2b13299d825ccb7df6408e6c7fb4e
5
+ SHA512:
6
+ metadata.gz: ac9be630282bd3c016b7df99d0f5cf8ee86f327a7640748fa29fe4a4a87614a785133ab93589185231a717cc2cbe2f41ed281578451552c32a5a9c20cb06966f
7
+ data.tar.gz: 32a4c1f74ac1fcbc5baf09198bb3178f6392bdd0b846fcf64c759bd5356d820670648d873f9446a9547734784abd9edd1688465058f62f9bf867cbdeb93adb6d
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-10-07
4
+
5
+ - Initial release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Janko Marohnić
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,145 @@
1
+ # rodauth-i18n
2
+
3
+ Provides [I18n] integration for [Rodauth] authentication framework. It also includes built-in translations, which you are welcome to extend.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem "rodauth-i18n"
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```sh
16
+ $ bundle install
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```sh
22
+ $ gem install rodauth-i18n
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Enable the `i18n` feature in your Rodauth configuration:
28
+
29
+ ```rb
30
+ plugin :rodauth do
31
+ enable :i18n
32
+ # ...
33
+ end
34
+ ```
35
+
36
+ If you're using Rails, the built-in translations will be automatically loaded based on your configured available locales. Otherwise, you need to manually add them to I18n's load path before translations have been loaded:
37
+
38
+ ```rb
39
+ require "rodauth/i18n"
40
+
41
+ # adds built-in locale files to I18n's load path
42
+ Rodauth::I18n.add
43
+ ```
44
+
45
+ See the [Rails Internationalization Guide] on how to set the locale.
46
+
47
+ ### Per configuration translations
48
+
49
+ If you want to translate differently for different Rodauth configurations, you can define translations under the namespace matching the configuration name:
50
+
51
+ ```rb
52
+ plugin :rodauth, name: :admin do
53
+ enable :i18n
54
+ # ...
55
+ end
56
+ ```
57
+ ```yml
58
+ en:
59
+ rodauth:
60
+ admin:
61
+ create_account_button: Create Admin Account
62
+ ```
63
+
64
+ You can change the translation namespace via the `i18n_namespace` setting:
65
+
66
+ ```rb
67
+ plugin :rodauth, name: :superadmin do
68
+ enable :i18n
69
+ i18n_namespace "admin"
70
+ end
71
+ ```
72
+
73
+ Any translations that are not found under the configuration namespace will fall back to top-level. If you want to disable this behaviour, you can do so via the `i18n_cascade?` setting:
74
+
75
+ ```rb
76
+ i18n_cascade? false
77
+ ```
78
+
79
+ ### Copying translations
80
+
81
+ In Rails, you can copy built-in translations into your app via the `rodauth:i18n:translations` generator, which receives a list of locales to copy translations for:
82
+
83
+ ```sh
84
+ $ rails generate rodauth:i18n:translations en hr
85
+ # create config/locales/rodauth.en.yml
86
+ # create config/locales/rodauth.hr.yml
87
+ ```
88
+
89
+ Alternatively, you can copy the translation files directly from the `locales/` directory.
90
+
91
+ ### Raising on missing translations
92
+
93
+ You can tell I18n to raise an error when a translation is missing:
94
+
95
+ ```rb
96
+ i18n_raise_on_missing_translations? { Rails.env.test? }
97
+ ```
98
+
99
+ ### Falling back to untranslated value
100
+
101
+ In some cases it can be useful to fall back to untranslated value when the translation is missing:
102
+
103
+ ```rb
104
+ i18n_fallback_to_untranslated? { Rails.env.production? }
105
+ ```
106
+
107
+ ### Overriding current locale
108
+
109
+ The current locale defaults to `I18n.locale`, but you can override that:
110
+
111
+ ```rb
112
+ i18n_locale :en
113
+ ```
114
+
115
+ ### Custom I18n options
116
+
117
+ You can pass any custom options to the `I18n.translate` method via `i18n_options`:
118
+
119
+ ```rb
120
+ i18n_options { { exception_handler: -> (*args) { ... } } }
121
+ ```
122
+
123
+ ## Development
124
+
125
+ Run tests with Rake:
126
+
127
+ ```sh
128
+ $ bundle exec rake test
129
+ ```
130
+
131
+ ## Contributing
132
+
133
+ Bug reports and pull requests are welcome on GitHub at https://github.com/janko/rodauth-i18n. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/janko/rodauth-i18n/blob/master/CODE_OF_CONDUCT.md).
134
+
135
+ ## License
136
+
137
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
138
+
139
+ ## Code of Conduct
140
+
141
+ Everyone interacting in the rodauth-i18n project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/janko/rodauth-i18n/blob/master/CODE_OF_CONDUCT.md).
142
+
143
+ [I18n]: https://github.com/ruby-i18n/i18n
144
+ [Rodauth]: https://github.com/jeremyevans/rodauth
145
+ [Rails Internationalization Guide]: https://guides.rubyonrails.org/i18n.html
@@ -0,0 +1,17 @@
1
+ require "rails/generators/base"
2
+
3
+ module Rodauth
4
+ module I18n
5
+ class TranslationsGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path("#{__dir__}/../../../../locales")
7
+
8
+ argument :locales, type: :array, desc: "List of locales to copy translation files for"
9
+
10
+ def copy_locales
11
+ locales.each do |locale|
12
+ copy_file("#{locale}.yml", "config/locales/rodauth.#{locale}.yml")
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ require "rodauth/i18n/feature"
@@ -0,0 +1,65 @@
1
+ require "rodauth/i18n/login_password_requirements_base"
2
+ require "i18n"
3
+
4
+ module Rodauth
5
+ Feature.define(:i18n) do
6
+ include Rodauth::I18n::LoginPasswordRequirementsBase
7
+
8
+ auth_value_method :i18n_cascade?, true
9
+ auth_value_method :i18n_raise_on_missing_translations?, false
10
+ auth_value_method :i18n_fallback_to_untranslated?, false
11
+ auth_value_method :i18n_options, {}
12
+
13
+ auth_value_methods(
14
+ :i18n_namespace,
15
+ )
16
+
17
+ auth_methods(
18
+ :i18n_locale,
19
+ )
20
+
21
+ def translate(name, default)
22
+ i18n_translate(name, default)
23
+ end
24
+
25
+ def i18n_locale
26
+ ::I18n.locale
27
+ end
28
+
29
+ private
30
+
31
+ def i18n_translate(name, default, **options)
32
+ ::I18n.translate(i18n_translation_key(name),
33
+ scope: i18n_scope,
34
+ locale: i18n_locale,
35
+ raise: i18n_raise_on_missing_translations?,
36
+ default: i18n_default(name, default),
37
+ **i18n_options,
38
+ **options
39
+ )
40
+ end
41
+
42
+ def i18n_translation_key(name)
43
+ [*i18n_namespace, name].join(".")
44
+ end
45
+
46
+ def i18n_default(name, fallback)
47
+ default = []
48
+ default << name if i18n_namespace && i18n_cascade?
49
+ default << fallback if i18n_fallback_to_untranslated? && !i18n_raise_on_missing_translations?
50
+ default
51
+ end
52
+
53
+ def i18n_namespace
54
+ self.class.configuration_name
55
+ end
56
+
57
+ def i18n_scope
58
+ "rodauth"
59
+ end
60
+ end
61
+
62
+ # Assign feature and feature configuration to constants for introspection.
63
+ I18n::Feature = FEATURES[:i18n]
64
+ I18n::FeatureConfiguration = FEATURES[:i18n].configuration
65
+ end
@@ -0,0 +1,40 @@
1
+ module Rodauth
2
+ module I18n
3
+ # Dynamic translations for the login_password_requirements_base feature.
4
+ module LoginPasswordRequirementsBase
5
+ def self.included(feature)
6
+ feature.depends :login_password_requirements_base
7
+ end
8
+
9
+ def login_confirm_label
10
+ i18n_translate(__method__, super, login_label: login_label)
11
+ end
12
+
13
+ def password_confirm_label
14
+ i18n_translate(__method__, super, password_label: password_label)
15
+ end
16
+
17
+ private
18
+
19
+ def password_does_not_meet_requirements_message
20
+ i18n_translate(__method__, super) + "#{" (#{password_requirement_message})" if password_requirement_message}"
21
+ end
22
+
23
+ def password_too_short_message
24
+ i18n_translate(__method__, super, password_minimum_length: password_minimum_length)
25
+ end
26
+
27
+ def login_does_not_meet_requirements_message
28
+ i18n_translate(__method__, super) + "#{" (#{login_requirement_message})" if login_requirement_message}"
29
+ end
30
+
31
+ def login_too_long_message
32
+ i18n_translate(__method__, super, login_maximum_length: login_maximum_length)
33
+ end
34
+
35
+ def login_too_short_message
36
+ i18n_translate(__method__, super, login_minimum_length: login_minimum_length)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails"
4
+
5
+ module Rodauth
6
+ module I18n
7
+ class Railtie < ::Rails::Railtie
8
+ initializer "rodauth.i18n" do
9
+ Rodauth::I18n.add
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "i18n"
4
+ require "rodauth/i18n/railtie" if defined?(Rails)
5
+
6
+ module Rodauth
7
+ module I18n
8
+ def self.add(locales = nil)
9
+ ::I18n.load_path.concat files(locales)
10
+ end
11
+
12
+ def self.files(locales = nil)
13
+ directory_pattern = "{#{directories.join(",")}}"
14
+
15
+ if ::I18n.available_locales_initialized?
16
+ locales ||= ::I18n.available_locales
17
+ file_pattern = "{#{locales.join(",")}}"
18
+ else
19
+ file_pattern = "*"
20
+ end
21
+
22
+ Dir["#{directory_pattern}/#{file_pattern}.yml"]
23
+ end
24
+
25
+ def self.directories
26
+ @directories ||= [File.expand_path("#{__dir__}/../../locales")]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rodauth/i18n"
data/locales/en.yml ADDED
@@ -0,0 +1,244 @@
1
+ en:
2
+ rodauth:
3
+ account_expiration_error_flash: You cannot log into this account as it has expired
4
+ active_sessions_error_flash: This session has been logged out
5
+ add_recovery_codes_button: Add Authentication Recovery Codes
6
+ add_recovery_codes_error_flash: Unable to add recovery codes
7
+ add_recovery_codes_heading: "<h2>Add Additional Recovery Codes</h2>"
8
+ add_recovery_codes_page_title: Authentication Recovery Codes
9
+ already_an_account_with_this_login_message: already an account with this login
10
+ attempt_to_create_unverified_account_error_flash: The account you tried to create is currently awaiting verification
11
+ attempt_to_login_to_unverified_account_error_flash: The account you tried to login with is currently awaiting verification
12
+ change_login_button: Change Login
13
+ change_login_error_flash: There was an error changing your login
14
+ change_login_needs_verification_notice_flash: An email has been sent to you with a link to verify your login change
15
+ change_login_notice_flash: Your login has been changed
16
+ change_login_page_title: Change Login
17
+ change_password_button: Change Password
18
+ change_password_error_flash: There was an error changing your password
19
+ change_password_notice_flash: Your password has been changed
20
+ change_password_page_title: Change Password
21
+ close_account_button: Close Account
22
+ close_account_error_flash: There was an error closing your account
23
+ close_account_notice_flash: Your account has been closed
24
+ close_account_page_title: Close Account
25
+ confirm_password_button: Confirm Password
26
+ confirm_password_error_flash: There was an error confirming your password
27
+ confirm_password_link_text: Enter Password
28
+ confirm_password_notice_flash: Your password has been confirmed
29
+ confirm_password_page_title: Confirm Password
30
+ contains_null_byte_message: contains null byte
31
+ create_account_button: Create Account
32
+ create_account_error_flash: There was an error creating your account
33
+ create_account_link_text: Create a New Account
34
+ create_account_notice_flash: Your account has been created
35
+ create_account_page_title: Create Account
36
+ email_auth_email_recently_sent_error_flash: An email has recently been sent to you with a link to login
37
+ email_auth_email_sent_notice_flash: An email has been sent to you with a link to login to your account
38
+ email_auth_email_subject: Login Link
39
+ email_auth_error_flash: There was an error logging you in
40
+ email_auth_page_title: Login
41
+ email_auth_request_button: Send Login Link Via Email
42
+ email_auth_request_error_flash: There was an error requesting an email link to authenticate
43
+ email_subject_prefix: ''
44
+ expired_jwt_access_token_message: expired JWT access token
45
+ global_logout_label: Logout all Logged In Sessons?
46
+ input_field_label_suffix: ''
47
+ invalid_jwt_format_error_message: invalid JWT format or claim in Authorization header
48
+ invalid_password_message: invalid password
49
+ invalid_recovery_code_error_flash: Error authenticating via recovery code
50
+ invalid_recovery_code_message: Invalid recovery code
51
+ json_non_post_error_message: non-POST method used in JSON API
52
+ json_not_accepted_error_message: Unsupported Accept header. Must accept "application/json" or compatible content type
53
+ jwt_refresh_invalid_token_message: invalid JWT refresh token
54
+ jwt_refresh_without_access_token_message: no JWT access token provided during refresh
55
+ login_button: Login
56
+ login_confirm_label: Confirm %{login_label}
57
+ login_does_not_meet_requirements_message: invalid login, does not meet requirements
58
+ login_error_flash: There was an error logging in
59
+ login_form_footer_links_heading: <h2 class="rodauth-login-form-footer-links-heading">Other Options</h2>
60
+ login_label: Login
61
+ login_lockout_error_flash: This account is currently locked out and cannot be logged in to
62
+ login_not_valid_email_message: not a valid email address
63
+ login_notice_flash: You have been logged in
64
+ login_page_title: Login
65
+ login_too_long_message: maximum %{login_maximum_length} characters
66
+ login_too_short_message: minimum %{login_minimum_length} characters
67
+ logins_do_not_match_message: logins do not match
68
+ logout_button: Logout
69
+ logout_notice_flash: You have been logged out
70
+ logout_page_title: Logout
71
+ multi_phase_login_page_title: Login
72
+ need_password_notice_flash: Login recognized, please enter your password
73
+ new_password_label: New Password
74
+ no_current_sms_code_error_flash: No current SMS code for this account
75
+ no_matching_email_auth_key_error_flash: 'There was an error logging you in: invalid email authentication key'
76
+ no_matching_login_message: no matching login
77
+ no_matching_reset_password_key_error_flash: 'There was an error resetting your password: invalid or expired password reset key'
78
+ no_matching_unlock_account_key_error_flash: 'There was an error unlocking your account: invalid or expired unlock account key'
79
+ no_matching_verify_account_key_error_flash: 'There was an error verifying your account: invalid verify account key'
80
+ no_matching_verify_login_change_key_error_flash: 'There was an error verifying your login change: invalid verify login change key'
81
+ non_json_request_error_message: Only JSON format requests are allowed
82
+ otp_already_setup_error_flash: You have already setup TOTP authentication
83
+ otp_auth_button: Authenticate Using TOTP
84
+ otp_auth_error_flash: Error logging in via TOTP authentication
85
+ otp_auth_form_footer: ''
86
+ otp_auth_label: Authentication Code
87
+ otp_auth_link_text: Authenticate Using TOTP
88
+ otp_auth_page_title: Enter Authentication Code
89
+ otp_disable_button: Disable TOTP Authentication
90
+ otp_disable_error_flash: Error disabling TOTP authentication
91
+ otp_disable_link_text: Disable TOTP Authentication
92
+ otp_disable_notice_flash: TOTP authentication has been disabled
93
+ otp_disable_page_title: Disable TOTP Authentication
94
+ otp_invalid_auth_code_message: Invalid authentication code
95
+ otp_invalid_secret_message: invalid secret
96
+ otp_lockout_error_flash: TOTP authentication code use locked out due to numerous failures
97
+ otp_provisioning_uri_label: Provisioning URL
98
+ otp_secret_label: Secret
99
+ otp_setup_button: Setup TOTP Authentication
100
+ otp_setup_error_flash: Error setting up TOTP authentication
101
+ otp_setup_link_text: Setup TOTP Authentication
102
+ otp_setup_notice_flash: TOTP authentication is now setup
103
+ otp_setup_page_title: Setup TOTP Authentication
104
+ password_authentication_required_error_flash: You need to confirm your password before continuing
105
+ password_changed_email_subject: Password Changed
106
+ password_confirm_label: Confirm %{password_label}
107
+ password_does_not_meet_requirements_message: invalid password, does not meet requirements
108
+ password_expiration_error_flash: Your password has expired and needs to be changed
109
+ password_in_dictionary_message: is a word in a dictionary
110
+ password_invalid_pattern_message: includes common character sequence
111
+ password_is_one_of_the_most_common_message: is one of the most common passwords
112
+ password_label: Password
113
+ password_not_changeable_yet_error_flash: Your password cannot be changed yet
114
+ password_not_enough_character_groups_message: does not include uppercase letters, lowercase letters, and numbers
115
+ password_same_as_previous_password_message: same as previous password
116
+ password_too_many_repeating_characters_message: contains too many of the same character in a row
117
+ password_too_short_message: minimum %{password_minimum_length} characters
118
+ passwords_do_not_match_message: passwords do not match
119
+ recovery_auth_button: Authenticate via Recovery Code
120
+ recovery_auth_link_text: Authenticate Using Recovery Code
121
+ recovery_auth_page_title: Enter Authentication Recovery Code
122
+ recovery_codes_added_notice_flash: Additional authentication recovery codes have been added
123
+ recovery_codes_label: Recovery Code
124
+ recovery_codes_link_text: View Authentication Recovery Codes
125
+ recovery_codes_page_title: View Authentication Recovery Codes
126
+ remember_button: Change Remember Setting
127
+ remember_disable_label: Disable Remember Me
128
+ remember_error_flash: There was an error updating your remember setting
129
+ remember_forget_label: Forget Me
130
+ remember_notice_flash: Your remember setting has been updated
131
+ remember_page_title: Change Remember Setting
132
+ remember_remember_label: Remember Me
133
+ require_login_error_flash: Please login to continue
134
+ resend_verify_account_page_title: Resend Verification Email
135
+ reset_password_button: Reset Password
136
+ reset_password_email_recently_sent_error_flash: An email has recently been sent to you with a link to reset your password
137
+ reset_password_email_sent_notice_flash: An email has been sent to you with a link to reset the password for your account
138
+ reset_password_email_subject: Reset Password
139
+ reset_password_error_flash: There was an error resetting your password
140
+ reset_password_explanatory_text: "<p>If you have forgotten your password, you can request a password reset:</p>"
141
+ reset_password_notice_flash: Your password has been reset
142
+ reset_password_page_title: Reset Password
143
+ reset_password_request_button: Request Password Reset
144
+ reset_password_request_error_flash: There was an error requesting a password reset
145
+ reset_password_request_link_text: Forgot Password?
146
+ reset_password_request_page_title: Request Password Reset
147
+ same_as_current_login_message: same as current login
148
+ same_as_existing_password_message: invalid password, same as current password
149
+ session_expiration_error_flash: This session has expired, please login again
150
+ single_session_error_flash: This session has been logged out as another session has become active
151
+ sms_already_setup_error_flash: SMS authentication has already been setup
152
+ sms_auth_button: Authenticate via SMS Code
153
+ sms_auth_link_text: Authenticate Using SMS Code
154
+ sms_auth_page_title: Authenticate via SMS Code
155
+ sms_code_label: SMS Code
156
+ sms_confirm_button: Confirm SMS Backup Number
157
+ sms_confirm_notice_flash: SMS authentication has been setup
158
+ sms_confirm_page_title: Confirm SMS Backup Number
159
+ sms_disable_button: Disable Backup SMS Authentication
160
+ sms_disable_error_flash: Error disabling SMS authentication
161
+ sms_disable_link_text: Disable SMS Authentication
162
+ sms_disable_notice_flash: SMS authentication has been disabled
163
+ sms_disable_page_title: Disable Backup SMS Authentication
164
+ sms_invalid_code_error_flash: Error authenticating via SMS code
165
+ sms_invalid_code_message: invalid SMS code
166
+ sms_invalid_confirmation_code_error_flash: Invalid or out of date SMS confirmation code used, must setup SMS authentication again
167
+ sms_invalid_phone_message: invalid SMS phone number
168
+ sms_lockout_error_flash: SMS authentication has been locked out
169
+ sms_needs_confirmation_error_flash: SMS authentication needs confirmation
170
+ sms_not_setup_error_flash: SMS authentication has not been setup yet
171
+ sms_phone_label: Phone Number
172
+ sms_request_button: Send SMS Code
173
+ sms_request_notice_flash: SMS authentication code has been sent
174
+ sms_request_page_title: Send SMS Code
175
+ sms_setup_button: Setup SMS Backup Number
176
+ sms_setup_error_flash: Error setting up SMS authentication
177
+ sms_setup_link_text: Setup Backup SMS Authentication
178
+ sms_setup_page_title: Setup SMS Backup Number
179
+ two_factor_already_authenticated_error_flash: You have already been multifactor authenticated
180
+ two_factor_auth_notice_flash: You have been multifactor authenticated
181
+ two_factor_auth_page_title: Authenticate Using Additional Factor
182
+ two_factor_disable_button: Remove All Multifactor Authentication Methods
183
+ two_factor_disable_error_flash: Unable to remove all multifactor authentication methods
184
+ two_factor_disable_link_text: Remove All Multifactor Authentication Methods
185
+ two_factor_disable_notice_flash: All multifactor authentication methods have been disabled
186
+ two_factor_disable_page_title: Remove All Multifactor Authentication Methods
187
+ two_factor_manage_page_title: Manage Multifactor Authentication
188
+ two_factor_need_authentication_error_flash: You need to authenticate via an additional factor before continuing
189
+ two_factor_not_setup_error_flash: This account has not been setup for multifactor authentication
190
+ two_factor_remove_heading: "<h2>Remove Multifactor Authentication</h2>"
191
+ two_factor_setup_heading: "<h2>Setup Multifactor Authentication</h2>"
192
+ unlock_account_button: Unlock Account
193
+ unlock_account_email_recently_sent_error_flash: An email has recently been sent to you with a link to unlock the account
194
+ unlock_account_email_subject: Unlock Account
195
+ unlock_account_error_flash: There was an error unlocking your account
196
+ unlock_account_explanatory_text: "<p>This account is currently locked out. You can unlock the account:</p>"
197
+ unlock_account_notice_flash: Your account has been unlocked
198
+ unlock_account_page_title: Unlock Account
199
+ unlock_account_request_button: Request Account Unlock
200
+ unlock_account_request_explanatory_text: "<p>This account is currently locked out. You can request that the account be unlocked:</p>"
201
+ unlock_account_request_notice_flash: An email has been sent to you with a link to unlock your account
202
+ unlock_account_request_page_title: Request Account Unlock
203
+ unverified_account_message: unverified account, please verify account before logging in
204
+ unverified_change_login_error_flash: Please verify this account before changing the login
205
+ verify_account_button: Verify Account
206
+ verify_account_email_recently_sent_error_flash: An email has recently been sent to you with a link to verify your account
207
+ verify_account_email_sent_notice_flash: An email has been sent to you with a link to verify your account
208
+ verify_account_email_subject: Verify Account
209
+ verify_account_error_flash: Unable to verify account
210
+ verify_account_notice_flash: Your account has been verified
211
+ verify_account_page_title: Verify Account
212
+ verify_account_resend_button: Send Verification Email Again
213
+ verify_account_resend_error_flash: Unable to resend verify account email
214
+ verify_account_resend_explanatory_text: "<p>If you no longer have the email to verify the account, you can request that it be resent to you:</p>"
215
+ verify_account_resend_link_text: Resend Verify Account Information
216
+ verify_login_change_button: Verify Login Change
217
+ verify_login_change_duplicate_account_error_flash: Unable to change login as there is already an account with the new login
218
+ verify_login_change_email_subject: Verify Login Change
219
+ verify_login_change_error_flash: Unable to verify login change
220
+ verify_login_change_notice_flash: Your login change has been verified
221
+ verify_login_change_page_title: Verify Login Change
222
+ view_recovery_codes_button: View Authentication Recovery Codes
223
+ view_recovery_codes_error_flash: Unable to view recovery codes
224
+ webauthn_auth_button: Authenticate Using WebAuthn
225
+ webauthn_auth_error_flash: Error authenticating using WebAuthn
226
+ webauthn_auth_link_text: Authenticate Using WebAuthn
227
+ webauthn_auth_page_title: Authenticate Using WebAuthn
228
+ webauthn_duplicate_webauthn_id_message: attempt to insert duplicate webauthn id
229
+ webauthn_invalid_auth_param_message: invalid webauthn authentication param
230
+ webauthn_invalid_remove_param_message: must select valid webauthn authenticator to remove
231
+ webauthn_invalid_setup_param_message: invalid webauthn setup param
232
+ webauthn_invalid_sign_count_message: webauthn credential has invalid sign count
233
+ webauthn_login_error_flash: There was an error authenticating via WebAuthn
234
+ webauthn_not_setup_error_flash: This account has not been setup for WebAuthn authentication
235
+ webauthn_remove_button: Remove WebAuthn Authenticator
236
+ webauthn_remove_error_flash: Error removing WebAuthn authenticator
237
+ webauthn_remove_link_text: Remove WebAuthn Authenticator
238
+ webauthn_remove_notice_flash: WebAuthn authenticator has been removed
239
+ webauthn_remove_page_title: Remove WebAuthn Authenticator
240
+ webauthn_setup_button: Setup WebAuthn Authentication
241
+ webauthn_setup_error_flash: Error setting up WebAuthn authentication
242
+ webauthn_setup_link_text: Setup WebAuthn Authentication
243
+ webauthn_setup_notice_flash: WebAuthn authentication is now setup
244
+ webauthn_setup_page_title: Setup WebAuthn Authentication
data/locales/hr.yml ADDED
@@ -0,0 +1,29 @@
1
+ hr:
2
+ rodauth:
3
+ account_expiration_error_flash: Nije se moguće prijaviti u ovaj račun jer je istekao
4
+ active_sessions_error_flash: Ova sesija je bila odjavljena
5
+ add_recovery_codes_button: Dodaj rezervne autentikacijske kodove
6
+ add_recovery_codes_error_flash: Nije moguće dodati rezervne kodove
7
+ add_recovery_codes_heading: "<h2>Dodavanje novih rezervnih kodova</h2>"
8
+ add_recovery_codes_page_title: Rezervni autentikacijski kodovi
9
+ already_an_account_with_this_login_message: već postoji račun s ovom email adresom
10
+ attempt_to_create_unverified_account_error_flash: Račun koji ste pokušali stvoriti trenutno čeka na potvrdu
11
+ attempt_to_login_to_unverified_account_error_flash: Račun u kojeg ste se pokušali prijaviti trenutno čeka na potvrdu
12
+ change_login_button: Promijeni email adresu
13
+ change_login_error_flash: Bila je greška pri mijenjanju email adrese
14
+ change_login_needs_verification_notice_flash: Email vam je bio poslan s linkom na potvrdu promjene email adrese
15
+ change_login_notice_flash: Vaša email adresa je bila promijenjena
16
+ change_login_page_title: Promjena email adrese
17
+ create_account_button: Stvori korisnički račun
18
+ create_account_notice_flash: Vaš korisnički račun je stvoren
19
+ create_account_page_title: Registracija
20
+ login_confirm_label: Potvrda email adrese
21
+ login_does_not_meet_requirements_message: neispravna email adresa, ne ispunjava uvjete
22
+ login_label: Email adresa
23
+ login_too_long_message: najviše %{login_maximum_length} znakova
24
+ login_too_short_message: najmanje %{login_minimum_length} znakova
25
+ password_confirm_label: Potvrda lozinke
26
+ password_does_not_meet_requirements_message: neispravna lozinka, ne ispunjava uvjete
27
+ password_label: Lozinka
28
+ password_too_short_message: najmanje %{password_minimum_length} znakova
29
+ # ...
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "rodauth-i18n"
5
+ spec.version = "0.1.0"
6
+ spec.authors = ["Janko Marohnić"]
7
+ spec.email = ["janko@hey.com"]
8
+
9
+ spec.summary = "Provides I18n integration and translations for Rodauth authentication framework."
10
+ spec.homepage = "https://github.com/janko/rodauth-i18n"
11
+ spec.license = "MIT"
12
+
13
+ spec.required_ruby_version = ">= 2.3.0"
14
+
15
+ spec.files = Dir["README.md", "LICENSE.txt", "CHANGELOG.md", "lib/**/*", "locales/**/*", "*.gemspec"]
16
+ spec.require_paths = ["lib"]
17
+
18
+ spec.add_dependency "rodauth", "~> 2.0"
19
+ spec.add_dependency "i18n", "~> 1.0"
20
+
21
+ spec.add_development_dependency "minitest"
22
+ spec.add_development_dependency "minitest-hooks"
23
+ spec.add_development_dependency "capybara"
24
+ spec.add_development_dependency "sqlite3"
25
+ spec.add_development_dependency "tilt"
26
+ spec.add_development_dependency "bcrypt"
27
+ end
metadata ADDED
@@ -0,0 +1,168 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rodauth-i18n
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Janko Marohnić
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rodauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: i18n
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-hooks
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: capybara
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: tilt
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: bcrypt
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
126
+ email:
127
+ - janko@hey.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - CHANGELOG.md
133
+ - LICENSE.txt
134
+ - README.md
135
+ - lib/generators/rodauth/i18n/translations_generator.rb
136
+ - lib/rodauth-i18n.rb
137
+ - lib/rodauth/features/i18n.rb
138
+ - lib/rodauth/i18n.rb
139
+ - lib/rodauth/i18n/feature.rb
140
+ - lib/rodauth/i18n/login_password_requirements_base.rb
141
+ - lib/rodauth/i18n/railtie.rb
142
+ - locales/en.yml
143
+ - locales/hr.yml
144
+ - rodauth-i18n.gemspec
145
+ homepage: https://github.com/janko/rodauth-i18n
146
+ licenses:
147
+ - MIT
148
+ metadata: {}
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: 2.3.0
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ requirements: []
164
+ rubygems_version: 3.2.15
165
+ signing_key:
166
+ specification_version: 4
167
+ summary: Provides I18n integration and translations for Rodauth authentication framework.
168
+ test_files: []