Skip to content

fix(esx_property): match the notification keys the code actually asks for - #133

Open
seltonmt012 wants to merge 1 commit into
esx-framework:1.14.1from
seltonmt012:fix/property-locale-keys
Open

fix(esx_property): match the notification keys the code actually asks for#133
seltonmt012 wants to merge 1 commit into
esx-framework:1.14.1from
seltonmt012:fix/property-locale-keys

Conversation

@seltonmt012

Copy link
Copy Markdown
Contributor

Description

Three notifications in esx_property resolve to Translation [xx][key] does not exist. The strings exist, they are just filed under a different name than the code asks for.


Motivation

Furniture deletion. client/furniture.lua:313,316 asks for delete_confirm and delete_error. Only es and fr ship those names. The other six locales carry the same two strings as deleted_confirm and deleted_error, which nothing reads. On an English server, deleting a piece of furniture shows the error text as a green success message, and failing to delete shows it in red. English is the default from GetConvar('esx:locale', 'en'), so this is the majority case.

Forced save. server/main.lua:1206 asks for forced_save. Every locale ships force_save. The ForceSaveProperties export exists to record which resource triggered the save, and that record is the error string instead of the resource name.


Implementation Details

The two halves are fixed from opposite ends, on purpose.

For the delete keys I renamed the data in the six locale files instead of changing the call site. es and fr are the only locales that work today, and changing the call site to deleted_* would break them. In the six other files deleted_* is unread data, so renaming it cannot break a server that works right now.

For forced_save I changed the call site, because that name exists in no locale at all while force_save exists in all eight. One line, no data touched.

Only the key names change. Every translated string is left exactly as it was.

Verified by running the real Translate from es_extended/locale.lua against the shipped locale files:

call site before after
delete_confirm (furniture.lua:313) Translation [en][delete_confirm] does not exist Deleting ~b~Chair~s~!
delete_error (furniture.lua:316) Translation [en][delete_error] does not exist Cannot Delete ~b~Chair~s~!
force_save (main.lua:1206) Translation [en][forced_save] does not exist Force Save (Requested By esx_property)

All eight locales answer both delete keys now; before, two did.


Usage Example

-- with esx:locale set to en, delete a piece of furniture
-- before: green notification reading "Translation [en][delete_confirm] does not exist"
-- after:  green notification reading "Deleting Chair!"

PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

One thing worth flagging: a server running a customised locale file will still miss the renamed keys until it merges this change. That is true of any key rename, and the alternative direction would have broken es and fr, which work today.

… for

Three notifications resolved to "Translation [xx][key] does not exist".

furniture.lua asks for delete_confirm and delete_error. Only es and fr ship
those names, the other six locales carry the same two strings as
deleted_confirm and deleted_error, which nothing reads. Deleting a piece of
furniture on an English server therefore printed the error text as a green
success message. Renamed the dead keys in the six files rather than changing
the call site, because es and fr are the only locales that work today and
renaming data nothing reads cannot break a running server.

server/main.lua asks for forced_save while every locale ships force_save, so
the forced save in the ForceSaveProperties export logged the error text
instead of naming the resource that triggered it. Fixed at the call site,
since forced_save exists in no locale at all.

Verified by driving the real Translate against the shipped locale files: all
eight locales answer both delete keys now, and force_save resolves to
"Force Save (Requested By esx_property)".
@seltonmt012
seltonmt012 force-pushed the fix/property-locale-keys branch from dbc68a8 to 1f960cf Compare August 8, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant