Skip to content
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

Add reserved name list for properties, refs 2835 #2840

Merged
merged 1 commit into from
Nov 25, 2017
Merged

Add reserved name list for properties, refs 2835 #2840

merged 1 commit into from
Nov 25, 2017

Conversation

mwjames
Copy link
Contributor

@mwjames mwjames commented Nov 25, 2017

This PR is made in reference to: #2835

This PR addresses or contains:

  • Adds the smwgPropertyReservedNameList setting to list reserved names either as simple string or translatable representation using smw-property-reserved-...
  • The creation isn't blocked and a reserved property can still be used but the following message will appear on the property page for a matchable name.

image

image

This PR includes:

  • Tests (unit/integration)
  • CI build passed

Fixes #

@mwjames mwjames added the enhancement Alters an existing functionality or behaviour label Nov 25, 2017
@mwjames mwjames added this to the SMW 3.0.0 milestone Nov 25, 2017
@mwjames
Copy link
Contributor Author

mwjames commented Nov 25, 2017

@kghbln FYI

@mwjames mwjames merged commit ce42dce into master Nov 25, 2017
@mwjames mwjames deleted the reserved branch November 25, 2017 11:36
@kghbln kghbln added the wikidocu missing Code changes (mostly features) what have not yet been documented label Nov 25, 2017
@kghbln
Copy link
Member

kghbln commented Nov 26, 2017

Documented:

@kghbln kghbln removed the wikidocu missing Code changes (mostly features) what have not yet been documented label Nov 26, 2017
@mwjames
Copy link
Contributor Author

mwjames commented Nov 26, 2017

I documented as if one always has to add the name and the respective system message in pairs.

Let me clarify:

"smw-property-reserved-category" is the message key that holds the warning message in namespace "MediaWiki", i.e. MediaWiki:Smw-property-reserved-category that is shown to the user if the reserved name "Category"

"smw-property-reserved-category" doesn't hold a warning message but a translatable name that is matched against the property name. For example, if the content language is ja then Category (as canonical form) is reserved but also カテゴリ since the name corresponds to a translated string in the content language.

So instead of listing all possible names in $smwgPropertyReservedNameList for any known language, smw-property-reserved-... is a "convention" key allowing us to use the translation system to help maintain a list.

The warning message that is displayed will be the same and is represented by smw-property-name-reserved.

@kghbln
Copy link
Member

kghbln commented Nov 28, 2017

Ah, thanks for noting. This makes a lot of sense! Fluffed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Alters an existing functionality or behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants