What's i18n message key string case style is recommend?

25 views
Skip to first unread message

Bob Du

unread,
May 16, 2024, 11:21:47 PMMay 16
to Jenkins Developers
What's i18n message key string case style is recommend?

I've reviewed the current i18n message key string case style conventions.
In the core, it is already in a very chaotic state.
Not to mention in various plugins.

some file use PascalCase
like: core/src/main/resources/hudson/cli/Messages.properties

some file use camelCase
like: core/src/main/resources/jenkins/console/Messages.properties

some file use snake_case
like: core/src/main/resources/hudson/model/Cause/UserIdCause/description.properties

some file even mix under_score and CamelCase naming conventions.
like: core/src/main/resources/jenkins/install/Messages.properties

If there were no previous conventions regarding this matter, can we reach a new consensus on which naming style to use in new files?
To be honest, every time I need to add a new message key, I hesitate for quite some time.

PS: I'm not trying to blame anyone. I just hope we can do better going forward.

Mark Waite

unread,
May 17, 2024, 9:43:41 AMMay 17
to Jenkins Developers
I believe there were no conventions previously because the initial default is to use a form of the original message text as the name of the property.

I prefer the camel case format because the properties are fields of their associated Messages class in Java.
 
I prefer to not change the existing property names due to the risk of mistakes and surprises from that type of renaming exercise.

I'm open to other ways of thinking

Mark Waite
Reply all
Reply to author
Forward
0 new messages