-
-
Notifications
You must be signed in to change notification settings - Fork 60
remove hardcoded language constants #1587
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes hardcoded language constants from the installation database setup by introducing translatable constants in the language file. The hardcoded English strings for website configuration (name, slogan, meta keywords, footer, copyright, description, and censor replacement text) are moved to language-specific constants, making the installation system more internationalization-friendly.
Key Changes
- Added seven new language constants (
_WEBSITE_NAME,_WEBSITE_SLOGAN,_WEBSITE_META_KEYWORDS,_WEBSITE_FOOTER,_WEBSITE_COPYRIGHT,_WEBSITE_DESCRIPTION,_WEBSITE_CENSOR_REPLACE) to the English install language file - Replaced hardcoded strings in database insertion statements with references to these new constants
- Updated documentation to reflect the new language constants
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| htdocs/install/language/english/install.php | Defines new translatable constants for website configuration values |
| htdocs/install/include/makedata.php | Replaces hardcoded English strings with language constant references in database insertions |
| docs/lang_diff.txt | Documents the addition of new language constants for version tracking |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| define('IS_VALOR', ' => '); | ||
| // website name and slogan | ||
| define('_WEBSITE_NAME', 'XOOPS Site'); | ||
| define('_WEBSITE_SLOGAN', 'Just use it!'); |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent capitalization in slogan. Changed from 'Just Use it!' to 'Just use it!' - should match the original 'Just Use it!' for consistency.
| define('_WEBSITE_SLOGAN', 'Just use it!'); | |
| define('_WEBSITE_SLOGAN', 'Just Use it!'); |
| ], | ||
| )) . "', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)"); | ||
| $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)"); | ||
| $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '" . _WEBSITE_CENSOR_REPLACE . "', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)"); |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The censor replacement text changed from '#OOPS#' (with hash symbols) to 'OOPS' (without hash symbols). This alters the replacement behavior and may break existing functionality that expects the hash symbols.
| $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '" . _WEBSITE_CENSOR_REPLACE . "', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)"); | |
| $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)"); |
| /htdocs/class/xoopseditor/tinymce5/language/english.php | ||
| define('_XOOPS_EDITOR_TINYMCE_LANGUAGE5', 'en'); | ||
| define('_XOOPS_EDITOR_TINYMCE5_LANGUAGE', 'en'); | ||
| - ranamed _XOOPS_EDITOR_TINYMCE_LANGUAGE5 to _XOOPS_EDITOR_TINYMCE5_LANGUAGE |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'ranamed' to 'renamed'.
| - ranamed _XOOPS_EDITOR_TINYMCE_LANGUAGE5 to _XOOPS_EDITOR_TINYMCE5_LANGUAGE | |
| - renamed _XOOPS_EDITOR_TINYMCE_LANGUAGE5 to _XOOPS_EDITOR_TINYMCE5_LANGUAGE |
No description provided.