yousoph commented on code in PR #34437:
URL: https://github.com/apache/superset/pull/34437#discussion_r2248513565
##########
superset-frontend/eslint-rules/eslint-plugin-i18n-strings/index.js:
##########
@@ -52,5 +52,134 @@ module.exports = {
};
},
},
+ 'no-title-case': {
+ create(context) {
+ function checkTitleCase(str) {
+ // Skip strings with placeholders like %s, %d, %(name)s, etc.
+ if (/%[sdf]|%\([^)]+\)[sdf]/.test(str)) {
+ return false;
+ }
+
+ // Skip strings that are all uppercase (likely acronyms)
+ if (str === str.toUpperCase()) {
+ return false;
+ }
+
+ // Skip strings with periods (likely multiple sentences)
+ if (str.includes('.')) {
+ return false;
+ }
+
+ // Skip single words
+ const words = str.trim().split(/\s+/);
+ if (words.length <= 1) {
+ return false;
+ }
+
+ // Whitelist of words that are commonly capitalized in product names
+ // but should not trigger title case warnings
+ const productWords = [
+ 'Lab',
+ 'Server',
+ 'Studio',
+ 'Pro',
+ 'Plus',
+ 'Max',
+ 'Mini',
Review Comment:
Other exceptions:
Query A
Query B
Database names ex: `Impersonate logged in user (Presto, Trino, Drill, Hive,
and GSheets)`
Button names, ex: `Shift` (we don't have a case of this in our copy quite
yet)
Days of the week
Advanced analytics, since it refers to a section header
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]