Locale System
All user-facing strings are centralized in shared/locale.lua. The locale table is sent to the React UI via the LanguageProvider on shop open.
How It Works
Lua Side
All strings are defined in the Language table in shared/locale.lua:
lua
Language = {
search = "Search",
confirm = "Confirm",
shoppingBasket = "Shopping Basket",
totalPrice = "Total Price",
-- ...200+ keys
}
React/NUI Side
The language table is sent to the UI via NUI message and consumed by the LanguageProvider context. Components access translations through the provider.
String Categories
The locale file contains approximately 200+ keys organized by feature:
- General UI: search, add, confirm, cancel, save, create, update, delete, position
- Shopping: bankMoney, cashMoney, shoppingBasket, totalPrice, payWithBank, payWithCash
- Shop Management: createShop, shopName, shopDesc, editShop, deleteDialog
- Products: addProduct, productName, productCode, price, category, stock, bulkImport
- Categories: addNewCategory, updateCategoryInfo, createNewCategory, viewItems
- Locations: addNewLocation, editLocation, locationName, locationCoordinates, mapView, listView
- Blip/Ped Settings: createBlip, blipId, blipColor, shopPed, pedModel, pedScenerio
- Ped Placer: coordinates, rotation, adjustCoordinates, placePed, rotatePed, heightAdjust
- Import: importFromInventory, selectItemsToImport, importShop, importShops
- Theme: editTheme, themePresets, customColor, livePreview, saveTheme
- Webhooks: webhookSettings, webhookUrl, webhookEnable, webhookEvents
- Job Permissions: insufficientItemPermission, requiredJob, itemJobRequirement
- Server Messages: PurchaseSuccess, InsufficientFunds, OutOfStock, PaymentFailed, NoPermission
- Interaction: openShop, interactWith, pressToInteract
