Internationalization Updates - UI5 Application
Overview
This document describes the comprehensive internationalization (i18n) updates made to the UI5 application to replace hardcoded English strings with translatable text entries loaded dynamically from the central translation files.
Translation Files Updated
1. _i18n/messages.properties (English)
Added 14 new error-related translation keys:
error.handlerInvalid= Handler called without a valid controllererror.handlerAction= Pressed fromerror.handlerException= An error occurred while processing the actionerror.connectionFailed= Failed to establish connectionerror.modelNotFound= Model not founderror.hanaModelNotFound= HANA model not founderror.logModelNotFound= Log model not founderror.initializationFailed= Failed to initializeerror.controlNotFound= {0} control not founderror.commandNotConfigured= Command not configurederror.httpError= HTTP {0}: Internal Server Errorerror.processingMessage= Error processing WebSocket messageerror.generic= An error occurrederror.appInitFailed= Failed to initialize application
2. _i18n/messages_*.properties (Translations)
Added translations for all 14 new error-related keys in:
- German (
messages_de.properties) - Spanish (
messages_es.properties) - French (
messages_fr.properties) - Japanese (
messages_ja.properties) - Korean (
messages_ko.properties) - Portuguese (
messages_pt.properties) - Simplified Chinese (
messages_zh.properties) - Hindi (
messages_hi.properties) - Polish (
messages_pl.properties)
3. UI Bundle Files (All Languages)
Centralized UI5 application bundles were added under _i18n and served via /i18n:
systemInfo.propertiesand translated variantstables.propertiesand translated variantsinspect.propertiesand translated variantsmassConvert.propertiesand translated variants
Code Files Updated
1. app/resources/common/controller/handler.js
Changes: Replaced hardcoded error messages with i18n keys
- "Handler called without a valid controller" →
error.handlerInvalid - "Pressed from {controllerName}" →
error.handlerAction(with parameter substitution) - "An error occurred while processing the action" →
error.handlerException
2. app/resources/common/controller/BaseController.js
Changes: Updated error fallback messages to use i18n
- "An error occurred" →
error.generic
3. app/resources/massConvert/controller/App.controller.js
Changes: Added I18N_KEYS object and replaced hardcoded strings
- Added 5 new i18n key mappings
- "Log model not found" →
error.logModelNotFound - "Error processing WebSocket message:" →
error.processingMessage - "Failed to establish connection" →
error.connectionFailed - "Output model not found" →
error.modelNotFound
4. app/resources/massConvert/Component.js
Changes: Updated error handling to use i18n
- "Log model not found in Component initialization" →
error.logModelNotFound
5. app/resources/systemInfo/controller/App.controller.js
Changes: Replaced hardcoded error messages
- "HANA model not found" →
error.hanaModelNotFound - "Failed to initialize systemInfo controller:" →
error.initializationFailedwith parameter
6. app/resources/inspect/controller/App.controller.js
Changes: Added I18N_KEYS and replaced error messages
- "Failed to initialize application" →
error.appInitFailed
7. app/resources/inspect/controller/querySimple-ui.controller.js
Changes: Added I18N_KEYS object and error handling
- "Command not configured" →
error.commandNotConfigured - "HTTP {status}: Internal Server Error" →
error.httpError(with parameter)
8. app/resources/inspect/controller/inspectTable-ui.controller.js
Changes: Added I18N_KEYS and parameterized error messages
- "TableInspectTable control not found" →
error.controlNotFound(with parameter) - "Command not configured" →
error.commandNotConfigured - "HTTP {status}: Internal Server Error" →
error.httpError(with parameter)
9. app/resources/inspect/controller/inspectView-ui.controller.js
Changes: Added I18N_KEYS and parameterized error messages
- "ViewInspectView control not found" →
error.controlNotFound(with parameter) - "Command not configured" →
error.commandNotConfigured - "HTTP {status}: Internal Server Error" →
error.httpError(with parameter)
10. app/resources/tables/controller/App.controller.js
Changes: Added I18N_KEYS object
- "HTTP {status}: Internal Server Error" →
error.httpError(with parameter)
i18n Implementation Pattern
All controllers follow this pattern for internationalization:
// Define translation keys
const I18N_KEYS = {
ERROR_KEY: "error.specificError",
// ... more keys
};
// In methods:
const resourceBundle = this.getResourceBundle();
const message = resourceBundle.getText(I18N_KEYS.ERROR_KEY, [param]);
MessageToast.show(message);Benefits
- Complete Localization Support: All user-facing error messages can now be easily translated
- Centralized Management: All messages are managed in one place per language
- Parameterized Messages: Support for dynamic substitution (e.g., control names, HTTP status codes)
- Consistent Pattern: All controllers follow the same i18n pattern
- Easy Maintenance: Adding new messages requires only updating the property files
- Multi-language Ready: Translations included for German, Spanish, French, Japanese, Korean, Portuguese, Simplified Chinese, Hindi, and Polish; easy to add more languages
How to Add New Translations
- Add new key-value pair to
_i18n/messages.properties - Add corresponding translations to all language variants (
_de,_es,_fr,_ja,_ko,_pt,_zh,_hi,_pl) - Reference the key in your JavaScript code using
resourceBundle.getText("key.name") - For parameterized messages, pass an array as the second parameter
How to Add New Languages
- Create a new properties file:
_i18n/messages_[language_code].properties - Copy all entries from
messages.propertiesand translate them - The framework will automatically use the correct language based on user locale
Testing Recommendations
- Test with both English and German language settings
- Verify that error messages appear with correct translations
- Check parameterized messages with different values
- Test console logging to ensure non-user-facing logs still function correctly