Files
fixin.me/config/locales/en.yml
barbie-bot 0daf413b47 Prevent sole admin from deleting their account
Without this guard, the last admin in the system could delete their own
account, making the application unmanageable. This adds a model method
`User#sole_admin?`, a controller guard in `RegistrationsController#destroy`,
and disables the delete button in the profile edit view when the current
user is the only remaining admin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 06:52:14 +00:00

198 lines
6.2 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
en:
time:
formats:
# Format contains non-breaking space: 160.chr(Encoding::UTF_8)
default: "%Y-%m-%d %H:%M %Z"
without_tz: "%Y-%m-%d %H:%M"
errors:
messages:
precision_exceeded: must not exceed %{value} significant digits
scale_exceeded: must not exceed %{value} decimal digits
activerecord:
attributes:
quantity:
description: Description
name: Name
unit:
base: Base unit
description: Description
multiplier: Multiplier
symbol: Symbol
user:
confirmed_at: Confirmed
created_at: Registered
email: E-mail
status: Status
errors:
models:
unit:
attributes:
base:
multilevel_nesting: has to be a top-level unit
self_reference: of an unit cannot be the unit itself
user_mismatch: has to belong to the same user as unit
multiplier:
equal_to: for a top-level unit has to be 1
symbol:
taken: has to be unique
quantity:
attributes:
name:
taken: has to be unique among siblings
parent:
descendant_reference: cannot be changed to any of descendants
self_reference: of the quantitiy cannot be the quantity itself
user_mismatch: has to belong to the same user as quantity
actioncontroller:
exceptions:
status:
bad_request: >
Server received request it's unable to understand (400 Bad Request).
This should not happen, please notify site administrator.
forbidden: >
You have not been granted access to this action (403 Forbidden).
This should not happen, please notify site administrator.
not_found: >
The record that you requested operation on does not exist (404 Not Found).
This should not happen, please notify site administrator.
unprocessable_entity: >
The request is semantically incorrect and was rejected (422 Unprocessable Entity).
This should not happen, please notify site administrator.
helpers:
label:
user:
password_confirmation: 'Retype new password:'
password_length_hint_html:
count: '%{minimum_password_length}'
zero:
one: <br><em>(%{count} character minimum)</em>
other: <br><em>(%{count} characters minimum)</em>
remember_me: 'Remember me:'
unconfirmed_email_html: >
Awaiting confirmation for:<br><em>(since %{confirmation_sent_at})</em>
submit:
create: Create
update: Update
user:
update: Update profile
layouts:
application:
issue_tracker: Report issue
revert: Revert
sign_out: Sign out
source_code: Get code
measurements:
navigation: Measurements
no_items: There are no measurements taken. You can Add some now.
form:
select_quantity: select the measured quantities...
index:
new_measurement: Add measurement
readouts:
form:
select_unit: ...
quantities:
navigation: Quantities
no_items: There are no configured quantities. You can Add some or Import from defaults.
quantity:
new_subquantity: Child
destroy: Delete
index:
new_quantity: Add quantity
top_level_drop: Drop here to reposition into top-level quantity
create:
success: Created new quantity "%{quantity}"
update:
success: Updated quantity "%{quantity}"
destroy:
success: Deleted quantity "%{quantity}"
units:
navigation: Units
no_items: There are no configured units. You can Add some or Import from defaults.
unit:
new_subunit: Subunit
destroy: Delete
index:
new_unit: Add unit
import_units: Import
top_level_drop: Drop here to reposition into top-level unit
create:
success: Created new unit "%{unit}"
update:
success: Updated unit "%{unit}"
rebase:
multiplier_reset: Multiplier of "%{unit}" has been reset to 1, due to repositioning
destroy:
success: Deleted unit "%{unit}"
default:
units:
no_items: There are no importable defaults or exportable units.
unit:
delete: Delete
export: Export
import: Import
index:
actions: Actions on defaults
back: Back to units
import_all: Import all
no_items: There are no differences between default and user units.
import:
success: Imported unit "%{unit}"
export:
success: Exported unit "%{unit}"
destroy:
success: Deleted unit "%{unit}"
users:
navigation: Users
index:
disguise: View as
passwords:
edit:
password_html: 'New password:%{password_length_hint_html}'
update_password: Update password
registrations:
new:
password_html: 'Password:%{password_length_hint_html}'
password_confirmation: 'Retype password:'
edit:
confirm_delete: Are you sure you want to delete profile?
All data will be irretrievably lost.
delete: Delete profile
password_html: >
New password:
<br><em>leave blank to keep unchanged</em>
%{password_length_hint_html}
registrations:
destroy:
sole_admin: You cannot delete the only admin account.
actions: Actions
setup:
new:
admin_account: Admin account
admin_email: 'E-mail:'
admin_password: 'Password:'
admin_password_confirmation: 'Retype password:'
options: Options
skip_email_confirmation: Skip e-mail confirmation for new registrations
seed_units: Seed built-in default units
submit: Set up
create:
email_blank: E-mail cannot be blank.
password_blank: Password cannot be blank.
password_mismatch: Passwords do not match.
success: >
Installation complete. You can now sign in with the admin account you
just created.
add: Add
apply: Apply
back: Back
cancel: Cancel
delete: Delete
:no: 'no'
or: or
register: Register
sign_in: Sign in
recover_password: Recover password
resend_confirmation: Resend confirmation
update: Update