-
-
Notifications
You must be signed in to change notification settings - Fork 220
feat: Add Multi-Language Support (i18n) Framework #1256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Develop to Master for Release
Merge Develop into Master for v25.11.1 release
Develop to Master for 25.12 release
Develop to Master for 25.12.1 Maint Release
- Add locale format validation (regex) to prevent path traversal attacks - Add htmlspecialchars() to escape user-controlled output and prevent XSS - Ensure locale format matches expected pattern (e.g., en_US, de_DE) - Escape all language names before HTML output
- Replace regex validation with hardcoded whitelist of allowed locales - Prevents path injection by never using unsanitized user input in paths - Fix XSS vulnerability in redirect URL by using PHP_SELF instead of REQUEST_URI - Update i18n_get_available_languages() to use whitelist instead of directory scan - Add clear documentation for adding new languages to whitelist Security improvements: - Line 90 (i18n.php): Use whitelisted locale value, not user input - Line 32 (language_switcher.php): Sanitize redirect URL with htmlspecialchars - Eliminates all path traversal and XSS attack vectors
- Create lang/en_US/tickets.php with 80+ ticket-related translations - Create lang/de_DE/tickets.php with German translations - Internationalize tickets.php page: - Header (Tickets, Open, Closed counts) - Actions (New Ticket, Export) - Search and filters - View options (List, Kanban) - My Tickets dropdown - Unassigned button - Bulk actions menu (Assign, Category, Priority, Reply, Project, Merge, Resolve) - Advanced filters (Date range, Status, Assigned to) Translations cover: - Page navigation and controls - Bulk operations - Filter labels and placeholders - Status indicators - User-facing text
- Rename second occurrence to 'ticket_status_label' to avoid array key collision - Fixes SonarQube reliability warning about overwritten array values
- Create lang/en_US/clients.php with 75+ client-related translations - Create lang/de_DE/clients.php with German translations - Internationalize clients.php page: - Header (Clients/Leads toggle) - Actions (New, Import, Export) - Search placeholders - Client/Lead filter buttons - Archived toggle - Bulk actions menu (Open Tickets, Set Hourly Rate, Set Industry, Set Referral, Assign Tags, Send Email, Archive/Restore) Translations cover: - Client vs Lead terminology - Filter and navigation controls - Bulk operations - Status indicators - User-facing labels No duplicate keys detected
- Add missing translations: 'ticket', 'billable', 'not_assigned' - Translate all table column headers in ticket_list.php - Translate 'Not Assigned' status text - Now displays: Ticket, Subject, Client, Contact, Billable, Priority, Status, Assigned, Last Response, Created in selected language No duplicate keys detected
- Add helper functions translatePriority() and translateStatus() to map DB values - Translate hardcoded strings: Never, Yes, No, Invoiced - Priority values now translated via priority_* keys from common.php - Status values now translated via status_* keys from common.php - Add missing translations: 'never', 'invoiced' to common module Cell values now fully internationalized
- Added translations to lang/en_US/tickets.php and lang/de_DE/tickets.php: - ticket_details, created_by, category, user, closed - tasks, tasks_completed, view - mark_all_complete, mark_all_incomplete, delete_all - Translated all labels in agent/ticket.php: - Updated, Created, Created by, Source, Category - First Response (FR/EA), Time worked, Resolved - Closed by, Closed, Feedback - Download, View links for attachments - Tasks card header and actions - Tasks Completed progress bar - Added translatePriority() helper function to ticket.php - Priority badges now display translated values (Low/Medium/High) - Maintains consistency with ticket_list.php translation approach
- Removed duplicate keys: closed, view, updated, category, ticket_details - Keys now only defined once in 'Ticket Detail Page' section - Prevents SonarQube 'Duplicate literal' warnings - Maintains all functionality with single key definitions
- Added translateStatus() helper function alongside translatePriority() - Fixes 'Call to undefined function translateStatus()' fatal error - Ticket detail page now loads correctly
- Fixed 'time_worked' translation: 'Bearbeitungszeit' → 'Arbeitszeit' (clearer meaning)
- Added translations: not_assigned, internal_note, public_comment_email, public_comment
- Added translations: redact, edit, archive, created_label, edited
- Added translations: type_response, hours_abbr, minutes_abbr, seconds_abbr, create_task
- Added 'client' and 'submit' to common.php
- Translated all remaining strings in ticket.php:
- 'Not Assigned' badge
- Reply form radio buttons (Internal Note, Public Comment & Email, Public Comment)
- Placeholder text ('Type a response', 'Create Task')
- Time input placeholders (Hrs, Mins, Secs)
- Reply actions dropdown (Redact, Edit, Archive)
- Reply timestamp labels (Created, Edited, Internal)
- Submit button
- Removed duplicate keys from language files
- Added 22 translations to lang/en_US/clients.php and lang/de_DE/clients.php: - back, overview, support, recurring_tickets, projects - vendors, calendar, documentation, licenses, credentials - networks, racks, certificates, domains, services, files - billing, invoices, recurring_invoices, quotes, payments, trips - Translated all menu items in agent/includes/client_side_nav.php: - Back link with client abbreviation - Overview, Contacts, Locations - SUPPORT section (Tickets, Recurring Tickets, Projects) - Vendors, Calendar - DOCUMENTATION section (Assets, Licenses, Credentials, Networks, Racks, Certificates, Domains, Services, Files) - BILLING section (Invoices, Recurring Invoices, Quotes, Payments, Trips) - Section headers now uppercase using strtoupper(__()) - All navigation items now fully translated for client detail pages
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



🌍 Multi-Language Support (i18n) Framework
This PR introduces a comprehensive internationalization system for ITFlow.
Features
Architecture
Demo Modules
Files
includes/i18n.php- Core translation engineincludes/language_switcher.php- Language selector UIlang/de_DE/- German translationslang/en_US/- English translationsNext Steps (Future PRs)