DNNCommunity / Dnn.CommunityForums

Open-source forums module for DNN Platform. This is a fork and continuance of the Active Forums module.
https://dnncommunity.org
Other
13 stars 21 forks source link

TASK: Clean up resource strings #484

Open johnhenley opened 1 year ago

johnhenley commented 1 year ago

There are numerous resources that aren't preceded by RESX:
For example

"[RESX:Lock].Text" "Lock.Text"

When used from code or templates, ANYTHING within brackets WITHOUT RESX: should be considered a token rather than a resource string. Therefore [Lock] is invalid.

Timo-Breumelhof commented 1 year ago

Agreed

Timo-Breumelhof commented 1 year ago

BTW, I do think having the [Token] as the name of the item is weird. I think first parsing the tag out would be more logical?

[RESX:Something]

This starts with RESX so I'm going to look for "Something".Text in the resource file?

johnhenley commented 1 year ago

Looking at the history of this module, it looks like RESX: was used to prefix resource strings to distinguish localizable strings from replaceable tokens in templates. But over the past several years, as other maintainers have worked on the module, that practice was abandoned. Is there a different or better way that other modules or the DNN platform accomplish this?

johnhenley commented 1 year ago

BTW, I do think having the [Token] as the name of the item is weird.

I think

first parsing the tag out would be more logical?

[RESX:Something]

This starts with RESX so I'm going to look for "Something".Text in the resource file?

No you would look for [RESX:Something].Text

Timo-Breumelhof commented 1 year ago

I understand how it works (although I have not seen anybody use it this way) but looking at this:

https://github.com/DNNCommunity/Dnn.CommunityForums/blob/1e6d03052d34ef33838aaa07fcbf7bac559fec8e/Dnn.CommunityForums/App_LocalResources/SharedResources.resx#L210

IMO a RESX file is to define terms and values used in an Extension. I wonder why the name would have to indicate where it's used?

Some lines could be used in multiple places right? Like in the admin interface and a template? Maybe that's the reason some don't have RESX?

Also this is in Sharedresources, IMO when you would want values only available in Templates they could have create a

Templates.resx file for that?

I'm not saying this needs to be changed as it works, just wonder what's the most logical approach.

@WillStrohl hat do you think?